Get the files

You can download a zip file and extract it

OR

if you use a version control client you can checkout the sources of the project. It will make it easier to keep the files up to date.


Git clone

Checkout sources with git client.
The following commands create a directory pimped-apache-status below webroot and put all files there:

cd [webroot-directory]/[install-dir]/
git clone https://github.com/axelhahn/pimped-apache-status.git [optional-name-of-subdir]

Leaving [optional-name-of-subdir] empty will create a subdir named "pimped-apache-status"

Download


Get the latest version:
Download

Pimped Apache Server Status

Extract the files somewhere below webroot on your webserver. You can put to any subdirectory. It is not a must to have it in the webroot.


Permissions

File Permissions

  • all files must be readable by your apache user (apache or www-data)
  • all files in the application folder should be writable for the apache user. Then you can update the software with your webbrowser.
    minimal (for automatic installations with puppet or chef): these subdirectories must be writable for the apache user:
    • ./config/ - contains json files with the config
    • ./tmp/ - save data for download updates and version check. In the config you can define a directory outside webroot too
    • ./vendor/ - to store external external libraries i.e. jquery, AdminLTE, ...

On monitored systems

You need the module mod_status and the setting ExtendedStatus On.

Allow your server to access the server-status page on the systems you want to monitor.
Remark: Have a look to the page Harden to set restrictions.

Apche httpd config snippet:

                ...
                LoadModule status_module modules/mod_status.so
                ...
                ExtendedStatus On
                ...
                <Location /server-status> 
                        SetHandler server-status 
                        Require ip 127.0.0.1
                        Require ip 192.168.123.4 # enter ip of your monitoring system
                </Location>

Don't forget to reload or restart the service "httpd" or "apache2" after changing its config, i.e. systemctl restart apache2.

Special cases

This section handles special cases only. If you can open the server-status page then you can ignore it.

If you can open http://localhost/server-status or http://[servername]/server-status with a webbrowser or with wget or curl on command line then switch to the chapter "First run".

Rewrites

If you have a redirect to a controller file, then you need exclude the server status.

                <Directory /var/www/[hostname]/public_html/ >
                        ...
                        RewriteEngine On

                        RewriteCond %{REQUEST_FILENAME} !-f
                        RewriteCond %{REQUEST_URI} !^/server-status.*
                        RewriteRule ^(.*)$ app.php [QSA,L]
                        ...
                </Directory>

Proxy-Request

If you use a vhost as a proxy you can use ProxyPassMatch to exclude the server-status page from a proxy request.

                <Directory /var/www/[hostname]/public_html/ >
                        ...
                        ProxyRequests Off
                        ProxyPreserveHost On
                        ProxyAddHeaders On
						
                        ProxyPassMatch ^/server-status.* !
                        ProxyPass / http://127.0.0.1:1234/
                        ProxyPassReverse / http://127.0.0.1:1234/
                        ...
                </Directory>

First run


Ensure that you checked the reqirements; see Home.

Then open

http://[your-server]/[install-dir-of-apachestatus]/

in your webbrowser, i.e. http://localhost/apachestatus/.
The first request creates a default config. You get a success message.

message create user config

You got an error message?

2 things maybe could fail at the beginning.


missing php-curl

You get a text message in the browser:

ERROR: PHP-CURL is not installed. It is required to run.
see documentation get started.

... you need to install the php curl module; i.e.

$ sudo apt-get install php-curl

... or maybe needs to be enabled in the php.ini

extension=php_curl.dll



missing write permissions on config directory

You get a text message in the browser:

ERROR: Creation of config/config_user.php failed. Check the permissions on config directory (it must be writable for apache user).

... I guess you installed it as root. Change the owner of the config directory to the apache user (www-data or wwwrun).

$ cd [webroot-directory]/[install-dir-of-apachestatus]/
$ chown www-data:www-data config

Setup user and password


You get the possibility to setup a user and password to protect the tool.

Remark: you also can setup no user and password - but in a productive environment you should protect the access by httpd config (set an IP restriction or custom authentication).

setup user and password

Setup servers to monitor


Go to the configuration menu for servers.
Click to [Add server] to add a new server in the group "default".

See Customization -> Setup -> Setup servers for more details.

setup new server group and servers inside groups

Video: Installation on Lubuntu







Copyright © 2011-2024 Axel Hahn
project page: GitHub (en)
Axels Webseite (de)

Wanna make me happy??
Send a tip on Tipeee

or use Paypal:
results will be here