Inclua no final do arquivo a seguinte configuração:
<VirtualHost *>
ServerName redhatonrails
ErrorLog /suaapp/log/errors.log
CustomLog /suaapp/log/apache.log combined
<Directory "/suaapp/public/">
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
RewriteEngine On
# Check for maintenance file and redirect all requests
# ( this is for use with Capistrano's disable_web task )
RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
RewriteRule ^.*$ /system/maintenance.html [L]
# Rewrite index to check for static
RewriteRule ^/$ /index.html [QSA]
# Rewrite to check for Rails cached page
RewriteRule ^([^.]+)$ $1.html [QSA]
# Redirect all non-static requests to cluster
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)$ balancer://mongrel_cluster%{REQUEST_URI} [P,QSA,L]
# Deflate
AddOutputFilterByType DEFLATE text/html text/plain text/css
# ... text/xml application/xml application/xhtml+xml text/javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
<Proxy *>
Order allow,deny
Allow from all
</Proxy>
<Proxy balancer://mongrel_cluster>
BalancerMember http://127.0.0.1:6000
BalancerMember http://127.0.0.1:6001
BalancerMember http://127.0.0.1:6002
BalancerMember http://127.0.0.1:6002
BalancerMember http://127.0.0.1:6002
</Proxy>
</VirtualHost>
Vamos criar um arquivo de inicialização para o Mongrel Cluster:
# ln -s /usr/local/lib/ruby/gems/1.8/gems/mongrel_cluster-1.0.5/\
resources/mongrel_cluster /etc/rc.d/init.d/mongrel_cluster
# chmod +x /etc/rc.d/init.d/mongrel_cluster
Inicie o Mongrel e o Apache:
# /usr/local/apache2/bin/apachectl start
# /etc/rc.d/init.d/mongrel_cluster start
Só correr para o abraço e acessar sua aplicação...
http://ip_do_server/
É isso aí, espero ter ajudado!
Abraços,
Marcos Miras
marcosmiras@atmsystem.com.br