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

sudo chmod  localhost.conf

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

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

对于OSX 10.9 Apache 2.2

<VirtualHost *:>
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 *:>
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解决方法的更多相关文章

  1. wampserver You don't have permission to access / on this server. 解决 方法(转,正好碰到这样的事情了就转下来)

    最近在安装最近版wampserver 2.2 d时发现安装好后启动服务器,访问localhost显示You don't have permission to access / on this serv ...

  2. wampserver You don't have permission to access / on this server. 解决方法

    最近在安装最近版wampserver 2.2 d时发现安装好后启动服务器,访问localhost显示You don't have permission to access / on this serv ...

  3. localhost访问错误Forbidden You don't have permission to access / on this server.解决办法(亲测)

    在httpd.conf文件下找到这段: <Directory /> Options FollowSymLinks AllowOverride None Order deny,allow D ...

  4. Forbidden You don't have permission to access / on this server. You don't have permission to access /phpmyadmin/ on this server. 解决办法

    Forbidden  You don't have permission to access / on this server.   解决办法 打开 httpd.conf 文件, 将 #   onli ...

  5. PHP错误:Forbidden You don't have permission to access / on this server.

    今天在测试一个php程序的时候,发现这个问题: Forbidden You don't have permission to access / on this server. 开始的时候我是用http ...

  6. Forbidden You don't have permission to access / on this server.

    原文:Forbidden You don't have permission to access / on this server. Forbidden You don't have permissi ...

  7. 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的版本问 ...

  8. 蛋疼的 403 Forbidden You don’t have permission to access / on this server.

    参考博文: a.http://www.linuxidc.com/Linux/2016-09/134827.htm 这个解释挺好 昨天配置新服务器:以为自己老手  就一步到位结果一直出现 403 For ...

  9. MAMP "403 Forbidden You don't have permission to access / on this server."

    2015年01月22日 17:27:31 阅读数:3488 用MAMP搭建本地服务器的时候,设置好ip和端口等属性之后,浏览器访问,报 403错误: Forbidden You don't have ...

随机推荐

  1. thinkphp判断是否登录

    自己写一个BasicController继承了官方的Controller,将判断登录的代码放在BasicController中,然后让其他自己编写的Controller都继承BasicControll ...

  2. [mark] Linux下如何批量删除空文件

    可以使用 xargs 命令来批量处理,代码如下: $ find . -name '*' -type f -size 0c | xargs rm -f

  3. Circular Buffer

    From:http://bradforj287.blogspot.com/2010/11/efficient-circular-buffer-in-java.html import java.util ...

  4. Reverse Core 第二部分 - 14&15章 - 运行时压缩&调试UPX压缩的notepad

    @date: 2016/11/29 @author: dlive 0x00 前言 周六周日两天在打HCTF2016线上赛,没时间看书,打完比赛接着看~~ 0x01 运行时压缩 对比upx压缩前后的no ...

  5. IE11兼容性问题修改

    最近测试给了我一大堆BUG,一瞅发现全是IE11的.吐槽一下这个浏览器真的比较特立独行.很多默认的样式跟别的浏览器不同,而且最明显的一点应该是padding左右内边距往往比别的浏览器大了一倍.但是当需 ...

  6. Buffer类

    输入流中可以通过缓冲区来加大读取的效率,sun公司感觉可以加快执行效率,他就为我们提供了一个类来操作缓存区. Buffer来头的类:所有缓冲流都是以Buffer开头的: 学习缓冲流的作用: Buffe ...

  7. 怎么写makefile?(转)

    跟我一起写 Makefile 陈皓 第一章.概述 什么是makefile?或许很多Winodws的程序员都不知道这个东西,因为那些Windows的IDE都为你做了这个工作,但我觉得要作一个好的和 pr ...

  8. 关于控件的Invoke(...)方法和BeginInvoke(...)方法的区别

    这两个方法最主要的区别就是一个是同步,一个是异步,即会阻塞线程,那么阻塞哪个线程呢?我们用代码来分析(工具是VS2010) using System; using System.Collections ...

  9. rdlc报表相关

    错误提示:1.尚未指定报表定义的来源 注意ReportPath与ReportEmbeddedResource的区别,前者获取或设置本地报表的本地文件系统路径,设置此属性将导致后者属性值被忽略:后者将获 ...

  10. Swift - 3.0之GCD学习

    import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoa ...