慕粉4282406
2017-04-25 13:01
系统:win10
wamp版本 3.0.6
Apache版本 2.4.23
本机可以访问test01.com
局域网内其他电脑不可以访问
httpd-vhosts.conf修改如下:
<VirtualHost *:80>
ServerName test01.com
DocumentRoot d:/wamp/www/test01
<Directory "d:/wamp/www/test01">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
Require all granted
</Directory>
httpd.conf修改如下:(+斜体部分)
DocumentRoot "D:/wamp/www"
<Directory "D:/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 +Multiviews
#
# 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
Require all granted
</Directory>
hosts文件加127.0.0.1 test01.com
可能是下面几点原因,楼主可以试一下
局域网中的其他主机要访问你本机上的网站的话,是需要你本机的iPv4地址的,不是直接输入test1.com就能访问的。本机ipv4地址在cmd下用ipconfig命令查看
2.有可能是系统防火墙的原因。你可以关闭防火墙后再试试。
3.httpd-vhosts.conf文件中 Require local 也应该一并注释掉
4.还有就是hosts文件中添加的127.0.0.1是你的本机回路地址,别人的hosts文件里要修改成你的iPv4地址才行,不然别人的电脑就会出现自己请求访问自己的情况,当然无法访问了。
不允许访问,为什么?
输入ip提示 you don't have permission to access /on this server
你是怎么访问的?直接输入的test1.com还是你本机的ip?
PHP入门篇
456432 学习 · 6590 问题
相似问题