Apache Statistics Module

The statistics (or status) module provides an interface to view your server's statistics.

Enabling statistics module


In Jelastic statistics module is disabled by default. You can activate this module following the instruction:

  1. Click Config button for your Apache server.
  2. The required status_module is loaded by default, so navigate to the /etc/httpd/conf folder and open the httpd.conf file. Add the following code:
  3. ExtendedStatus On
    <Location /statistics/>
    SetHandler server-status
    
    ####### Security configuration ####################
    ####### Basic auth config should follow here ######
    ###################################################
    
    </Location>
    



    Note: you can use any other context for your statistics location (in our case we have /statistics/).

  4. Save the changes and restart Apache.
  5. Click Open in browser. Add the location name to the link.
http://{env_name}.{hoster_domain}/{location_name}/

In the opened window the statistics of the server will be shown.

Setting up security configuration


  1. Generate hash from your password. For that you can use any htpasswd tool or online service (for example, http://www.htpasswdgenerator.net/).
  2. Create simple text file with previously generated hash.
  3. Click Config button for your Apache server.
  4. Upload the created file to the /var/www/webroot/ROOT folder.
  5. In the /etc/httpd/conf folder open the httpd.conf file.

  6. Instead of:
    ####### Security configuration ####################
    ####### Basic auth config should follow here ######
    ###################################################
    

    Add the following code:
    AuthName "Statistics area"
    AuthType Basic
    AuthBasicProvider file
    AuthUserFile /var/www/webroot/ROOT/.htpasswd
    Require valid-user



  7. Save the changes and restart Apache.
  8. Click Open in browser. Add the location context to the link.
http://{env_name}.{hoster_domain}/{location_name}/

In the opened window you'll be requested to log in with your credentials. Use the credentials you stated while generating the hash to see the statistics of the server.

Qual o próximo?