Sign inSign up

ivanarsenijevic/apache-exporter

By ivanarsenijevic

Updated about 5 years ago

Creating the container for the 32-bit ARM architecture

Image
0

211

ivanarsenijevic/apache-exporter repository overview

This is a Docker container for apache-exporter for 32-bit ARM architecture. It's meant to run on Raspberry Pi (or similar). It is created using the instructions from the official Github repository. There are no official docker containers (at least unknown to me).

Building the container:

First, you need to fetch the binary build for the right platform (arm-v7). It is possible to compile the source code instead, however, that hasn't worked for me. Suppose that, for example, we are going to use:

VERSION=0.9.0

Getting the precompiled binary:

VERSION=0.9.0
wget https://github.com/Lusitaniae/apache_exporter/releases/download/v${VERSION}/apache_exporter-${VERSION}.linux-armv7.tar.gz
tar xvzf apache_exporter-${VERSION}.linux-armv7.tar.gz

Create a Dockerfile with the following contents, as per the official instructions:

FROM busybox:latest

COPY apache_exporter /bin/apache_exporter

ENTRYPOINT ["/bin/apache_exporter"]
EXPOSE     9117

and use to build the container image:

docker build -t "apache-exporter:${VERSION}" apache_exporter-${VERSION}.linux-armv7

Note

For the apache_exporter to work, you need to enable mod_status in Apache and permit the access to "/server-status?auto" URI. In many cases, it's sufficient to enable mod_rewrite and allow access to this URI, but not for me. I am using this to monitor MediaWiki service which calls for aditional care. MediaWiki software is using Short URLs which means that using just the above configuration will not work. To achieve what's needed, mod_rewrite needs to be enabled and configured like this:

<Directory /var/www/html>
  RewriteEngine On
  RewriteCond %{REQUEST_URI} !=/server-status
  RewriteCond %{REQUEST_URI} !=/server-status?auto
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^ %{DOCUMENT_ROOT}/index.php [L]
</Directory>

I am very thankful for this link which provided for the mod_rewrite rules.

Tag summary

Content type

Image

Digest

Size

6.5 MB

Last updated

about 5 years ago

docker pull ivanarsenijevic/apache-exporter:0.9.0