I'm trying to completely replace the current virtual host autogenerated in httpd.conf with the following (its for a ruby app). I put this in extra.conf at the location that httpd.conf specifies for each virtual host block (its something like userdata/std/2/username/site.org/*.conf:

<VirtualHost *:80>
    ServerName www.site.org
    DocumentRoot /home/why/app/public
    <Directory /home/why/app/public>
        Allow from all
        Options -MultiViews

I say 'overwrite' because when i run /scripts/ensure_vhost_includes --all-users it tells me that <VirtualHost> cannot occur within <VirtualHost> section. Obivously that means I need to reformat the virtualhost, but I am new to apache and I just want it to use what i'm including rather than trying to 'integrate' it with the current virtualhost. My knowledge isnt good enough to know if its doing it right, so I'd like to use exactly what I'm given from Phusion Passenger (a deployment apache module): http://www.modrails.com/documentation/Users%20guide%20Apache.html


If you add your virtual's full config as a "Pre VirtualHost Include", it will override the corresponding auto-generated config.

To do this, go to the "Apache Configuration" section of the Service Configuration area, and select the Include Editor. The "Pre VirtualHost Include" section is there.

Be sure to replicate all of the auto-generated configuration options that you want to keep, of course! You said that you wanted to just follow that particular recipe, but I'd take a few moments to make sure that you're not leaving out something that's a good idea for your particular hosting setup, etc.

Not the answer you're looking for? Browse other questions tagged or ask your own question.