Sharing settings between a few virtual hosts in Apache
- by Ivan Virabyan
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.