martes, 20 de febrero de 2018

Como habilitar el mod_status de Apache

El mod-status en apache nos da información del uso de recursos del servidor y servicios apache, para habilitarlo realizamos lo siguiente:

1. Conectarse al servidor por SSH

2. Revisar el que el modulo "status" este cargado:

For Debian-based systems:
# apache2ctl -M | grep status
status_module (shared)
For RedHat-based systems:
# httpd -M | grep status
status_module (shared)
Si el resultado esta vacio, tendremos que habilitar el mod_status con el comando a2enmod status

3. Supongamos que queremos habilitar los reportes desde el navegador para una sola ip (203.0.113.2) y para localhost.

Archivo de configuracion de apache:

  • RedHat-based: /etc/apache2/mods-enabled/status.conf
  • Debian-based: /etc/httpd/conf.modules.d/status.conf
    • For Apache 2.2
      <IfModule mod_status.c>
      <Location /server-status>
      SetHandler server-status
      Order deny,allow
      Deny from all
      Allow from 127.0.0.1 localhost ip6-localhost 203.0.113.2
      </Location>
      ExtendedStatus On
      </IfModule>






    • For Apache 2.4
      <IfModule mod_status.c>
      <Location /server-status>
      SetHandler server-status
      <RequireAny>
      Require local
      Require ip 203.0.113.2
      </RequireAny>
      </Location>
      ExtendedStatus On
      </IfModule>






4. Reiniciar el servicio Apache:
  • For Debian-based systems:
    # service apache2 restart
  • For RedHat-based systems:
    # service httpd restart

5. Para acceder desde el navegador ingresamos a la ruta http://nombredeservidor_o_ip/server-status


No olviden compartir

No hay comentarios:

Publicar un comentario