How can I find where my httpd.conf
file is located?
I am running an Ubuntu Linux server from the Amazon Web Services EC2 (Elastic Compute Cloud) and I can't find my Apache config.
Join Stack Overflow to learn, share knowledge, and build your career.
How can I find where my httpd.conf
file is located?
I am running an Ubuntu Linux server from the Amazon Web Services EC2 (Elastic Compute Cloud) and I can't find my Apache config.
Get the path of running Apache
$ ps -ef | grep apache
apache 12846 14590 0 Oct20 ? 00:00:00 /usr/sbin/apache2
Append -V
argument to the path
$ /usr/sbin/apache2 -V | grep SERVER_CONFIG_FILE
-D SERVER_CONFIG_FILE="/etc/apache2/apache2.conf"
Reference:
http://commanigy.com/blog/2011/6/8/finding-apache-configuration-file-httpd-conf-location
sudo /usr/sbin/apache2 -V | grep SERVER_CONFIG_FILE
gives me some warning errors Invalid Mutex directory
so the right command I used is sudo apachectl -V | grep SERVER_CONFIG_FILE
– NineCattoRules
Feb 27 '16 at 23:23
See http://wiki.apache.org/httpd/DistrosDefaultLayout for discussion of where you might find Apache httpd configuration files on various platforms, since this can vary from release to release and platform to platform. The most common answer, however, is either /etc/apache/conf or /etc/httpd/conf
Generically, you can determine the answer by running the command:
httpd -V
(That's a capital V). Or, on systems where httpd is renamed, perhaps apache2ctl -V
This will return various details about how httpd is built and configured, including the default location of the main configuration file.
One of the lines of output should look like:
-D SERVER_CONFIG_FILE="conf/httpd.conf"
which, combined with the line:
-D HTTPD_ROOT="/etc/httpd"
will give you a full path to the default location of the configuration file
apache2ctl -V
command and looking for the path in what is listed after.
– jamescampbell
Oct 28 '15 at 18:40
apache2ctl
is not renamed version of httpd
, it's different names of same aplication on Debian- and RedHat-based OS respectively
– vladkras
Mar 19 '16 at 11:21
find / -name httpd.conf
– prograhammer Jun 25 '14 at 23:57/etc/httpd/conf/httpd.conf
access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/… – danwild Apr 20 '15 at 5:43locate httpd.conf
– Sudip Bhandari Feb 23 '17 at 16:42