24小时在线 - 古典小说 - 文学小说 - 关于我们
您的当前位置:首页 > 服务器 > Apache >

Apache提示You don't have permission to access / on this serv

来源:比特技术网 编辑:网络 时间:2018-07-20点击:
导读:测试时遇到将一本地目录设置为一apache的虚拟主机,在httpd-vhosts.conf文件中进行简单设置,然后在hosts文件中将访问地址指向本地,启动apache,进行访问,却出现了You dont have permission to access / on this server的提示,baidu了一下,原来是因为我
测试时遇到将一本地目录设置为一apache的虚拟主机,在httpd-vhosts.conf文件中进行简单设置,然后在hosts文件中将访问地址指向本地,启动apache,进行访问,却出现了You don't have permission to access / on this server的提示,baidu了一下,原来是因为我的虚拟主机目录为非apache安装目录下的htdocs,所以违反了apache对默认对网站根访问权限。
 
apache的默认虚拟主机根目录地址为../Apache Software Foundation/Apache2.2/htdocs 目录下,需要对httpd.conf文件进行修改才能指向其他目录。
 
 
 
在httpd.conf文件下找到这段:
 
# Each directory to which Apache has access can be configured with respect  
# to which services and features are allowed and/or disabled in that  
# directory (and its subdirectories).   
#  
# First, we configure the "default" to be a very restrictive set of   
# features.    
#  
<Directory />  
    Options FollowSymLinks  
    AllowOverride None  
    Order deny,allow  
    Deny from all  
</Directory></span>  
 
 
 
#
# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories). 
#
# First, we configure the "default" to be a very restrictive set of 
# features.  
#
<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>
 
 
 将之修改为
 
# 允许指向外部的目录进行访问  
<Directory />  
    Options Indexes FollowSymLinks  
    AllowOverride None  
</Directory></span>  
 
 
# 允许指向外部的目录进行访问
<Directory />
    Options Indexes FollowSymLinks
    AllowOverride None
</Directory>
 然后重启apache,就ok了。
来源:比特技术在线(www.byte.online),欢迎分享本文,转载请保留出处!
http://www.byte.online/a/fuwuqi/Apache/2018/871395.html
责任编辑:网络

    打赏

    取消

    感谢您的支持,我会继续努力的!

    扫码支持
    扫码打赏,你说多少就多少

    打开支付宝扫一扫,即可进行扫码打赏哦

    网友评论:

    Copyright © www.byte.online 比特技术在线 版权所有 粤ICP备15038486号-3
    本站所有资料来源于网络,由个人收集整理,仅限于个人学习和研究,如果侵犯您的权益请联系我们删除!
    Top