Home / Linux  / Red Hat  / Find apache ( httpd.conf ) configuration file on linux server

Find apache ( httpd.conf ) configuration file on linux server

Spread the love

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 .

For , RHEL  or based system

Get the apache process through ps command.

# ps -ef | grep apache

OUTPUT :

[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

OUTPUT :

[box]-D HTTPD_ROOT=”/etc/httpd“[/box]

#/usr/sbin/httpd – V | grep SERVER_CONFIG_FILE

OUTPUT :

[box]-D SERVER_CONFIG_FILE=”conf/httpd.conf“[/box]

 

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 or Debian Based System

#ps -ef | grep apache

OUTPUT :

apache   24661  1994  0 00:36 ?        00:00:00  /usr/sbin/apache2

# /usr/sbin/apache2 -V | grep SERVER_CONFIG_FILE

OUTPUT :

[box]-D SERVER_CONFIG_FILE=”/etc/apache2/apache2.conf“[/box]

 

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]


Spread the love

Sachin is Red Hat Linux Certified and Freelance Contributor and Love to work and write on Open Source and Cloud Technologies .

})(jQuery)