Questions

Forum Navigation
Please to create posts and topics.

Find Apache httpd.conf/apache2.conf Configuration File

How to find easily the location of the httpd.conf/apache2.conf configuration file on a Linux system?

We can invoke apache2 directly (which is not recommended in most cases) or administer it using apache2ctl control interface as below with the -V flag which shows the version and build parameters of apache2:

On CentOS/RHEL/Fedora:

$ apachectl -V | grep SERVER_CONFIG_FILE

Or:

$ /usr/sbin/httpd -V | grep SERVER_CONFIG_FILE

On Debian/Ubuntu/Linux Mint:

$ apache2ctl -V | grep SERVER_CONFIG_FILE

The output will be similar to the following:

-D SERVER_CONFIG_FILE="conf/httpd.conf"

In this case the configuration file is located under /etc/httpd , i.e "conf/httpd.conf" and full path will be "/etc/httpd/conf/httpd.conf".

Finally, if we just want to search directly in the system, we can use the find command on Linux, Unix or Mac via SSH/Terminal to find httpd.conf (or any other conf file, if needed) using the following approach:

find / -name httpd.conf 2>/dev/null