19

Is there any way to display the effective configuration values that Apache is using?

I have a cPanel server that uses multiple include files and there are some server-wide settings that are defined in multiple places. I'd like to find a way of confirming which value Apache is actually using while it's running.

Dave Forgac
  • 3,486
  • 7
  • 36
  • 48
  • related : https://stackoverflow.com/questions/27152943 https://superuser.com/questions/922869 https://unix.stackexchange.com/questions/129026 https://serverfault.com/questions/425894 https://serverfault.com/questions/696164 https://serverfault.com/questions/500329 https://serverfault.com/questions/489018 https://serverfault.com/questions/42539 http://httpd.apache.org/docs/current/mod/mod_info.html http://httpd.apache.org/docs/current/invoking.html – immeëmosol Jul 19 '17 at 09:11

1 Answers1

25

mod_info provides what you need, I think.

<Location /server-info>
   SetHandler server-info
   Order deny,allow
   Deny from all
   Allow from 1.2.3.4 # your IP, subnet, whatever
</Location>

More here: http://httpd.apache.org/docs/2.2/mod/mod_info.html

You can also list the configuration of your VirtualHosts (less info than using the above) using the command sudo httpd -S.

freiheit
  • 14,334
  • 1
  • 46
  • 69
  • 1
    Lucky me, mod_info was already compiled in too. – Dave Forgac Jul 18 '09 at 18:37
  • +1 It works like a charm! For the beginners like me, I would also remember to load the `mod_info` module in `httpd.conf` by adding the line: `LoadModule info_module modules/mod_info.so` – Marco Demaio Nov 20 '15 at 11:39