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.
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"
Get the latest version:
Download
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.
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
.
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".
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>
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>
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.
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
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).
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.