0

I'm trying to think of an apache configuration based on the one from the docs where each virtualhost is essentially the same, but I wan't to add an include directive pointing to a config file to differentiate each one, allowing differences in config, without using an htaccess file.

# get the server name from the Host: header
UseCanonicalName Off

# this log format can be split per-virtual-host based on the first field
LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon
CustomLog logs/access_log vcommon

# include the server name in the filenames used to satisfy requests
VirtualDocumentRoot /www/hosts/%0/docs
VirtualScriptAlias /www/hosts/%0/cgi-bin

But I don't suppose I can add Include /www/hosts/conf/%0.conf or something similar?

Is there any standard way of doing this?

1 Answer 1

0

Include one file in which you can, if needed, define Virtualhost container for every modified from default settings virthost. It's not standard, but widely used practice.

I use it and find more easy to maintain 1 file than (rather) long set

2
  • Sounds good. Does each VirtualHost container you specify in that file inherit from the default, or would you have to specify the DocumentRoot, ServerName, etc.. again?
    – Adam
    Nov 5, 2011 at 12:50
  • I write all explicitly, can't recall reasons for "why" and add additional definitions Nov 5, 2011 at 13:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .