Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

Lost httpd.conf file located apache

How might I discover where my httpd.conf file is found?

I'm running a Ubuntu Linux server from the Amazon Web Services EC2 (Elastic Compute Cloud) and I can't discover my Apache config.
by

2 Answers

ninja01
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"
kshitijrana14
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

Login / Signup to Answer the Question.