码迷,mamicode.com
首页 > 数据库 > 详细

mac osx Forbidden You don't have permission to access / on this server解决方法

时间:2015-01-13 00:04:46      阅读:186      评论:0      收藏:0      [点我收藏+]

标签:

(1)首先查看*.conf 是否有读写权限,如果没有要将文件赋予读写权限,比如

sudo chmod 777 localhost.conf

(2)再查看/Users/username/Sites/localhost/文件夹是否有index.html文件,没有的话,创建一个,默认是打开index.html文件

(3)最后查看localhost配置文件

对于OSX 10.9 Apache 2.2

<VirtualHost *:80>
    DocumentRoot "/Users/xx/Sites/localhost"
    ServerName localhost
    ErrorLog "/Users/xx/Sites/logs/localhost-error_log"
    CustomLog "/Users/xx/Sites/logs/localhost-access_log" common
    <Directory "/Users/xx/Sites/localhost">
            Order deny,allow
            Allow from all
    </Directory>
</VirtualHost>

对于OSX 10.10 Apache 2.4

<VirtualHost *:80>
    DocumentRoot "/Users/xx/Sites/localhost"
    ServerName localhost
    ErrorLog "/Users/xx/Sites/logs/localhost-error_log"
    CustomLog "/Users/xx/Sites/logs/localhost-access_log" common
    <Directory "/Users/xx/Sites/localhost">
            Require all granted    
    </Directory>
</VirtualHost>        

(4)最后重启apache

 sudo apachectl restart

 

mac osx Forbidden You don't have permission to access / on this server解决方法

标签:

原文地址:http://www.cnblogs.com/xiongqiangcs/p/4220134.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!