This is for a shared config file that should include another file if it exists, but still work otherwise. If I do
Include foo.conf
and foo.conf doesn't exist, apache will complain:
could not open document config file /etc/httpd/conf/foo.conf
The main configuration file is usually called httpd. conf . 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.
The location of the Apache configuration file On most systems if you installed Apache with a package manager, or it came preinstalled, the Apache configuration file is located in one of these locations: /etc/apache2/httpd. conf. /etc/apache2/apache2.
The main file is called httpd. conf. This file contains directives and containers, which enable you to customize your Apache installation. Directives configure specific settings of Apache, such as authorization, performance, and network parameters.
I came up with a clever solution, though there may be a better way. Put one of the characters in brackets so Apache will treat it as a glob pattern, which is allowed to match zero files without causing an error. E.g.:
Include foo.con[f]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With