I ask for a little help with httpd configuration with zapache addon (GitHub - lorf/zapache: Zabbix Apache Monitoring Script (from https://www.zabbix.org/wiki/Docs/howto/apache_monitoring_script#Method_3, originally from https://www.zabbix.com/forum/showthread.php?p=62457)) for zabbix to monitor my awesome Nextcloud instance
CentOS 7, apache 2.4 and configs are:
/etc/httpd/conf/httpd.conf – default settings
/etc/httpd/conf.d/nextcloud.conf:
<VirtualHost *:80> ServerName mydomain.com Redirect permanent / https://mydomain.com </VirtualHost>
/etc/httpd/conf.d/ssl.conf:
<VirtualHost _default_:443> Alias / "/var/www/html/nextcloud/" DocumentRoot "/var/www/html/nextcloud" ServerName mydomain.com:443 <IfModule mod_headers.c> Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains; preload" </IfModule> <Directory "/var/www/html/nextcloud"> Options +FollowSymLinks AllowOverride All <IfModule mod_dav.c> Dav off </IfModule> SetEnv HOME /var/www/html/nextcloud SetEnv HTTP_HOME /var/www/html/nextcloud </Directory> <Directory "/var/www/nextcloud/data/"> Require all denied </Directory>
[and others like SSL options are set of course]
It is working fine.
Now I have to enable httpd server-status for zapache addon to read it and send informations to the Zabbix server.
Zapache addon does it by requesting http://localhost/server-status?auto URL.
I have tried to do it by adding to httpd.conf
<Location /server-status> SetHandler server-status Require ip 127.0.0.1 Require ip ::1 </Location>
but it didn’t work:
[root@nextcloud conf.d]# curl http://localhost/server-status?auto <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>301 Moved Permanently</title> </head><body> <h1>Moved Permanently</h1> <p>The document has moved <a href="https:/mydomain.comserver-status?auto">here</a>.</p> </body></html>
https://localhost/server-status?auto is working, but redirects to nextcloud home page.
So, what is proper configuration for that case?
Regards :))