您现在的位置是:首页 > 其他

李清波 2014-06-01 其他 42459 复制当前网址

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

前几天网站刚上线,准备好不容易配置好了apache环境,网站也能正常访问了,但时候自己还想再配置个测试的二级域名,因为自己本地的时候直接用端口访问,直接再加一个端口,一个网站地址就搞定了,但是服务器却不能这样,也根据网站的相关配置配置好了多站点,但是apache怎么就是启动了,后面百度了一天,才找到了这篇文章,所以现在分享了给大家,供大家参考。(废话说多了)


配置多站点的方法:apache配置多站点的方法 


一般配置多站点,然后出现You don't have permission to access / on this server.  这个提示。查了一下apache手册找到问题所在处。这里定义了默认对网站根的访问权限。

# 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.  
#    
    Options FollowSymLinks    
    AllowOverride None    
    Order deny,allow    
    Deny from all

将上面对应的代码改成以下

    Options Indexes FollowSymLinks
    AllowOverride None


重启一下apache 问题解决了。


别说很少配置apache的人了,就算经常配置apache的人也未必懂得这些。

文章来源:http://liqingbo.com/blog-240.html

评论