which one of these two files should I use to configure Apache?
The httpd.conf is empty, while apache2.conf is not.
It confuses me!
|
which one of these two files should I use to configure Apache? The It confuses me! |
||||
migrated from stackoverflow.com Sep 22 '12 at 16:56This question came from our site for professional and enthusiast programmers. |
||||
|
|
||||
|
The httpd.conf is designed for user configurations. You really should not edit the apache2.conf as it may be updated by future upgrades. An additional option is to just put your custom configuration into /etc/apache2/conf.d, all files in this directory are included as well. |
|||||
|
|
These are not your only options. On Ubuntu/Debian, Apache also processes all the files in You're intended to use these directories for |
|||||
|
|
apache2.conf includes httpd.conf:
I think that httpd.conf is deprecated, but just left in there for conservative people so that they find they way around... :) EDIT: After reading Rob's answer, I did a better grep:
User configurations it is... |
|||||
|
|
The Apache Software Foundation publishes many bits of software, one of which is a web server named However, long ago and far away, someone in the Debian GNU/Linux distribution decided to change the name of the software within that distribution from So the answer is, if you're on a Debian-based system, you bend your brain into doing things the way Debian wants you to do it. Otherwise you generally do things the normal way as the upstream httpd project does it. |
|||
|
|
|
If But I suppose that one includes the other (and that one of those is kept purely for backward compatibility reasons) -- so, it shouldn't change much.
It would probably be a better solution : you would not modify the default file -- which would simplify updates. |
|||||
|
|
just open apache2.conf and look at the content:
So if you want to include your own configuration add it to httpd.conf and apache2.conf will automatically get it. As other say, apache2.conf can machine generated and it's better not to touch it. For more information, generally Ubuntu uses apache2.conf and Centos uses httpd.conf. So all these files depends on which OS you have. |
|||
|
|
|
Apache 2.4 Do use: Place any custom configurations in Enable/Disable your config using (Then restart apache2 service.) Don't use:
- Anything you might see in a 'global' Apache config can be added/overridden under your custom config as per above. |
||||
|
|
|
To find the name and the location of the configuration file, you would have to: 1) Search as the process is called, in this case working with the apache user:
(in this example, returns: 2) Show the variables used by the binary:
Extracted and screenshots at: http://www.sysadmit.com/2016/12/linux-apache-donde-esta-httpdconf-apache2conf.html |
|||||
|