Debian Sarge (3.1) with Ruby on Rails and Apache 2 with FastCGI - Page 4

Want to support HowtoForge? Become a subscriber!
Submitted by tomw (Contact Author) (Forums) on Wed, 2006-05-10 12:21. ::

Install Apache and Ruby

apt-get install apache2 apache2-doc
apt-get install libapache2-mod-php4 libapache2-mod-perl2 php4 php4-cli php4-common php4-curl php4-dev php4-domxml php4-gd php4-imap php4-ldap php4-mcal php4-mhash php4-mysql php4-odbc php4-pear php4-xslt curl libwww-perl imagemagick
apt-get install ruby ruby1.8-dev rdoc apache2-prefork-dev make

Edit /etc/apache2/apache2.conf.

joe /etc/apache2/apache2.conf


DirectoryIndex index.html index.cgi index.php index.xhtml


DirectoryIndex index.html index.htm index.shtml index.cgi index.php index.php3 index.xhtml

Edit /etc/mime.types and comment out the following lines:

joe /etc/mime.types

#application/x-httpd-php                        phtml pht php
#application/x-httpd-php-source phps
#application/x-httpd-php3 php3
#application/x-httpd-php3-preprocessed php3p
#application/x-httpd-php4 php4

Edit /etc/apache2/mods-enabled/php4.conf and comment out the following lines:

joe /etc/apache2/mods-enabled/php4.conf

<IfModule mod_php4.c>
# AddType application/x-httpd-php .php .phtml .php3
# AddType application/x-httpd-php-source .phps

Edit /etc/apache2/ports.conf and add Listen 443:

joe /etc/apache2/ports.conf

Listen 80
Listen 443

Now we have to enable some Apache modules (SSL, rewrite and suexec):

a2enmod ssl
a2enmod rewrite
a2enmod suexec

Install the FastCGI library

*Note 2.4.0 is the current version if it is not available visit to get the latest.

cd /usr/local/src
tar xvzf fcgi-2.4.0.tar.gz
cd fcgi-2.4.0
./configure && make && make install

Installation of for Apache2

Download the mod_fastcgi sources from If the Link is not working, try to get the latest mod_fastcgi sources instead. Make the mod_fastcgi module.

cd /usr/local/src
tar xvzf mod_fastcgi-2.4.2.tar.gz
cd mod_fastcgi-2.4.2
cp Makefile.AP2 Makefile
make top_dir=/usr/share/apache2
make install top_dir=/usr/share/apache2

Enable mod_fastcgi in Apache2

echo 'LoadModule fastcgi_module /usr/lib/apache2/modules/' > /etc/apache2/mods-available/fastcgi.load
a2enmod fastcgi

Installation of ruby-fcgi bindings, Ruby GEM and Rails:

Download the ruby-fcgi bindings from If the Link is not working, try to get the latest ruby-fcgi bindings instead.

cd /usr/local/src
tar xvzf ruby-fcgi-0.8.6.tar.gz
cd ruby-fcgi-0.8.6
ruby install.rb config
ruby install.rb setup
ruby install.rb install
cd /usr/local/src
tar zxvf rubygems-0.8.11.tgz
cd rubygems-0.8.11
ruby1.8 setup.rb
gem install rubygems-update
gem install rails --include-dependencies
gem install mysql

Answer 2 mysql 2.7(ruby)

Restart Apache:

/etc/init.d/apache2 restart

Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.