1. sudo a2enmod proxy
2. sudo a2enmod proxy_balancer
3. sudo a2enmod proxy_http
4. sudo a2enmod rewrite
5. sudo /etc/init.d/apache2 force-reload
6. sudo nano /etc/apache2/sites-available/domain.com
<VirtualHost *:80>
ServerName domain.com
ServerAlias www.domain.com
DocumentRoot /home/demo/public_html/railsapp/public
RewriteEngine On
<Proxy balancer://thinservers>
BalancerMember http://127.0.0.1:5000
BalancerMember http://127.0.0.1:5001
BalancerMember http://127.0.0.1:5002
</Proxy>
# Redirect all non-static requests to thin
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule ^/http-bind(.*) http://127.0.0.1:5280%{REQUEST_URI} [P,QSA,L]
RewriteRule ^/(.*)$ balancer://thinservers%{REQUEST_URI} [P,QSA,L]
#ProxyPass / balancer://thinservers/
#ProxyPassReverse / balancer://thinservers/
#ProxyPreserveHost on
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
# Custom log file locations
ErrorLog /home/demo/public_html/railsapp/log/error.log
CustomLog /home/demo/public_html/railsapp/log/access.log combined
</VirtualHost>