Sharing settings between a few virtual hosts in Apache

Posted by Ivan Virabyan on Server Fault See other posts from Server Fault or by Ivan Virabyan
Published on 2010-05-05T07:56:21Z Indexed on 2010/05/05 7:58 UTC
Read the original article Hit count: 356

Filed under:
|

There are many virtual hosts in my apache configuration, each having quite a big amount of settings. The problem is that most of the virtual servers have the same settings. So config file is huge, full of identical virtual hosts, that differ only by ServerName directive. To change or add setting, I need to go through all of these vhosts.
Is it possible to somehow share settings between virtual hosts, but still having few of them with their own ones?
I hoped dynamic vhosts would be a good solution, but as I understand, it doesn't fit my problem, because there is no way to set specific settings for some of the vhosts. Furthermore I don't want my vhosts to be dynamic, because I have a fixed number of them. ServerAlias directive is also not a solution, because I need to know what url the user came from.

© Server Fault or respective owner

Related posts about apache

Related posts about vhosts