5

I have the following (maybe very simple) problem:

I have a fresh install of apache2 on debian. In my /etc/apache2 directory I have an apache2.conf and a httpd.conf. I thought that any change I need to make should be done in the httpd.conf.

Well, I've added this lines to my httpd.conf:

ServerSignature off
ServerTokens prod

After restarting apache there are no changes. On a 404 page I still see the apache version. As soon as I add the code to apache2.conf, however, it's working as expected.

What am I missing here or why isn't it working?

4
  • does your apache2.conf include a line to include httpd.conf? apache2 doesn't source httpd.conf by default. Mar 7, 2015 at 21:00
  • Actually no, but I also tried a local conf file in conf.d directory which should automatically be included by apache2 but still, it won't work.
    – sleepless
    Mar 7, 2015 at 21:10
  • I don't believe your assumption is correct. I think apache2.conf must have a line include conf.d/*.conf to pull from that dir. Mar 7, 2015 at 21:12
  • You're right. But it's very strange because the outcommented section of apache2.conf says clearly: "All files in conf.d are considered (excluding the exceptions noted above) by the Apache 2 web server." Anyways, thank you!
    – sleepless
    Mar 7, 2015 at 21:17

1 Answer 1

4

Your apache2.conf file does not include the additional locations you're trying to configure by default. If you would like these config files to be used, you should add include lines for them in apache2.conf like so:

include httpd.conf
include conf.d/*.conf
1
  • Thanks. Works like a charm! The only thing I don't understand as mentioned in my last comment is the explanation from apache because that is telling me something different. From my understanding it should work out of the box.
    – sleepless
    Mar 7, 2015 at 21:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .