find azureusonrails/public -type d -print0 | xargs --null chmod o+x find azureusonrails/public -type f -print0 | xargs --null chmod o+r chmod o+r azureusonrails/public/.htaccess chmod o+x azureusonrails
gem install mongrel_cluster
mongrel_rails cluster::configure -e production -p 8000 -N 3 -c /home/azureus/azureusonrails -a 127.0.0.1 --user azureus --group azureus
mongrel_rails cluster::start
<VirtualHost *:80>
ServerName azureus.example.org
DocumentRoot /home/azureus/azureusonrails/public
<Directory /home/azureus/azureusonrails/public>
AllowOverride FileInfo Indexes
</Directory>
RewriteEngine On
# Redirect all non-static requests to Mongrel
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)$ balancer://azureusonrails%{REQUEST_URI} [P,QSA,L]
ProxyPassReverse / balancer://azureusonrails
ProxyPreserveHost on
<Proxy balancer://azureusonrails>
BalancerMember http://localhost:8000
BalancerMember http://localhost:8001
BalancerMember http://localhost:8002
</Proxy>
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
# Block access to .svn directories
<DirectoryMatch "^/.*/\.svn/">
ErrorDocument 403 /404.html
Order allow,deny
Deny from all
Satisfy All
</DirectoryMatch>
</VirtualHost>
You will probably also want to add options to the virtual host configuration to require authentication or restrict access to specific IP addresses.
To stop the Mongrel cluster, run:
mongrel_rails cluster::stop
Further information about mongrel_cluster, including instructions for setting up an init.d script to start the cluster at boot time can be found at http://mongrel.rubyforge.org/docs/mongrel_cluster.html.