Pages

Wednesday, May 7, 2014

enable mod_status in apache2

enable mod_status in apache2

Status Module of apache2 enable to identify performance of web server.

More detail about status module shall be found here.

httpd.apache.org/docs/2.2/mod/mod_status.html

This post is about enabling mod_status module in httpd/apache2, CentOS - 6.3

The following link, talks about enabling mod_status module in apache2

http://stackoverflow.com/questions/19083383/how-to-properly-enable-mod-status-on-an-apache-server


(1) Enable Mod Status module in Apache2 :

Edit two files httpd.conf and httpd-vhosts.conf

File 1:

Open /etc/httpd/conf/httpd.conf

LoadModule status_module modules/mod_status.so


#Added for Apache2 Monitoring

ExtendedStatus On
<Location /server-status>
    SetHandler server-status
    Order deny,allow
    Deny from all
    Allow from localhost.localdomain
</Location>


Add the above lines and save the file

REASON:

  1. Reason to add localhost.localdomain is to allow the request only for localhost.
  2. If you put localhost in the configuration , then you will get forbidden - 403 Error, since apache2 realizes request header as localhost.localdomain if the request is from localhost
Refer:

http://stackoverflow.com/questions/10873295/error-message-forbidden-you-dont-have-permission-to-access-on-this-server


File 2:

Open /usr/local/apache2/conf/extra/httpd-vhosts.conf

Add these lines and save the file.

<Directory />
    #Options FollowSymLinks
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    Order deny,allow
    Allow from all
</Directory>

Now restart httpd service.

From your system, If you access,

http://localhost/server-status

You will get a page as shown in the picture



If this works successfully, Then Hyperic Server can get real time statistics such as,
  • Bytes Served per Minute 
  • Requests Served per Minute  
  • Requests Served per Second 
  • Availability 
from /server-status [mod_status module] 

No comments:

Post a Comment