Tuesday, April 24, 2007

Configuring Apache 2 with mod_proxy and mongrel_rails on SuSe 9x

In the process of forcing helping a friend with his conversion from Coldfusion to Ruby on Rails, we had to get him set up with a way to run multiple rails apps from his hosting machine. Here is what I discovered when I investigated using Apache 2 and mod_proxy to host rails apps through mongrel_rails:

NOTE: the examples use su -, but I would recommend using sudo instead.

Apache 2 / mod_proxy



mod_proxy was already installed (with yast) and just needed some configuration:


  1. su -
  2. to file /etc/sysconfig/apache2, add:
    proxy proxy_ftp proxy_http proxy_connect
    to the APACHE_MODULES= line

  3. create /etc/apache2/vhost.d/example.com.conf
    because apache isn't hosting any files, this is rather shorter than his apache/coldfusion vhost files


    <VirtualHost *:80>
    ServerAdmin webmaster@example.com
    ServerName www.example.com

    # if not specified, the global error log is used
    ErrorLog /var/log/apache2/example.com-error_log
    CustomLog /var/log/apache2/example.com-access_log combined

    # Avoid open your server to proxying
    ProxyRequests Off

    # Let apache correctly rewrite redirect
    ProxyPass / http://hishostname.com:8000/
    ProxyPassReverse / http://hishostname.com:8000/

    # Let apache pass the original host not the ProxyPass one
    ProxyPreserveHost On

    # don't lose time with IP address lookups
    HostnameLookups Off

    # needed for named virtual hosts
    UseCanonicalName Off

    # configures the footer on server-generated documents
    ServerSignature On
    </VirtualHost>



mongrel_rails



  1. su -
  2. gem install mongrel -y
  3. export your source from version control to a likely directory (preferably as a non root user)
  4. cd to your base rails directory
  5. type something along the following lines:

    mongrel_rails start -e production -d -p 8000 -l log/mongrel.log -n 20



anyway, thats it man. its freakin magnificent.
except the SuSe part. Get a useable server, yast sucks.

--Christopher

Sunday, April 15, 2007

LinkGrabber

I've finished a release of linkgrabber, you can go to links.boxgnome.com to see current output.

If you're on a channel linkgrabber lives on, you can ask for 'last' or 'channels' or 'help', by doing a /msg linkgrabber last|channels|help

Black Widow vs Hobo

We found a hobo spider in an old backpack, and I put it in the cage with my black widow. here's the video: http://video.google.com/videoplay?docid=4529105889870787216

Saturday, April 07, 2007

LinkGrabber

I've written a ruby based IRC bot called linkgrabber. Its really a clean little bot, with no interface to mess with it from a channel. It's silent.

All interface with the links will be done via a rails app that uses the same db.
Features coming soon to the web interface (once i get done writing it):

  • RSS Feeds of the links
  • Voting - enough ups and it'll be added to a del.icio.us feed, enough downs and it'll be deleted
  • Annotations


Anyway. I'll post more here as I get more done. The bot is currently grabbing links in #nogoodshits.