To install the great Mod_Rails on Gentoo linux it's as easy as 4 steps.
Since you are Gentoo user, i don't need to go to details. You know what you doing. ;)
1. Recompile Apache non-threaded
add this to /etc/portage/package.usewww-servers/apache -threadsand this to /etc/make.conf
APACHE2_MPMS="prefork"
2. emerge -va apache
3. gem install passenger
4. passenger-install-apache2-module
that's it. now just follow the intructions in the passenger installation process.This is a sample vhost file for a rails app. you just throw it inside /etc/apache2/vhosts.d/
< VirtualHost *:80 >
ServerName <%= domain_name %>
DocumentRoot /myapp/public
Include /etc/apache2/vhosts.d/deflate.conf
RailsBaseURI /
# The maximum number of Ruby on Rails application instances that may be simultaneously active.
# A larger number results in higher memory usage, but improved ability to handle concurrent HTTP clients.
# normally 2 to 10, would be nice. (1 for each 40mb ram)
RailsMaxPoolSize 3
# The maximum number of seconds that a Ruby on Rails application instance may be idle.
# That is, if an application instance hasn't done anything after the given number of seconds,
# then it will be shutdown in order to conserve memory. ( 1 hour)
RailsPoolIdleTime 3600
RailsEnv 'production'
< Directory /myapp/public >
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
< / Directory >
< / VirtualHost >
My sample deflate.conf,
used to gzip the content
< Location / >
SetOutputFilter DEFLATE
#
# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html
#
# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip
#
# MSIE masquerades as Netscape, but it is fine
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
# the above regex won't work. You can use the following
# workaround to get the desired effect:
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
# Don't compress images
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary
# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary
< / Location >
DeflateFilterNote Input instream
DeflateFilterNote Output outstream
DeflateFilterNote Ratio ratio
LogFormat '"%r" %{output_info}n/%{input_info}n (%{ratio_info}n%%)' deflate
CustomLog /var/log/apache2/deflate_log deflate
