Apache Config File Location

Apache Config File Location

Often web developers and website administrators need to modify Apache configuration file but do not know its location. In this article, we will learn about the most common Apache config file location and how to locate it if you do not know it.

Apache Config File Location

It is important to understand that the location of Apache web server’s configuration file depends on the type of installation (from package or source) and also the system (Debian, RHEL, etc.).

Location of Apache Configuration File in Linux

Here are the most common places to find Apache configuration file in Linux.

/etc/apache2/httpd.conf
/etc/apache2/apache2.conf
/etc/httpd/httpd.conf
/etc/httpd/conf/httpd.conf

In Debian, Ubuntu systems, it is most likely installed in apache2 directory whereas in RHEL/Fedora/CentOS systems it is most likely installed in httpd directory.

Apache Configuration File Location in Windows

In Windows, you will find Apache configuration file at

C:\Program Files\Apache Software Foundation\ApacheX.X\conf\ 

where X.X is the version number of Apache.

It is important to know the location of Apache configuration file in order to be able to setup virtual hosts, enable .htaccess and do a lot more things. In this article, we have learnt about the most common places to find Apache configuration file.

How to Find Apache Config File Location

If none of the above solutions work for you, then you will need to manually find Apache configuration file location.

The most common way to do this is to run the following command.

$ whereis apache2

It will list the location of Apache binary, as well as folder location for Apache configuration file.

apache2: /usr/sbin/apache2 /etc/apache2 /usr/lib/apache2 /usr/share/apache2 /usr/share/man/man8/apache2.8.gz

If the above approach also does not work for you, then you can use find command to locate Apache installation location.

$ sudo find / -type d -name "apache2"

One some systems, Apache may be installed as httpd. So modify the above command to look for installation location of httpd software.

sudo find / -type d -name "httpd"

If none of the above methods work for you, then it is likely that Apache web server is not installed on your system.

In this article, we have learnt many different ways to find Apache config file location in both Linux as well as Windows system. It is always important to know the location of Apache configuration file in order to be able to make major changes to your server configuration.

Also read:

How to Open, Extract RAR Files in Linux
How to Implement SSL/TLS in Apache Tomcat
How to Solve NPM Error ‘npm ERR! code ELIFECYCLE’
How to Get Value of Text Input in JavaScript
How to Add Property to JavaScript Using Variable

Leave a Reply

Your email address will not be published. Required fields are marked *