php多站点配置以及Forbidden You don't have permission to access / on this server问题解决
来源:互联网 发布:利搜排名软件 编辑:程序博客网 时间:2024/06/06 01:56
php多站点配置以及Forbidden You don't have permission to access / on this server问题解决
版权声明:本文为博主原创文章,未经博主允许不得转载。
目录(?)[+]
前几天在电脑上配置多站点的后突然出现了:”You don’t have permission to access / on this server!“ 究其原因是:swampserver默认访问的是www文件夹的站点,不允许访问其他的站点。花了老半天的时间解决了。分享一下希望帮助需要的人
first:首先教你如何配置多站点
在”C:\wamp\bin\apache\apache2.4.9\conf“目录下打开httpd.conf配置文件
大概516行左右在找到
# Virtual hosts
#Include conf/extra/httpd-vhosts.conf
把include 的注释去掉,让他去加载conf/extra/httpd-vhosts.conf文件在”C:\wamp\bin\apache\apache2.4.9\conf\extra“目录打开
httpd-vhosts.conf文件,直接在这里配置站点
上面全部注释,第一句
NameVirtualHost *:80(设置端口号)
# #以下是自己配置的站点1
< VirtualHost *:80 >
ServerName www.xiaozheng.com (网站的域名)
DocumentRoot “C:\wamp\www” (文件的路径)
< Directory “C:\wamp\www” > (文件的路径)
Options Indexes
Order allow,deny
Allow from all
Satisfy all
< /Directory >
< /VirtualHost >3.在“C:\Windows\System32\drivers\etc”的hosts文件里面配置
就可以了
但是昨天我在这样子配置的时候出现了一个问题~~如果说我的文件路径在wamp\www以外的话,比如“F:\xiaozheng”会出现“You don’t have permission to access / on this server!”问腿!接下来教你如何解决这个问题
首先:swampserver服务器默认是只能访问站内的文件夹,在http.conf文件里面有
< Directory />
AllowOverride all
Require all denied (拒绝了外部的访问)
< /Directory >
必须把上面的改成:
< Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
#Deny from all
Allow from all
#允许所有访问
Satisfy all
< /Directory>
第二步:
< Directory “D:/Wamp5/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.2/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:# Options FileInfo AuthConfig Limit#AllowOverride all## Controls who can get stuff from this server.#onlineoffline tag - don't removeOrder Deny,AllowDeny from allAllow from 127.0.0.1
< /Directory>
修改成
< Directory “D:/Wamp5/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.2/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:# Options FileInfo AuthConfig Limit#AllowOverride all## Controls who can get stuff from this server.## onlineoffline tag - don't removeOrder Deny,Allow#Deny from all# Allow from 127.0.0.1Allow from all
< /Directory>
其实是可以把一些不必要的注释删掉的,我是把那些注释删掉了,简洁了好多,配图
或者还有一种新的解决方法,在httpd-vhosts.conf配置站点的时候这样配置
< VirtualHost *:80 >
ServerName www.xiaozheng.com
DocumentRoot “C:\wamp\www”
<Directory "C:\wamp\www"> Options Indexes FollowSymLinks #原先是Options Indexes AllowOverride all #原先是没有这句的,这两句不管是否超出先限制的文件 范围,都可以访问,就不会出现权限问题了 Order allow,deny Allow from all Satisfy all</Directory>
< /VirtualHost>
然后保存,重启服务,在访问就解决了这个问题。
希望对新手有帮助
- php多站点配置以及Forbidden You don't have permission to access / on this server问题解决
- php多站点配置以及Forbidden You don't have permission to access / on this server问题解决
- Forbidden You don't have permission to access /localhost/plan/index2.php on this server.
- php:Forbidden You don’t have permission to access / on this server.
- php:Forbidden You don’t have permission to access / on this server.
- You don\'t have permission to access /test.php on this server.怎样解决Forbidden
- 局域网访问Apache PHP错误:Forbidden You don't have permission to access / on this server.
- PHP错误:Forbidden You don't have permission to access / on this server. 解决办法
- PHP错误:Forbidden You don't have permission to access / on this server.
- PHP错误:Forbidden You don't have permission to access / on this server.
- Forbidden You don't have permission to access /php/ on this server.
- Forbidden:You don't have permission to access /index.php on this server
- Apache配置问题Forbidden You don't have permission to access / on this server
- Apache配置问题Forbidden You don't have permission to access / on this server
- apache 2.49配置虚拟主机Forbidden You don't have permission to access / on this server
- WAMP Server多站点出现You don t have permission to access / on this server错误
- 问题解决: You don't have permission to access /phpmyadmin/main.php on this server.
- VisualSVN---You don't have permission to access on this server/Access ...forbidden
- C#编写C/S端代码,Windows应用程序 --- 初接触(一)
- 有趣的位运算
- oracle延时约束的问题
- 用Redis做单点登录(理论)
- stylus 为啥要加入 ~ @import '~common/stylus/mixin'
- php多站点配置以及Forbidden You don't have permission to access / on this server问题解决
- Go语言学习感悟
- 深度学习笔记[1]: CNN for CV斯坦福CS231n (1)
- ubuntu 安装cmake-3.x
- Java注释中的@deprecated与源代码中的@Deprecated
- Liferay6.2开发之使用Search-Container
- iOS 使用AFNet上传图片(多张)
- xcopy中提示“无效的参数数量”的解决方法
- React-Native ART 绘图简析