PDA

View Full Version : Validate Changes for Mongrel Setup


runbuck
26th November 2007, 05:59
I am trying to setup mongrel as the back end on a Ruby on Rails setup. I wanted to get some feedback on if I am putting the config in the right places given ISPConfig being in the loop. Here is the settings I am supposed to apply (replacing EVERYTHING) in /etc/apache2/sites-available/default:

NameVirtualHost *:80

#Add this if necessary
ServerName myapp

<Proxy *>
Order allow,deny
Allow from all
</Proxy>

#Proxy balancer section (Add as many BalancerMembers as you have
#Mongrel servers running
<Proxy balancer://myapp_cluster>
BalancerMember http://myapp:8000
BalancerMember http://myapp:8001
</Proxy>

#Virtual host section
<Virtualhost *:80>
ServerName myapp
DocumentRoot /home/railsuser/rails/myapp/public/

<Directory /home/railsuser/rails/myapp/public/ >
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>

#log files
ErrorLog /var/log/apache2/myapp_error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/myapp_access.log combined

#Rewrite stuff
RewriteEngine On

# Check for maintenance file and redirect all requests
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 ^/(.*)$ balancer://myapp_cluster%{REQUEST_URI} [P,QSA,L]
</VirtualHost>

Here are my questions:

1. I assume the stuff prior to the <VirtualHost> would go in the default file? right?
2. Is it ok to nuke the stuff in <VirtualHost>? So far I haven't changed it from default setup of apache. Didn't know if the ISPConfig install messed with it.
3. I assume the stuff in <VirtualHost> ... </VirtualHost> would go in the optional directives field in ISPConfig for the website in question.

Other thoughts?

runbuck
26th November 2007, 06:03
http://www.howtoforge.com/forums/showthread.php?p=95785#post95785

Sorry posted in wrong area