Unable to configure server-status on Apache 2.4
I am trying to configure stats on Apache 2.4 and I'm unable to make it works. This is my current configuration:
$ cat sites-enabled/000-default.conf
<VirtualHost *:80> Redirect 404 / ErrorDocument 404 "Page Not Found"
</VirtualHost>
<VirtualHost *:80> ServerName ServerAlias test.example.com dev.example.com 127.0.0.1 web.example.com ServerAdmin webmaster@localhost DocumentRoot /var/www/modx Header set Content-Security-Policy: "frame-ancestors 'self' " Header set X-Frame-Options "allow-from " Header always set Strict-Transport-Security "max-age=63072000; includeSubDomains" ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined SetEnvIf Origin "http(s)?://(www\.)?(devaccess.example.com|testaccess.example.com)$" AccessControlAllowOrigin=$0 Header add Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin <Location /server-status> SetHandler server-status Order deny,allow Deny from all Allow from 127.0.0.1 </Location>
</VirtualHost>Someone can help me, please. What I am doing wrong?
When I curl it, I'm getting this:
$ curl -v
* Hostname was NOT found in DNS cache
* Trying 127.0.0.1...
* Connected to 127.0.0.1 (127.0.0.1) port 80 (#0)
> GET /server-status?auto HTTP/1.1
> User-Agent: curl/7.35.0
> Host: 127.0.0.1
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
< Date: Mon, 13 May 2019 21:08:14 GMT
* Server Apache is not blacklisted
< Server: Apache
< Strict-Transport-Security: max-age=63072000; includeSubDomains
< Location:
< Content-Length: 244
< Content-Type: text/html; charset=iso-8859-1
<
<!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="">here</a>.</p>
</body></html>
* Connection #0 to host 127.0.0.1 left intact 1 Answer
I am trying to configure
mod_statuson Apache 2.4 and I'm unable to make it work.
Make certain that
LoadModule status_module modules/mod_status.sois uncommented inhttpd.conf(or, in your case, likely/etc/apache2/apache2.conf).Try the following:
<Location "/server-status"> SetHandler server-status Require ip 127.0.0.1 </Location>