Days of action

I was planning to go to the Montreal Jazz Festival with some friends on the weekend. Alas that was not meant to be as some Indians decided to shutdown the railroad and 401 highway between Ontario and Quebec.

I’ve been working with Ruby on Rails for the last couple of weeks. We are using it to build our support website. So since I had some free time this weekend, I continued on with that.

Overall, I’ve been impressed by RoR. It’s been very easy to learn. It’s a huge improvement over other frameworks I’ve used.

Getting it working with Apache was fairly simple, only ran into a couple of small hick ups. Here is how I got things working on RHEL v5:

# yum install ruby ruby-devel ruby-rdoc
# tar zxvf /path/to/rubygems-0.9.4.tgz
# cd rubygem-0.9.4
# ruby setup.rb
# gem install rails --include-dependencies

# yum install httpd-devel httpd apr apr-devel apr-util-devel emacs-common mysql-devel
# wget http://www.fastcgi.com/dist/fcgi-2.4.0.tar.gz
# tar zxvf fcgi-2.4.0.tar.gz
# cd fcgi-2.4.0
# make && make install

# wget http://prdownloads.sourceforge.net/mod-fcgid/mod_fcgid.2.1.tar.gz?download
# tar zxvf mod_fcgid.2.1.tar.gz
# cd mod_fcgid-2.4.2
# cp Makefile.AP2 Makefile
# nano -w Makefile

top_dir =/usr/lib/httpd
INCLUDES=-I /usr/include/httpd -I /usr/include/apr-0

# make && make install

# nano -w /etc/ld.so.conf.d/ruby
/usr/local/lib
# ldconfig
# gem install fcgi
# gem install mysql -- --with-mysql-config=/usr/bin/mysql_config

(select option #3, mysql 2.7 (ruby))

# nano -w /etc/httpd/conf.d/fcgid.conf

LoadModule fcgid_module /usr/lib/httpd/modules/mod_fcgid.so

<IfModule mod_fcgid.c>
SocketPath /tmp/fcgid_sock/
AddHandler fcgid-script .fcgi
</IfModule>

# nano -w /etc/httpd/conf.d/vhosts.conf

<VirtualHost *:80>
SetEnv RAILS_ENV development
ServerName www.myserver.com
DocumentRoot /path/to/railsapp/public
ErrorLog /path/to/railsapp/log/apache.log

<Directory /path/to/railsapp/public>
Options ExecCGI FollowSymLinks
AddHandler fcgid-script .fcgi
AllowOverride all
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

# nano -w /path/to/railsapp/public/.htaccess

RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
AddHandler fcgid-script .fcgi

# service httpd restart

Leave a Reply



  •  

    July 2007
    M T W T F S S
    « Jun   Aug »
     1
    2345678
    9101112131415
    16171819202122
    23242526272829
    3031  
  • Categories

  • Archives

  • Meta