(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. 爬虫 htmlUnit遇到Cannot locate declared field class org.apache.http.impl.client.HttpClientBuilder.dnsResolve错误

    当在使用htmlUnit时遇到无法定位org.apache.http.impl.client.HttpClientBuilder.dnsResolver类时,此时所需要的依赖包为: <depen ...

  2. WebView随学笔记

    对于WebView而言我们需要掌握的内容是: /** 学习目标:webView * 1).将WebView加入到应用中 * 2).使用WebView加载页面 * 3).获取网络访问 * 4).在Web ...

  3. log4net 添加日志

    1.  在config里配置一下 <configSections>    <section name="log4net" type="System.Co ...

  4. ssl访问的原理

    本文无图文对照解释,但力求通俗易懂.请读者边读边手绘各个流程,一便于理解.      总体交互流程如下      1. 客户端发起HTTPS请求 这个没什么好说的,就是用户在浏览器里输入一个https ...

  5. 为什么使用Junit Test而不用普通java main方法来完成测试?

    因为在程序里边,一个接口对应一个实现方法,而在接口中常常会定义相关的很多方法,所以在测试的时候,如果都在main方法里边进行测试,main方法就会显得臃肿,而且不便于以后其他人测试以及查看测试数据,用 ...

  6. 自定义类似MessageBox小窗体操作

    1.实际小窗体界面如下 2.代码如下 private void InputBox(string caption,string orderNo) { Form InputForm = new Form( ...

  7. iOS url中文编码

    有两种方法: 一,使用NSString的方法: NSString* string2 = [string1 stringByAddingPercentEscapesUsingEncoding:NSUTF ...

  8. Java常用的技术网站

    学习Java,我会去的网站: 1.开源项目网站:https://github.com/和http://www.codeproject.com/,可以在这里搜索到别人上传的一些代码和项目 2.咨询问题的 ...

  9. Eclipse 一些小知识

    快速查找未完成事项 eg: // TODO 通过模板格式化代码 Window --> Preferences --> Java --> Editor  --> Template ...

  10. 女生学Web前端优势往往很明显

    学Web前端的女生不算少数,女生学习的成果也往往不比男生差,前端偏向设计.交互和产品方向,需要更加贴合用户,女生心思细腻,对页面细节把控更好,更具美感,对用户心理把握更准,这样的优势往往是男生所不具备 ...