Ok, I know what's going on but I can't seem to be able to fix it.
What's happening is that Apache is not forwarding requests for the
application to the balancer. And I can't figure out why. Here's my
Apache config (sorry if it's too verbose):
<Proxy balancer://bugtracker>
BalancerMember http://127.0.0.1:2600
BalancerMember http://127.0.0.1:2601
BalancerMember http://127.0.0.1:2602
BalancerMember http://127.0.0.1:2603
BalancerMember http://127.0.0.1:2604
</Proxy>
ExtendedStatus On
<VirtualHost 127.0.0.1:9000>
ServerName bugtracker
DocumentRoot /var/www/bugtracker/current/public
<Location /server-status>
SetHandler server-status
</Location>
<Location /balancer-manager>
SetHandler balancer-manager
</Location>
<Directory /var/www/bugtracker/current/public">
Options FollowSymLinks
# AllowOverride None
Order allow,deny
Allow from all
</Directory>
RewriteEngine On
RewriteLog /var/log/apache2/myapp_rewrite_log
RewriteLogLevel 9 # This has no effect -- nothing is written to the
log for some reason
RewriteRule .* balancer://bugtracker%{REQUEST_URI} [P,QSA,L]
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 ^/bugtracker(.*)$ balancer://bugtracker%{REQUEST_URI}
[P,QSA,L]
AddOutputFilterByType DEFLATE text/html text/plain text/xml
application/xml application/xhtml+xml text/javascript text/css
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \\bMSIE !no-gzip !gzip-only-text/html
ErrorLog /var/log/apache2/rails_errors.log
CustomLog /var/log/apache2/rails.log combined
</VirtualHost>/
I took the config from here:
http://blog.codahale.com/2006/06/19/time-for-a-grown-up-server-rails-mongrel-apache-capistrano-and-you
and modified the appropriate stuff.
Whenever I try something like "links http://localhost:9000", I get
"Forbidden". http://localhost:9000/server-status and
http://localhost:9000/balancer-manager don't work either.
Oh, by the way, with AllowOverride None uncommented, none of the
directives in .htaccess under public were allowed -- as expected I
think. I listened on ports 2600 through 2604 and nothing came in. So
that's how I know for sure that the requests were not forwarded. The
reason why it works at all (even though in the development mode) is
because apache interprets dispatch.fcgi thanks to the DocumentRoot in
the config.
Any ideas?