WAMPServer 的httpd.conf 文件中只有两个地方存在Require all denied 语法,它们是:-
<Files ".ht*">
Require all denied
</Files>
这会阻止人们访问和.htaccess 文件,应该继续使用Require all denied
<Directory />
AllowOverride none
Require all denied
</Directory>
这将为安装 Apache 的驱动器设置基本安全性。 正确地说,NOTHING AND NOBODY 可以访问驱动器根目录或其任何子文件夹上的任何内容。 使用 Apache,您总是从拒绝所有访问开始,然后对于包含您网站的特定文件夹,您允许 Apache 访问。
假设您尚未为您的站点创建虚拟主机,You should and here is how to do it
但是假设你没有,那么你需要做的就是允许远程访问你的站点,就是告诉 Apache 任何人都可以访问你的站点。这只需使用 wampmanager 菜单即可完成:-
wampmanager -> Put Online
这将编辑 httpd.conf 文件的这一部分
来自
# onlineoffline tag - don't remove
Require local
到
# onlineoffline tag - don't remove
Require all granted
这将允许任何人访问,但只能访问包含 <Directory "c:/wamp/www/"> 块中提到的文件夹。哦,它还会自动重新启动 Apache,以便它接受更改
但是,有更安全的方法来执行此操作,如果您在 Intranet 中工作,听起来像,请使用 wampmanager 菜单再次手动编辑 httpd.conf 文件
wampmanager -> Apache -> httpd.conf
找到这个部分
<Directory "c:/wamp/www/">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride all
#
# Controls who can get stuff from this server.
#
# onlineoffline tag - don't remove
Require local
</Directory>
然后像这样在Require local 之后添加这个
# onlineoffline tag - don't remove
Require local
# to allow anyone on your subnet to access note only 3 of the 4 quartiles used
Require ip 192.168.1
# or to be more specific
Require ip 192.168.1.100
Require ip 192.168.1.101
Require ip 192.168.1.102
</Directory>
最后,如果您确实为这个项目创建了一个虚拟主机,请给我留言,我将添加一些描述如何执行此操作的内容,但仅针对一个虚拟主机。