Apache提示You don't have permission to access / on this server问题解决
程序员文章站
2022-03-15 22:44:12
...
今天用apache配置虚拟主机的时候,出现下面的错误
首先配置文件httpd-vhosts.conf必须正确
<VirtualHost *:80>
ServerAdmin aaa@qq.com
DocumentRoot "C:\yunan\lumen\public"
ServerName www.php.com
ServerAlias php.com
ErrorLog "logs/dummy-host.example.com-error.log"
CustomLog "logs/dummy-host.example.com-access.log" common
<Directory "C:\yunan\lumen\public">
Options FollowSymLinks
AllowOverride None
Order deny,allow
Allow from all
Require all granted
</Directory>
</VirtualHost>
注意:Require all granted 这句必须有
不知道为什么不加这句话就不好使
然后确认http.conf中启用了以下模块
LoadModule authz_host_module modules/mod_authz_host.so #基于主机的组授权模块
LoadModule access_compat_module modules/mod_access_compat.so #基于主机的组授权httpd 2.x兼容的模块
LoadModule proxy_module modules/mod_proxy.so #apache的代理模块
LoadModule proxy_http_module modules/mod_proxy_http.so #代理http和https请求模块
LoadModule vhost_alias_module modules/mod_vhost_alias.so #虚拟主机动态配置模块
Include conf/extra/httpd-vhosts.conf #启用虚拟主机配置文件
重启apache好使
上一篇: Python每日一练
下一篇: PHP数组的倒序排列
推荐阅读
-
apache 提示You don't have permission to access /test.php on
-
You don’t have permission to access /index.php on.
-
对于搭建网站中出现“You don't have permission to access this resource.”错误提示的解决思路
-
You don't have permission to access / on this server,Forbidden
-
CentOS7.0下安装Apache2.4.20版本,安装完成之后,报 You don't have permission to access / on this server.
-
wamp不能使用phpmyadmin,提示“You don't have permission to access /phpmyadmin/ on this server.”...
-
Apache启动后出现You don't have permission to access on this server的解决办法
-
PHP错误:Forbidden You don't have permission to access / on thi_PHP教程
-
apache出现You don't have permission to access / on thi_PHP教程
-
Apache出现 You don't have permission to access /phpmya