Почему мой корневой каталог доступен из apache? - PullRequest
3 голосов
/ 20 апреля 2019

Я играл, когда внезапно заметил, что мой браузер может получить доступ к моему корневому каталогу, просто набрав "/" в адресе. Я проверил httpd.conf, там четко указано:

<Directory "/">
    AllowOverride none
    Require all denied
</Directory>

Я на Fedora 29, и это мой httpd.conf:

ServerRoot "/etc/httpd"

Listen 80
LimitRequestBody  5242880

Include conf.modules.d/*.conf

User apache
Group apache

ServerAdmin root@localhost

<Directory "/">
    AllowOverride none
    Require all denied
</Directory>

DocumentRoot "/var/www/html"

<Directory "/var/www">
    LimitRequestBody 5242880
    AllowOverride None
    Require all granted
</Directory>

<Directory "/var/www/html">
LimitRequestBody  5242880

    Options Indexes FollowSymLinks

    AllowOverride None

    Require all granted
</Directory>

<IfModule dir_module>
    DirectoryIndex index.html
</IfModule>

<Files ".ht*">
    Require all denied
</Files>

ErrorLog "logs/error_log"

LogLevel warn 

<IfModule log_config_module>

    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b" common

    <IfModule logio_module>
      # You need to enable mod_logio.c to use %I and %O
      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
    </IfModule>
    CustomLog "logs/access_log" combined
</IfModule>

<IfModule alias_module>
    ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
</IfModule>

<Directory "/var/www/cgi-bin">
    LimitRequestBody  5242880
    AllowOverride None
    Options +ExecCGI
    Require all granted
    SetHandler fcgid-script
</Directory>

<IfModule mime_module>

    TypesConfig /etc/mime.types

    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
</IfModule>

AddDefaultCharset UTF-8

<IfModule mime_magic_module>
    MIMEMagicFile conf/magic
</IfModule>

EnableSendfile on

IncludeOptional conf.d/*.conf

LimitRequestBody 1024000

<Directory "/var/www/cgi-bin/data">
    Order Deny,Allow
    Deny From All
    Allow From 127.0.0.1
</Directory>

Почему это происходит?

1 Ответ

0 голосов
/ 26 апреля 2019

Мой корневой каталог не был доступен apache. Это был файл параметров URI.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...