Hi Folks, I'm fairly new to ruby on rails and web development. Here is my setup which I followed from this link http://tonyrose023.blogspot.com/2007/01/multiple-rails-apps-with-mongrel.html I run multiple rails applications on Apache2 with Mongrel clusters.
http://services.abc.edu/app1 http://services.abc.edu/app2 http://services.abc.edu/app3
This is what my 'virtual host' (/etc/apache2/sites-availabe/services.abc.edu) file looks like
--------------
<Proxy balancer://app1>
BalancerMember http://services.abc.edu:8000
BalancerMember http://services.abc.edu:8001
BalancerMember http://services.abc.edu:8002
Order deny,allow
Deny from all
Allow from all
</Proxy>
<Proxy balancer://app2>
BalancerMember http://services.abc.edu:8004
BalancerMember http://services.abc.edu:8005
Order deny,allow
Deny from all
Allow from all
</Proxy>
<Proxy balancer://app3>
BalancerMember http://services.abc.edu:8006
BalancerMember http://services.abc.edu:8007
Order deny,allow
Deny from all
Allow from all
</Proxy>
<VirtualHost *:80>
ServerName services.abc.edu
DocumentRoot /home/joe/projects/app1/public
<Directory "/home/joe/projects/app1/public">
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<Directory "/home/joe/projects/app2/public">
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<Directory "/home/joe/projects/app3/public">
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
RewriteEngine On
# 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]
RewriteRule ^/app1(.*)$ balancer://app1%{REQUEST_URI} [P,QSA,L]
RewriteRule ^/app2(.*)$ balancer://app2%{REQUEST_URI} [P,QSA,L]
RewriteRule ^/app3(.*)$ balancer://app3%{REQUEST_URI} [P,QSA,L]
</VirtualHost>
-----------------------------------------
My questions are
1) If anybody can comment on my setup and offer any suggestions would be great.
2) As you can see I have one DocumentRoot, although right now all the 3 apps work since they use same images but I think in the future I need to have DocumentRoot for each app
3) I need to get the apps running securely so I need to make this run with SSL (port 443) and I need some help with making it run with SSL. Any pointers would be helpful since I never installed a cert. I created the csr and the key and I have the cert with me. I'm researching on what are the next steps.
Thanks!