php多站点配置以及Forbidden You don't have permission to access / on this server问题解决
来源:互联网 发布:数据存储服务器 编辑:程序博客网 时间:2024/05/16 18:37
前几天在电脑上配置多站点的后突然出现了:”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
- Qt Install Framework使用方法
- oracle数据库中truncate表后如何快速恢复
- CSS样式覆盖规则
- 观察者模式2种用法---结合代理模式实现
- Crazy Driver
- php多站点配置以及Forbidden You don't have permission to access / on this server问题解决
- hdu-5876-Sparse Graph
- BookBlock - 效果非常真实的书本翻页预览
- 启动mysql错误解决方案,学会查看错误日志:mysql.sock丢失,mysqld_safe启动报错
- Web 开发中很实用的10个效果
- Sql Server2012还原数据库时提示“未选择要还原的备份集”解决办法
- 八.Android的Service生命周期
- hdu 5876 Sparse Graph 补图单源最短路
- CSS3 clip-path polygon图形构建与动画变换