Hi all,

I am attempting to setup two disparate sites on a single in-house
host.
I have the first one up and going OK and dont want to bend it while
bringing up a second.

Is this apache / mongrel config appropriate ? Currently the Proxy line
for the mongrel stuff is
<Proxy balancer://mongrel_cluster>

I am assuming that I can change the name(s) to this
<Proxy balancer://app_one_cluster>
<Proxy balancer://app_two_cluster>

cheers
mjt

--------8<-------------
#
# Virtual Site ONE  mongrel ports at 5000+
#
<VirtualHost *:80>
  ServerName app_one.com
  DocumentRoot /var/rails/app_one/current/public
  <Directory "/var/rails/app_one/current/public">
    Options FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
  </Directory>
  # Configure mongrel_cluster
  <Proxy balancer://app_one_cluster>
    BalancerMember http://127.0.0.1:5000
    BalancerMember http://127.0.0.1:5001
    BalancerMember http://127.0.0.1:5002
  </Proxy>
  RewriteEngine On
  # If there is a maintenence.html file in your
  # public dir all requests will get rerouted to
  # this file.
  RewriteCond %{DOCUMENT_ROOT}/maintenance.html -f
  RewriteCond %{SCRIPT_FILENAME} !maintenance.html
  RewriteRule ^.*$ /maintenance.html [L]
  # Rewrite index to check for static index.html
  RewriteRule ^/$ /index.html [QSA]
  # Rewrite to check for Rails cached pages with .html extentions
  RewriteRule ^([^.]+)$ $1.html [QSA]
  # All dynamic requests get sent to the mongrel cluster
  RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
  RewriteRule ^/(.*)$ balancer://app_one_cluster%{REQUEST_URI}
[P,QSA,L]
  # Deflate
  AddOutputFilterByType DEFLATE text/html text/plain text/xml
  BrowserMatch ^Mozilla/4 gzip-only-text/html
  BrowserMatch ^Mozilla/4\.0[678] no-gzip
  BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
  ErrorLog logs/app_one_error_log
  CustomLog logs/your_access_log combined
</VirtualHost>

#
# Virtual Site TWO  mongrel ports at 5020+
#
<VirtualHost *:80>
  ServerName app_two.com
  DocumentRoot /var/rails/app_two/current/public
  <Directory "/var/rails/app_two/current/public">
    Options FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
  </Directory>
  # Configure mongrel_cluster
  <Proxy balancer://app_two_cluster>
    BalancerMember http://127.0.0.1:5020
    BalancerMember http://127.0.0.1:5021
    BalancerMember http://127.0.0.1:5022
  </Proxy>
  RewriteEngine On
  # If there is a maintenence.html file in your
  # public dir all requests will get rerouted to
  # this file.
  RewriteCond %{DOCUMENT_ROOT}/maintenance.html -f
  RewriteCond %{SCRIPT_FILENAME} !maintenance.html
  RewriteRule ^.*$ /maintenance.html [L]
  # Rewrite index to check for static index.html
  RewriteRule ^/$ /index.html [QSA]
  # Rewrite to check for Rails cached pages with .html extentions
  RewriteRule ^([^.]+)$ $1.html [QSA]
  # All dynamic requests get sent to the mongrel cluster
  RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
  RewriteRule ^/(.*)$ balancer://app_two_cluster%{REQUEST_URI}
[P,QSA,L]
  # Deflate
  AddOutputFilterByType DEFLATE text/html text/plain text/xml
  BrowserMatch ^Mozilla/4 gzip-only-text/html
  BrowserMatch ^Mozilla/4\.0[678] no-gzip
  BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
  ErrorLog logs/app_two_error_log
  CustomLog logs/your_access_log combined
</VirtualHost>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Deploying Rails" group.
To post to this group, send email to rubyonrails-deployment@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-deployment?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to