Validate Changes for Mongrel Setup

Discussion in 'HOWTO-Related Questions' started by runbuck, Nov 26, 2007.

Thread Status:
Not open for further replies.
  1. runbuck

    runbuck New Member

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

    #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

    #log files
    ErrorLog /var/log/apache2/myapp_error.log
    # 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

    # Redirect all non-static requests to cluster
    RewriteRule ^/(.*)$ balancer://myapp_cluster%{REQUEST_URI} [P,QSA,L]

    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?
  2. runbuck

    runbuck New Member

Thread Status:
Not open for further replies.

Share This Page