Instalação · 1 min read · Feb 01, 2026
Debian Sarge (3.1) com Ruby on Rails e Apache 2 com FastCGI - Página 4
Instalar Apache e 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 makeEdite /etc/apache2/apache2.conf.
joe /etc/apache2/apache2.confmude:
| DirectoryIndex index.html index.cgi index.pl index.php index.xhtml |
para
| DirectoryIndex index.html index.htm index.shtml index.cgi index.php index.php3 index.pl index.xhtml |
Edite /etc/mime.types e comente as seguintes linhas:
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 |
Edite /etc/apache2/mods-enabled/php4.conf e comente as seguintes linhas:
joe /etc/apache2/mods-enabled/php4.conf| |
Edite /etc/apache2/ports.conf e adicione Listen 443:
joe /etc/apache2/ports.conf| Listen 80 Listen 443 |
Agora precisamos habilitar alguns módulos do Apache (SSL, rewrite e suexec):
a2enmod ssl
a2enmod rewrite
a2enmod suexecInstalar a biblioteca FastCGI
*Nota 2.4.0 é a versão atual, se não estiver disponível, visite www.fastcgi.com para obter a mais recente.
cd /usr/local/src
wget http://www.fastcgi.com/dist/fcgi-2.4.0.tar.gz
tar xvzf fcgi-2.4.0.tar.gz
cd fcgi-2.4.0
./configure && make && make installInstalação do mod_fastcgi.so para Apache2
Baixe as fontes do mod_fastcgi em http://www.fastcgi.com/dist/mod_fastcgi-2.4.2.tar.gz. Se o link não estiver funcionando, tente obter as fontes mais recentes do mod_fastcgi. Faça o módulo mod_fastcgi.
cd /usr/local/src
wget http://www.fastcgi.com/dist/mod_fastcgi-2.4.2.tar.gz
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/apache2Habilite o mod_fastcgi no Apache2
echo 'LoadModule fastcgi_module /usr/lib/apache2/modules/mod_fastcgi.so' > /etc/apache2/mods-available/fastcgi.load
a2enmod fastcgiInstalação dos bindings ruby-fcgi, Ruby GEM e Rails:
Baixe os bindings ruby-fcgi em http://sugi.nemui.org/pub/ruby/fcgi/ruby-fcgi-0.8.6.tar.gz. Se o link não estiver funcionando, tente obter os bindings ruby-fcgi mais recentes.
cd /usr/local/src
wget http://sugi.nemui.org/pub/ruby/fcgi/ruby-fcgi-0.8.6.tar.gz
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
wget http://rubyforge.org/frs/download.php/5207/rubygems-0.8.11.tgz
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 mysqlResposta 2 mysql 2.7(ruby)
Reinicie o Apache:
/etc/init.d/apache2 restartReceba novas postagens na sua caixa de entrada
Sem spam. Cancele a assinatura a qualquer momento.