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 *:80>
    ServerName www.example.com
    ServerAlias test.example.com dev.example.com web.example.com
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/modx
    Header set Content-Security-Policy: "frame-ancestors 'self' http://resources.example.com https://resources.example.com http://web.example.com https://web.example.com"
    Header set X-Frame-Options "allow-from https://resources.example.com https://web.example.com"
    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

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
* Connected to ( port 80 (#0)
> GET /server-status?auto HTTP/1.1
> User-Agent: curl/7.35.0
> Host:
> 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
<title>301 Moved Permanently</title>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="">here</a>.</p>
* Connection #0 to host left intact
  • As can you see in the output of curl, you had been redirected to https. Check configurations of other sites. Also, it can be the rewrite rules or something other in the .htaccess file. – Anton Danilov May 13 at 22:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.