Change the path to httpd.conf (apache2.conf)

David Aldridge
David Aldridge used Ask the Experts™
on
Is there a way for me to change the path to my httpd.conf file besides starting the server with the -f?

Thanks,
David
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
Hi David,

Which distribution are you using?
Top Expert 2004
Commented:
Per Apache docs:
The location of this file is set at compile-time, but may be overridden with the -f command line flag. In addition, other configuration files may be added using the Include directive, and wildcards can be used to include many configuration files.

Author

Commented:
Using Solaris 11.3

/usr/apache2/2.2/bin> httpd -v
Server version: Apache/2.2.31 (Unix)
Server built:   Sep 24 2015 08:47:26
Fractional CTO
Distinguished Expert 2018
Commented:
As Steve said. Apache backs in the config path, based on Distro you're using.

Apache provides the -f specifically for the purpose you describe.

Just locate the script used to start/stop Apache + add -f /path-to-custom-config directly into this script, so all Apache operations use the correct custom config file.

Author

Commented:
Yes, it looks like there's no other way without using the -f.  I'll split the points with everyone that tried.

Thanks,
David

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial