ou don't have permission to access / on this server. wampserver3.1.0配置外网访问的问题

参考各种wamp教程后外网仍然不能访问服务器,很是头疼

网上好多wampserver配置都比较久远,最新版本3.1.0的很少,首先打开httpd.conf文件(这部分较简略,详细可以参考其他wamp配置教程)

更改DocumentRoot 。。。和<Directory " 。。。">后,由于wampserver3.0.6的apache版本为2.4.23,所以允许外网访问要在Directory 中的加上:Require all granted,

之后发现还是访问不了:

技术分享

原来在apache 2.4.27中有这段代码:

# Virtual hosts
Include conf/extra/httpd-vhosts.conf

这样导致httpd.conf中的Require all granted不起作用,所以在apache根目录\conf \ extra中找到httpd-vhosts.conf文件,在Directory 中添加:Require all granted,这样就可以外网访问了!

<VirtualHost *:80>
  ServerName www.saneb.cn
  DocumentRoot "c:/sitefolder"
  <Directory "c:/sitefolder/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride All
    Require local
    Require all granted
  </Directory>
</VirtualHost>

猜你喜欢

转载自blog.csdn.net/wuxianbing2012/article/details/81671418
今日推荐