<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="fr">
	<id>https://wiki.jordan-lenuff.com/index.php?action=history&amp;feed=atom&amp;title=Outillage%2FPimped_Apache_Status</id>
	<title>Outillage/Pimped Apache Status - Historique des versions</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.jordan-lenuff.com/index.php?action=history&amp;feed=atom&amp;title=Outillage%2FPimped_Apache_Status"/>
	<link rel="alternate" type="text/html" href="https://wiki.jordan-lenuff.com/index.php?title=Outillage/Pimped_Apache_Status&amp;action=history"/>
	<updated>2026-04-23T15:26:56Z</updated>
	<subtitle>Historique des révisions pour cette page sur le wiki</subtitle>
	<generator>MediaWiki 1.34.0</generator>
	<entry>
		<id>https://wiki.jordan-lenuff.com/index.php?title=Outillage/Pimped_Apache_Status&amp;diff=164&amp;oldid=prev</id>
		<title>Jordan : Page créée avec « == Présentation == Cette section a pour objet de regrouper les sujets liés à l'utilisation de l'outil Pimped Apache Status.  Plus d'informations sur le site de l'édite... »</title>
		<link rel="alternate" type="text/html" href="https://wiki.jordan-lenuff.com/index.php?title=Outillage/Pimped_Apache_Status&amp;diff=164&amp;oldid=prev"/>
		<updated>2019-08-13T13:23:39Z</updated>

		<summary type="html">&lt;p&gt;Page créée avec « == Présentation == Cette section a pour objet de regrouper les sujets liés à l&amp;#039;utilisation de l&amp;#039;outil Pimped Apache Status.  Plus d&amp;#039;informations sur le site de l&amp;#039;édite... »&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nouvelle page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Présentation ==&lt;br /&gt;
Cette section a pour objet de regrouper les sujets liés à l'utilisation de l'outil Pimped Apache Status.&lt;br /&gt;
&lt;br /&gt;
Plus d'informations sur le site de l'éditeur : https://www.axel-hahn.de/docs/apachestatus/index.htm.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
=== Prérequis ===&lt;br /&gt;
==== Serveur maître ====&lt;br /&gt;
*Serveur web&lt;br /&gt;
**N'importe quel serveur web avec PHP 7 - jusqu'à 7.3 (cela peut fonctionner avec PHP 5.3, mais il n'y aucun support pour les version de PHP5)&lt;br /&gt;
*Extension PHP&lt;br /&gt;
**php-curl&lt;br /&gt;
**php-xml (optional; for xml exports)&lt;br /&gt;
*Pas de base de données nécessaire&lt;br /&gt;
==== Serveurs supervisés ====&lt;br /&gt;
*Versions&lt;br /&gt;
**Apache 2.x&lt;br /&gt;
*Modules activés&lt;br /&gt;
**mod_status&lt;br /&gt;
**ExtendedStatus&lt;br /&gt;
*Accès&lt;br /&gt;
**Autoriser le serveur maître d'accéder à l'alias /server-status&lt;br /&gt;
S'aider de la page [[Technique/Apache|Apache]] mettre en place ces prérequis.&lt;br /&gt;
=== Déploiement ===&lt;br /&gt;
==== Serveur maître ====&lt;br /&gt;
===== Dossier applicatif =====&lt;br /&gt;
Se connecter en SSH sur le serveur maître et télécharger la dernière version de pimped-apache-status (la 2.03.03 à ce jour) :&lt;br /&gt;
&lt;br /&gt;
 wget -O ~/downloads/pimped-apache-status-2.03.03.zip https://github.com/axelhahn/pimped-apache-status/archive/master.zip&lt;br /&gt;
&lt;br /&gt;
Se rendre dans le dossier &amp;lt;code&amp;gt;/data/www&amp;lt;/code&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
 cd /data/www/PimpedApacheStatus&lt;br /&gt;
&lt;br /&gt;
Définir temporairement un umask à 0002 :&lt;br /&gt;
&lt;br /&gt;
 umask 0002&lt;br /&gt;
&lt;br /&gt;
Décompresser l'archive :&lt;br /&gt;
&lt;br /&gt;
 unzip ~/downloads/pimped-apache-status-2.03.03.zip -d /data/www/PimpedApacheStatus/&lt;br /&gt;
&lt;br /&gt;
Renommer le dossier décompresser avec le numéro de la version téléchargée :&lt;br /&gt;
&lt;br /&gt;
 mv pimped-apache-status-master pimped-apache-status-2.03.03&lt;br /&gt;
&lt;br /&gt;
Faire pointer le lien symbolique &amp;lt;code&amp;gt;/data/www/PimpedApacheStatus/current&amp;lt;/code&amp;gt; vers le dossier de la version à installer :&lt;br /&gt;
&lt;br /&gt;
 ln -s /data/www/PimpedApacheStatus/pimped-apache-status-2.03.03 /data/www/PimpedApacheStatus/current&lt;br /&gt;
&lt;br /&gt;
Donner les droits à tous les fichiers à l'utilisateur Apache :&lt;br /&gt;
&lt;br /&gt;
 chown -R www:www /data/www/PimpedApacheStatus&lt;br /&gt;
&lt;br /&gt;
Redéfinir le umask par défaut :&lt;br /&gt;
&lt;br /&gt;
 . /etc/profile&lt;br /&gt;
&lt;br /&gt;
===== Configuration PHP =====&lt;br /&gt;
Créer le dossier de logs &amp;lt;code&amp;gt;/data/logs/pimpedapachestatus&amp;lt;/code&amp;gt; et donner les droits à l'utilisateur www :&lt;br /&gt;
&lt;br /&gt;
 mkdir /data/logs/pimpedapachestatus&lt;br /&gt;
 chown www:www /data/logs/pimpedapachestatus&lt;br /&gt;
&lt;br /&gt;
Créer un fichier &amp;lt;code&amp;gt;/local/php/php7/etc/php-fpm.d/pimpedapachestatus.conf&amp;lt;/code&amp;gt; et y ajouter les lignes suivantes :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
[pimpedapachestatus]&lt;br /&gt;
user = php-fpm&lt;br /&gt;
group = php-fpm&lt;br /&gt;
&lt;br /&gt;
; Socket Unix dédié à PimpedApacheStatus&lt;br /&gt;
listen = /local/php/sockets/php7_$pool.sock&lt;br /&gt;
&lt;br /&gt;
; Donner à Apache (www) les droits d'accès au socket&lt;br /&gt;
listen.owner = www&lt;br /&gt;
listen.group = www&lt;br /&gt;
&lt;br /&gt;
; Définition du chemin d'accès des logs&lt;br /&gt;
access.log = /data/logs/$pool/$pool_php7.access.log&lt;br /&gt;
slowlog = /data/logs/$pool/$pool_php7.log.slow&lt;br /&gt;
php_admin_value[error_log] = /data/logs/$pool/$pool_php7.log&lt;br /&gt;
php_admin_flag[log_errors] = on&lt;br /&gt;
; https://www.php.net/manual/fr/errorfunc.constants.php&lt;br /&gt;
php_admin_value[error_reporting] = E_NOTICE&lt;br /&gt;
&lt;br /&gt;
; Tuning du pool php-fpm&lt;br /&gt;
pm = dynamic&lt;br /&gt;
pm.max_children = 5&lt;br /&gt;
pm.start_servers = 2&lt;br /&gt;
pm.min_spare_servers = 1&lt;br /&gt;
pm.max_spare_servers = 3&lt;br /&gt;
pm.status_path = /status&lt;br /&gt;
ping.path = /ping&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Redémarrer PHP pour prise en compte :&lt;br /&gt;
&lt;br /&gt;
 systemctl restart php7-fpm.service&lt;br /&gt;
&lt;br /&gt;
===== Configuration Apache =====&lt;br /&gt;
Dans le fichier &amp;lt;code&amp;gt;/local/www/current/conf/sites/myserver.conf&amp;lt;/code&amp;gt;, ajouter les lignes suivantes :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
# Configuration du module mod_status&lt;br /&gt;
&amp;lt;Location /server-status&amp;gt;&lt;br /&gt;
	SetHandler server-status&lt;br /&gt;
	Require ip X.X.X.X&lt;br /&gt;
&amp;lt;/Location&amp;gt;&lt;br /&gt;
&amp;lt;Location /server-info&amp;gt;&lt;br /&gt;
	SetHandler server-info&lt;br /&gt;
	Require ip X.X.X.X&lt;br /&gt;
&amp;lt;/Location&amp;gt;&lt;br /&gt;
# Fin de configuration du module mod_status&lt;br /&gt;
&lt;br /&gt;
# Configuration PimpedApacheStatus&lt;br /&gt;
Alias /pas /data/www/PimpedApacheStatus/current&lt;br /&gt;
&amp;lt;Directory &amp;quot;/data/www/PimpedApacheStatus/current&amp;quot;&amp;gt;&lt;br /&gt;
	Options FollowSymLinks&lt;br /&gt;
	DirectoryIndex index.php&lt;br /&gt;
	AllowOverride All&lt;br /&gt;
	Require all granted&lt;br /&gt;
	&amp;lt;FilesMatch \.php$&amp;gt;&lt;br /&gt;
		SetHandler &amp;quot;proxy:unix:/local/php/sockets/php7_pimpedapachestatus.sock|fcgi://localhost/&amp;quot;&lt;br /&gt;
	&amp;lt;/FilesMatch&amp;gt;&lt;br /&gt;
&amp;lt;/Directory&amp;gt;&lt;br /&gt;
# Fin de configuration PimpedApacheStatus&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dans le fichier &amp;lt;code&amp;gt;/local/www/current/conf/httpd.conf&amp;lt;/code&amp;gt;, ajouter la directive suivante :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
ExtendedStatus On&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Redémarrer Apache pour prise en compte :&lt;br /&gt;
&lt;br /&gt;
 systemctl restart http.service&lt;br /&gt;
&lt;br /&gt;
==== Serveurs supervisés ====&lt;br /&gt;
===== Configuration Apache =====&lt;br /&gt;
Pour chaque serveur à superviser, il faudra identifier la localisation des binaires d'Apache avec la commande suivante :&lt;br /&gt;
 httpd -V|grep HTTPD_ROOT|awk -F\&amp;quot; '{print $2}'&lt;br /&gt;
&lt;br /&gt;
Par exemple, sur un serveur, cela donnerait le résultat &amp;lt;code&amp;gt;/local/www/2.4.12&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Ainsi, dans le fichier &amp;lt;code&amp;gt;/local/www/2.4.12/conf/httpd.conf&amp;lt;/code&amp;gt;, ajouter la directive suivante :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
ExtendedStatus On&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Il faudra également identifier le fichier contenant la configuration du vhost ayant pour ''ServerName'' le nom du serveur à superviser.&lt;br /&gt;
&lt;br /&gt;
Par exemple, un serveur nommé ''myserver'', en lançant la commande :&lt;br /&gt;
 httpd -S&lt;br /&gt;
dont le retour est le suivant :&lt;br /&gt;
&amp;lt;pre&amp;gt;VirtualHost configuration:&lt;br /&gt;
*:80                   is a NameVirtualHost&lt;br /&gt;
         default server un.autre.site.com (/local/www/2.4.12/conf/extra/httpd-vhosts.conf:26)&lt;br /&gt;
         port 80 namevhost un.autre.site.com (/local/www/2.4.12/conf/extra/httpd-vhosts.conf:95)&lt;br /&gt;
         port 80 namevhost un.site.fr (/local/www/2.4.12/conf/extra/httpd-vhosts.conf:134)&lt;br /&gt;
         port 80 namevhost myserver (/local/www/2.4.12/conf/extra/httpd-vhosts.conf:152)&lt;br /&gt;
ServerRoot: &amp;quot;/local/www/2.4.12&amp;quot;&lt;br /&gt;
Main DocumentRoot: &amp;quot;/data/www&amp;quot;&lt;br /&gt;
Main ErrorLog: &amp;quot;/data/logs/default_error.log&amp;quot;&lt;br /&gt;
Mutex ssl-stapling: using_defaults&lt;br /&gt;
Mutex ssl-cache: using_defaults&lt;br /&gt;
Mutex default: dir=&amp;quot;/local/www/2.4.12/logs/&amp;quot; mechanism=default&lt;br /&gt;
Mutex rewrite-map: using_defaults&lt;br /&gt;
PidFile: &amp;quot;/local/www/2.4.12/logs/httpd.pid&amp;quot;&lt;br /&gt;
Define: DUMP_VHOSTS&lt;br /&gt;
Define: DUMP_RUN_CFG&lt;br /&gt;
User: name=&amp;quot;www&amp;quot; id=1001&lt;br /&gt;
Group: name=&amp;quot;www&amp;quot; id=8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
On constate que, sur le port 80, le fichier de configuration du vhost ayant pour ''ServerName'' '''myserver''' est le fichier &amp;lt;code&amp;gt;/local/www/2.4.12/conf/extra/httpd-vhosts.conf&amp;lt;/code&amp;gt;, dont la configuration débute à la ligne '''152'''.&lt;br /&gt;
&lt;br /&gt;
Dans ce fichier, dans la section du vhost précédemment identifié, insérer les lignes suivantes :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;apache&amp;quot;&amp;gt;&lt;br /&gt;
# Configuration du module mod_status&lt;br /&gt;
&amp;lt;Location /server-status&amp;gt;&lt;br /&gt;
	SetHandler server-status&lt;br /&gt;
	Require ip X.X.X.X&lt;br /&gt;
&amp;lt;/Location&amp;gt;&lt;br /&gt;
&amp;lt;Location /server-info&amp;gt;&lt;br /&gt;
	SetHandler server-info&lt;br /&gt;
	Require ip X.X.X.X&lt;br /&gt;
&amp;lt;/Location&amp;gt;&lt;br /&gt;
# Fin de configuration du module mod_status&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Attention !''' Il faudra remplacer la directive &amp;lt;code&amp;gt;Require ip X.X.X.X&amp;lt;/code&amp;gt; par :&lt;br /&gt;
 Order allow,deny&lt;br /&gt;
 Allow from X.X.X.X&lt;br /&gt;
selon la configuration du serveur Apache.&lt;br /&gt;
&lt;br /&gt;
Redémarrer Apache pour prise en compte :&lt;br /&gt;
&lt;br /&gt;
 systemctl restart http.service&lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
==== Serveur maître ====&lt;br /&gt;
===== Désactivation du message d'erreur SSL =====&lt;br /&gt;
Dans les fichiers suivants :&lt;br /&gt;
*&amp;lt;code&amp;gt;/data/www/PimpedApacheStatus/current/views/install.php&amp;lt;/code&amp;gt;&lt;br /&gt;
*&amp;lt;code&amp;gt;/data/www/PimpedApacheStatus/current/views/login.php&amp;lt;/code&amp;gt;&lt;br /&gt;
*&amp;lt;code&amp;gt;/data/www/PimpedApacheStatus/current/views/admin/settings.php&amp;lt;/code&amp;gt;&lt;br /&gt;
*&amp;lt;code&amp;gt;/data/www/PimpedApacheStatus/current/views/admin/servers.php&amp;lt;/code&amp;gt;&lt;br /&gt;
Localiser la section suivante :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
if (!isset($_SERVER['HTTPS'])){&lt;br /&gt;
    $oMsg-&amp;gt;add($aLangTxt['error-no-ssl'], 'error');&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Et la commenter comme ceci :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Désactivation du message d'erreur lié à l'absence d'utilisation du SSL&lt;br /&gt;
//if (!isset($_SERVER['HTTPS'])){&lt;br /&gt;
//    $oMsg-&amp;gt;add($aLangTxt['error-no-ssl'], 'error');&lt;br /&gt;
//}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Création du fichier de configuration =====&lt;br /&gt;
En ligne de commande, générer le hash d'un mot de passe avec la commande &amp;lt;code&amp;gt;md5sum&amp;lt;/code&amp;gt;. Par exemple, pour un mot de passe '''&amp;quot;unsupermotdepasse&amp;quot;''', passer la commande suivante :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo -n unsupermotdepasse|md5sum|awk '{print $1}'&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Cela générera le hash suivant :&lt;br /&gt;
 f0d4908a4c4465fe1e447650132012c9&lt;br /&gt;
Se rendre à l'URL http://myserver/pas/admin/?&amp;amp;action=settings et renseigner dans la section &amp;lt;code&amp;gt;config_user&amp;lt;/code&amp;gt; le code suivant en incluant le hash généré précédemment :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;auth&amp;quot;: {&lt;br /&gt;
        &amp;quot;user&amp;quot;: &amp;quot;myuser&amp;quot;,&lt;br /&gt;
        &amp;quot;password&amp;quot;: &amp;quot;f0d4908a4c4465fe1e447650132012c9&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;selfurl&amp;quot;: &amp;quot;/pas&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Valider la modification en cliquant sur '''OK'''.&lt;br /&gt;
&lt;br /&gt;
===== Modifier l'hôte par défaut =====&lt;br /&gt;
Se rendre dans la section '''&amp;quot;[http://myserver/pas/admin/?&amp;amp;action=servers Servers]&amp;quot;''' :&lt;br /&gt;
:[[Fichier:ClipCapIt-190813-151906.PNG|none|thumb|300px|Section serveurs]]&lt;br /&gt;
Modifier le serveur nommé '''localhost''' en cliquant sur &amp;quot;''Edit''&amp;quot; :&lt;br /&gt;
:[[Fichier:ClipCapIt-190813-151924.PNG|none|thumb|300px|Modification serveur]]&lt;br /&gt;
Renseigner les champs comme ceci :&lt;br /&gt;
*'''Server name'''&lt;br /&gt;
**myserver&lt;br /&gt;
*'''url of status page'''&lt;br /&gt;
**http://myserver/server-status&lt;br /&gt;
Cliquer en validant sur '''OK'''. Un message s'affiche pour confirmer la mise à jour :&lt;br /&gt;
:[[Fichier:ClipCapIt-190813-152042.PNG|none|thumb|300px|Serveur modifié]]&lt;br /&gt;
&lt;br /&gt;
==== Serveurs supervisés ====&lt;br /&gt;
Pour ajouter un serveur supervisé, s'assurer de lui [[#Configuration_Apache_2|avoir déployé la configuration Apache]] au préalable. Ensuite, se rendre dans la section '''&amp;quot;[http://myserver/pas/admin/?&amp;amp;action=servers Servers]&amp;quot;''' :&lt;br /&gt;
:[[Fichier:ClipCapIt-190813-152042.PNG|none|thumb|300px|Section serveurs]]&lt;br /&gt;
&lt;br /&gt;
Cliquer sur &amp;quot;'''Add server'''&amp;quot; :&lt;br /&gt;
:[[Fichier:ClipCapIt-190813-152144.PNG|none|thumb|300px|Ajout serveur]]&lt;br /&gt;
&lt;br /&gt;
Renseigner les champs suivants, par exemple pour le serveur '''mysecondserver''' :&lt;br /&gt;
*'''Server name'''&lt;br /&gt;
**mysecondserver&lt;br /&gt;
*'''url of status page'''&lt;br /&gt;
**http://mysecondserver/server-status&lt;br /&gt;
Cliquer en validant sur '''OK'''. Un message s'affiche pour confirmer l'ajout :&lt;br /&gt;
:[[Fichier:ClipCapIt-190813-152247.PNG|none|thumb|300px|Serveur ajouté]]&lt;br /&gt;
&lt;br /&gt;
== Administration ==&lt;br /&gt;
=== Verrouiller/déverrouiller la configuration ===&lt;br /&gt;
Dans la mesure où '''Pimped Apache Status''' n'a, à ce jour, aucune moyen d'authentification auprès d'un annuaire, il n'est possible de ne configurer qu'un seul identifiant.&lt;br /&gt;
&lt;br /&gt;
De ce fait, afin de partager la solution auprès de différents utilisateurs, l'identifiant et le mot de passe leur seront communiqués.&lt;br /&gt;
&lt;br /&gt;
Afin de protéger les fichiers de configuration de toute modification malencontreuse, il va falloir les mettre en lecture seule. Ainsi, il ne sera plus possible d'appliquer les modifications au travers de l'interface web.&lt;br /&gt;
&lt;br /&gt;
==== Verrouiller la configuration ====&lt;br /&gt;
Pour verrouiller la configuration, se connecter en SSH sur le serveur maître et lancer la commande suivante :&lt;br /&gt;
&lt;br /&gt;
 chmod ug-w /data/www/PimpedApacheStatus/current/config/config_servers.json /data/www/PimpedApacheStatus/current/config/config_user.json&lt;br /&gt;
&lt;br /&gt;
==== Déverrouiller la configuration ====&lt;br /&gt;
Pour déverrouiller la configuration, se connecter en SSH sur le serveur maître et lancer la commande suivante :&lt;br /&gt;
&lt;br /&gt;
 chmod ug+w /data/www/PimpedApacheStatus/current/config/config_servers.json /data/www/PimpedApacheStatus/current/config/config_user.json&lt;br /&gt;
&lt;br /&gt;
==== Alternative ====&lt;br /&gt;
Si l'on souhaite modifier la configuration de '''Pimped Apache Status''' sans passer les fichiers de configuration en écriture, il est possible de les éditer directement en SSH avec l'utilisateur '''root'''.&lt;br /&gt;
&lt;br /&gt;
== Utilisation ==&lt;/div&gt;</summary>
		<author><name>Jordan</name></author>
		
	</entry>
</feed>