How to enable mod_info in Apache?
Asked Answered
S

3

6

I've gone through the Apache guide to enable to mod_info.

As per doc:

  • To configure mod_info, add the following to your httpd.conf file.

    <Location /server-info>
        SetHandler server-info
    </Location>
    
  • You may wish to use mod_access inside the <Location> directive to limit access to your server configuration information:

    <Location /server-info>
        SetHandler server-info
        Order deny,allow
        Deny from all
        Allow from yourcompany.com
    </Location>
    
  • Once configured, the server information is obtained by accessing

    http://your.host.dom/server-info
    

In my case this link is not giving any info. Is there anything I need to install as mod_info.c or something? Is there anything I need to put as AddModule or something?

Sewerage answered 11/12, 2012 at 8:47 Comment(0)
A
8

There should be a mod_info.so that must be on a path Apache 2 can find. For example, I have:

kdp@darwin ccl $ locate mod_info.so
/usr/lib64/apache2/modules/mod_info.so

Then, I have these in my httpd.conf:

ServerRoot "/usr/lib64/apache2"
LoadModule info_module modules/mod_info.so

This is made available by a snippet in /etc/apache2/modules.d/00_mod_info.conf:

<IfDefine INFO>
# Allow remote server configuration reports, with the URL of
# http://servername/server-info
<Location /server-info>
    SetHandler server-info
    Order deny,allow
    Deny from all
    Allow from 127.0.0.1
</Location>
</IfDefine>

(The IfDefine is only needed because of the way stuff is set up on Gentoo.)

Alfilaria answered 11/12, 2012 at 15:15 Comment(0)
B
2

Check if info_module is loaded.

% /usr/local/sbin/httpd -t -D DUMP_MODULES | grep info_module

If it is not loaded, add following line to httpd.conf. Note that path/to must be replaced with appropriate path.

LoadModule info_module path/to/mod_info.so
Bookmark answered 11/12, 2012 at 15:16 Comment(0)
S
1

I got the solution.

  1. When I check ./apachectl -l, mod_info has not been installed.

  2. To install the Mod_info or any module, First Compile and install Apache by ./configure --enable-info make make install

    More info for install module : http://publib.boulder.ibm.com/httpserv/manual60/install.html

  3. Check ./apachectl -l, mod_info would be there in the list

  4. Enable server-info by updating httpd.conf

  5. invoke url http://your.host.dom/server-info

One thing I am not sure why apache mod_info not installed default installation.

Sewerage answered 11/12, 2012 at 8:47 Comment(2)
"why apache mod_info not installed default" - mod_info is very much an "additional" module for development purposes only. It should be never be enabled in a production environment. So it should never be enabled in a "default installation". There are many other Apache modules that are not enabled by "default", as they are simply not required in the vast majority of cases.Gassman
Note that the apachectl -l lists modules compiled along Apache. However, Apache is capable of dynamically loading modules and thus does not require you to compile them in the server directly.Songster

© 2022 - 2024 — McMap. All rights reserved.