【问题标题】:Disable directory browsing wamp禁用目录浏览 wamp
【发布时间】:2020-01-29 20:17:47
【问题描述】:

尝试禁用 wamp 中的目录浏览,以便我的文件不会在 localhost 中列出。

但我找不到任何有关它的最新信息,并且所有旧视频/教程都不起作用。

我已经尝试将 +Indexes 更改为 -Indexes 并尝试将其完全删除,但它不起作用

PHPIniDir "${APACHE_DIR}/bin"
LoadModule php7_module "${INSTALL_DIR}/bin/php/php7.0.33/php7apache2_4.dll"

<IfModule unixd_module>

User daemon
Group daemon

</IfModule>

ServerAdmin wampserver@wampserver.invalid

ServerName localhost:80

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

HostnameLookups Off

DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">

    Options +FollowSymLinks +Multiviews

    AllowOverride All
    Require local
</Directory>

<IfModule dir_module>
    DirectoryIndex index.php index.php3 index.html index.htm
</IfModule>

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

ErrorLog "${INSTALL_DIR}/logs/apache_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>
      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
    </IfModule>

</IfModule>

<IfModule alias_module>

    ScriptAlias /cgi-bin/ "${SRVROOT}/cgi-bin/"

</IfModule>

<IfModule cgid_module>

</IfModule>

<Directory "${SRVROOT}/cgi-bin">
    AllowOverride None
    Options None
    Require all granted
</Directory>

<IfModule headers_module>
    RequestHeader unset Proxy early
</IfModule>

<IfModule mime_module>

    TypesConfig conf/mime.types

    AddEncoding x-compress .Z
    AddEncoding x-gzip .gz .tgz

    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php .php3

</IfModule>

EnableSendfile off

Include conf/extra/httpd-autoindex.conf

Include conf/extra/httpd-vhosts.conf

<IfModule proxy_html_module>
Include conf/extra/proxy-html.conf
</IfModule>

<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>

Include "${INSTALL_DIR}/alias/*"

我希望得到一个禁止页面,但得到的是正常的本地主机页面

【问题讨论】:

  • 标签内的 httpd.conf 文件中 @04FS
  • Options +FollowSymLinks +Multiviews 更改为 Options +FollowSymLinks +Multiviews -Indexes

标签: php apache wamp wampserver wamp64


【解决方案1】:

正确答案是删除httpd-vhosts.conf文件中的+indexes

【讨论】:

    【解决方案2】:

    左键单击“Wampmanager -> Apache -> httpd-vhost.conf”;在此处查找+Indexes 并将其更改为-Indexes

    【讨论】:

      猜你喜欢
      • 2011-02-01
      • 1970-01-01
      • 2017-06-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-06-04
      • 1970-01-01
      相关资源
      最近更新 更多