![]() |
apache2 - which conf file to use ?
Hello,
I'm using Ubuntu 7.04 server which comes with apache2. I done some directory surfring and found that there are two .conf files : apache2.conf and httpd.conf. I want to add the directives ServerName and DocumentRoot but into which of the conf files should I place the two directives ??? Thanks ! UC |
Most likely you want httpd.conf (thats the standard on most Linux distros and the BSDs).
|
Thanks reddazz. The httpd.conf file is empty ( 0Kb) whereas the apache2.conf ( 21Kb) contains all the other directives which are usually associated with the httpd.conf file, hence, the confusion.
|
It could be one of those things that Ubuntu has decided to do differently. Is httpd.conf a symlink to apache2.conf? Try making your changes in apache2.conf and see if they work.
|
They are not symlinked but I can put the directive ServerName in either of the two files and everything seems to work ok. I'm just intrigued and curious.
Edit: Just been doing a bit of reading around. Apparently in Ubuntu/ Debian the httpd.conf file is now redundant and apache2.conf is where all the action is. |
Quote:
|
there's a cascade of importance ..
anything you add to the httpd.conf overides apache2.conf. and anything in your vhost files takes precedence over both. |
I think for ubuntu and debian, they use apache2.conf. And httpd.conf is in centos.
|
Quote:
Sure, you could ignore it and just use the apache2.conf, or vhost files. |
The below command will list the compile settings for apache
# apache2 -V | grep conf -D SERVER_CONFIG_FILE="/etc/apache2/apache2.conf" Here we can see that the /etc/apache2/apache2.conf is the configuration file. |
Hello everyone!
First of all excuse my English! I just came by while searching for an answer for the same question! And based on your argue guys, I did this small test just to see what file does apache depend on when it starts. I simply renamed httpd.conf to something else (e.g. http.conf_) and restarted apache. And the result? Apache failed to start! Then did the same thing to the other file (apache2.conf), and again apache failed to start, which means that apache will actually read and apply any configs done in BOTH FILES! And thanks for reading!! P.S. did the test under Debian 5... |
# Include all the user configurations:
Include httpd.conf This is now added in apache2.conf, dont know when it was added though. |
| All times are GMT -5. The time now is 04:38 PM. |