Correct Setup of Mongrel

Discussion in 'Installation/Configuration' started by runbuck, Nov 26, 2007.

  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
    # 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
    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


    So, reviewed how the /etc/apache2/vhosts/Vhosts_ispconfig.conf behaved when I edited the optional directives. Given that I did the following:

    1. Left the stuff I indicated in default
    2. Didn't put in these rows (redundant to what ISPCONFIG creates)

    ServerName ServerAlias *
    DocumentRoot /var/www/web1/web​
    3. Put the rest in the directives field.

    Now I am work on a 403 error instead. That should be simple enough.
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    You can ot et these directives manually.

Share This Page