Download the PHP package building5/apache-exporter without Composer
On this page you can find all versions of the php package building5/apache-exporter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download building5/apache-exporter
More information about building5/apache-exporter
Files in building5/apache-exporter
Package apache-exporter
Short Description A library for exporting Apache status for Prometheus
License MIT
Homepage https://github.com/building5/apache-exporter-php
Informations about the package apache-exporter
apache-exporter-php
PHP port of apache_exporter. Slightly more convenient for PHP apps, since it does not require running the additional exporter process.
Installation
Usage
Be sure to have the Apache server-status page enabled and configured.
Enable the status module using a2enmod status
. It probably already has a
status.conf
configured in /etc/apache2/mods-enabled
, but if not, you'll need
that, too
You can test the status page by running curl http://localhost/server-status?auto
on the web server to see if it's service
the status page.
Simple usage
In your PHP application, or in whatever webroot you choose, create a
metrics.php
script that calls ApacheExporter\Exporter::simple()
. The use of
.htaccess
to restrict access, add passwords, etc. is left as an exercise.
Non-simple usage
If you have other stats you'd like to report, you can use the
ApacheExporter\Exporter::export()
method to export stats to the registry of
your own choosing.
The use of APC or Redis storage is not recommended. The counter fields like accesses, kilobytes and uptime will accumulate wildly if you do.
License
apache-exporter-php
is licensed under the MIT license.