Monitorare Apache con mod_status

Mattepuffo's logo
Monitorare Apache con mod_status

Monitorare Apache con mod_status

Non tutti sanno che Apache già integra un modulo per il monitoraggio: mod_status!

Vediamo come attivarlo e configurarlo.

Per attivarlo:

# a2enmod status
Module status already enabled

Nel mio caso era già attivo.

A questo punto andiamo a configurarlo:

# vim /etc/apache2/mods-enabled/status.conf

Qui dovete cercare la riga Require ip che dovrebbe essere commentata; li ci dovete mettere l'IP, o il range, dal quale volete accedere alla pagina di monitoraggio.

A questo punto riavviamo il server:

# systemctl restart apache2

# systemctl status apache2
● apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2020-09-29 13:38:03 CEST; 1s ago
     Docs: https://httpd.apache.org/docs/2.4/
  Process: 18536 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
 Main PID: 18540 (apache2)
    Tasks: 31 (limit: 4915)
   Memory: 19.5M
   CGroup: /system.slice/apache2.service
           ├─18540 /usr/sbin/apache2 -k start
           ├─18542 /usr/sbin/apache2 -k start
           ├─18546 /usr/sbin/apache2 -k start
           ├─18552 /usr/sbin/apache2 -k start
           ├─18557 /usr/sbin/apache2 -k start
           ├─18562 /usr/sbin/apache2 -k start
           └─18568 /usr/sbin/apache2 -k start

set 29 13:38:03 server-casa systemd[1]: Starting The Apache HTTP Server...
set 29 13:38:03 server-casa systemd[1]: Started The Apache HTTP Server.

Per accedere alla pagina vi basta andare su http://SERVER/status.

Enjoy!


Condividi

Commentami!