Locate Apache & configuration file on Linux

Since there is no default location for Apache, it can be configured at custom location on Linux. Having said that, in case a a developer, in case there’s a need to find and configure Apache, you just use below quick tip that will help you to do so.

$ ps -ef | grep apache

This will give a list something like below:

root     15760     1  0 16:41 ?        00:00:00 /usr/sbin/apache2 -k start
www-data 15819 15760  0 17:10 ?        00:00:02 /usr/sbin/apache2 -k start
...

So, the path of apache server on your linux box is /usr/sbin/apache

Now, simply run below command to know Apache configurations & setting file:

/usr/sbin/apache2 -V
$ /usr/sbin/apache2 -V
Server version: Apache/2.2.22 (Ubuntu)
Server built:   Mar 19 2014 21:11:10
Server's Module Magic Number: 20051115:30
Server loaded:  APR 1.4.6, APR-Util 1.3.12
Compiled using: APR 1.4.6, APR-Util 1.3.12
Architecture:   64-bit
Server MPM:     Prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=128
 -D HTTPD_ROOT="/etc/apache2"
 -D SUEXEC_BIN="/usr/lib/apache2/suexec"
 -D DEFAULT_PIDLOG="/var/run/apache2.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="/var/run/apache2/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="mime.types"
 -D SERVER_CONFIG_FILE="apache2.conf"

Enjoy!!

(Visited 11 times, 1 visits today)