Find apache or httpd configuration file path
Most of the user not known to find or path of web server configuration file of Apache ( httpd ) in server.Apache having different configuration path on different OS , It depend on installation of apache by which method is used .
Run below commands to find the path of Apache configuration file .
Get the apache process through ps command.
# ps -ef | grep apache
[box] apache 24661 1994 0 00:34 ? 00:00:00 /usr/sbin/httpd[/box]
Get the path from process and run the below command.
#/usr/sbin/httpd -V | grep HTTPD_ROOT
#/usr/sbin/httpd – V | grep SERVER_CONFIG_FILE
Now from above two command output from HTTP_ROOT the main directory of apache is “/etc/httpd and configuration file is located under /etc/httpd , i.e “conf/httpd.conf” and full path will be “/etc/httpd/conf/httpd.conf”
For Ubuntu or Debian Based System
#ps -ef | grep apache
apache 24661 1994 0 00:36 ? 00:00:00 /usr/sbin/apache2
# /usr/sbin/apache2 -V | grep SERVER_CONFIG_FILE
P.S : The most common command for check apache information from below command.
[box]# httpd –V ( for centos , rhel or linux based)
# apache2ctl –V ( for ubuntu or debian based system)[/box]