Apache - Include conf Files Relative to ServerConfigFile (-f arg)

Posted by Synetech inc. on Server Fault See other posts from Server Fault or by Synetech inc.
Published on 2010-05-08T01:34:10Z Indexed on 2010/05/08 1:38 UTC
Read the original article Hit count: 417

Filed under:
|
|
|

Hi,

I want to use the -f command-line option for the Apache server so that I can store the conf files in a separate place (a data diectory) from the server binaries.

The problem is that I use the Include directive to separate and organize the configurations, but when I use a command like Include "addons/SVN.conf", it fails because Apache looks for addons/SVN.conf in relative to the ServerRoot directory instead of the ServerConfigFile directory.

I can work around this by using absolute paths (eg Include "e:\foo\bar\baz\Apache\conf\addons\svn.conf", but I don’t like that since it means I would have to change each and every Include directive if I move the conf folder as opposed to simply changing the -f option.

Does anyone know of a way to get the Include directive to work relative to the conf file that Apache is passed. I tried Include "./addons/SVN.conf", but that too was relative to the ServerRoot. This forced relative-to-ServerRoot Include behavior kind of defeats the whole purpose of specifying an alternate config file to the one in ServerRoot/conf.

Thanks.

© Server Fault or respective owner

Related posts about apache

Related posts about configuration