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

Posted 小洋粉

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了You 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>

以上是关于You don't have permission to access / on this server. wampserver3.1.0配置外网访问的问题的主要内容,如果未能解决你的问题,请参考以下文章

You don't have permission to access / on this server.

“You don't have permission to access /phpmyadmin/ on this server.”

Forbidden You don't have permission to access / on this server.

phpStudy???????????? ??????You don't have permission to access / on this server

Forbidden You don't have permission to access XXX on this server

the file couldn't be opened because you don't have permission to view it