Невозможно настроить состояние сервера в Apache 2.4

Я пытаюсь настроить статистику на Apache 2.4, и я не могу заставить его работать. Это моя текущая конфигурация:

$ cat sites-enabled/000-default.conf

<VirtualHost *:80>
        Redirect 404 /
        ErrorDocument 404 "Page Not Found"
</VirtualHost>

<VirtualHost *:80>
    ServerName www.example.com
    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' 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 127.0.0.1
    </Location>
</VirtualHost>

Кто-нибудь может мне помочь, пожалуйста. Что я делаю не так?

Когда я скручиваю это, я получаю это:

$ curl -v http://127.0.0.1/server-status?auto
* 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: https://127.0.0.1/server-status?auto
< 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="https://127.0.0.1/server-status?auto">here</a>.</p>
</body></html>
* Connection #0 to host 127.0.0.1 left intact

0 ответов

Другие вопросы по тегам