PHPackages                             building5/apache-exporter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. building5/apache-exporter

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

building5/apache-exporter
=========================

A library for exporting Apache status for Prometheus

v1.0.0(8y ago)01.3k1MITPHPPHP &gt;=7.1

Since Mar 2Pushed 7y ago1 watchersCompare

[ Source](https://github.com/building5/apache-exporter-php)[ Packagist](https://packagist.org/packages/building5/apache-exporter)[ Docs](https://github.com/building5/apache-exporter-php)[ RSS](/packages/building5-apache-exporter/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (3)Versions (2)Used By (0)

apache-exporter-php
===================

[](#apache-exporter-php)

PHP port of [apache\_exporter](https://github.com/Lusitaniae/apache_exporter). Slightly more convenient for PHP apps, since it does not require running the additional exporter process.

Installation
------------

[](#installation)

```
$ composer require building5/apache-exporter
```

Usage
-----

[](#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

```

		SetHandler server-status
		Require local

	ExtendedStatus On

		# Show Proxy LoadBalancer status in mod_status
		ProxyStatus On

```

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

[](#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.

```
