Where does Apache server store its configuration files?

by n00b_Programmer on June 28, 2006 · 5 comments

Different Linux distributions and/or UNIX operating system, and control panels stores Apache web server configuration file at different locations. There are different ways to locate configuration file.

Apache is, by default, installed in /etc/httpd directory. But this path also depends on how apache has been compiled. Default configuration file name httpd.conf.

Using httpd command

To find the location where apache is installed and to print configuration file location, run the following command:
# httpd -v

Here is the output from my Fedora Core/RedHat (RHEL) Linux server:

Server version: Apache/2.0.54
Server built:   Jan 17 2006 06:36:00
Server's Module Magic Number: 20020903:9
Architecture:   32-bit
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 HTTPD_ROOT="/etc/httpd"
 -D SUEXEC_BIN="/usr/sbin/suexec"
 -D DEFAULT_PIDLOG="logs/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="logs/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="conf/mime.types"
 -D SERVER_CONFIG_FILE="conf/httpd.conf"

HTTPD_ROOT points to default location /etc/httpd and line SERVER_CONFIG_FILE points to configuration file conf/httpd.conf. So the path is /etc/httpd/conf/httpd.conf

If you are using Debian Linux try apache-perl:

# apache-perl -V

cPanel/Plesk Control Panel

If you are using third party control panel, then you can find out Apache configuration file inside your /home/username/ directory or /var/www/vhosts/ directory.

Using find command

This is an old good (read as geekey) classic way to locate httpd.conf file:
# find / -name 'httpd.conf' -print

You may have to wait for few seconds/minute to search complete. Or try out locate command:
# locate httpd.conf

Featured Articles:

Share this with other sys admins!
Facebook it - Tweet it - Print it -

We're here to help you make the most of sysadmin work. So, subscribe!

{ 5 comments… read them below or add one }

1 Ram bharoshe September 4, 2007

To find the location where apache is installed and to print configuration file location, run the following command:
# httpd -V

we have to use -V(capital) instead of -v(small).

Thnx for your information

Jai Shree Ram

Reply

2 Ashu Kumar Raina April 20, 2009

Hi Sir, i am a operations engineer, but i m weak in Linuk field, could you please update/help me as your younger bro. Please sir i just need a little or basic cmnds regarding Linux. Could you please help me out.

ashu raina

Reply

3 meanperson May 31, 2011

@Ashu Kumar Raina,

Try reading..

Reply

4 rrrrew October 13, 2009

thank you

Reply

5 seema August 25, 2010

Hi,

My Apache server is on Linux, it was configured and working fine. Recently the IP of the box got changed and since then I cannot navigate to the UI page. Can you please suggest where to change the IP.

Thanks,
seena

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <blockquote> <pre> <a href="" title="">
What is 13 + 4 ?
Please leave these two fields as-is:
Are you a human being? Solve the simple math so we know that you are a human and not a bot.



Previous post:

Next post: