Finding Apache Configuration File httpd.conf Location

Finding the location on typical Linux/Unix servers is not very difficult. To do so, go into terminal/SSH and run the command:

ps -ef | grep httpd

Your output may differ slightly based on your operating system, but it should look something like:

    0    48     1   0  7:22AM ??         0:00.44 /usr/sbin/httpd -D FOREGROUND -D WEBSHARING_ON
   70   165    48   0  7:22AM ??         0:00.01 /usr/sbin/httpd -D FOREGROUND -D WEBSHARING_ON
  501  1247  1219   0  7:50AM ttys001    0:00.00 grep httpd

On certain operating systems, it may not return anything. In that case, try command:

ps -ef | grep apache2

If you don’t receive any results from both commands, you may not be running Apache/httpd.┬áNonetheless, you want to pay close attention to /usr/sbin/httpd. That is the location to your binary file. Run the following command to obtain the location to your configuration file:

/usr/sbin/httpd -V | grep SERVER_CONFIG_FILE

You’ll see something like the following, which will designate the location for your httpd.conf file.

 -D SERVER_CONFIG_FILE="/private/etc/apache2/httpd.conf"