在mac下配置完apache和php环境后,通过localhost访问页面,出现403Forbidden。页面提示:

Forbidden

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

解决办法是修改/etc/apache/httpd.conf的配置  

1、打开终端

2、cd /etc/apache2  --切换到apache目录

3、sudo vim httpd.conf  --需要输入电脑密码

如果apache版本是2.2的话,应该这么写

<Directory "/Users/apple/Sites/">--/Users/apple/Sites是自己设置的apache指向的站点目录,默认是/Library/WebServer/Document
  Options Indexes MultiViews   
  AllowOverride All      # OSX 10.9 / Apache 2.2   
  Order from deny, allow   
</Directory>

如果apache版本是2.4的话,应该这么写

<Directory "/Users/apple/Sites/">--/Users/apple/Sites是自己设置的apache指向的站点目录,默认是/Library/WebServer/Document

  Options Indexes MultiViews

  AllowOverride All   
  # OSX 10.10 / Apache 2.4
  
  Require all granted   
</Directory>
参考博文链接:https://www.jianshu.com/p/7dd74c57d56c

Mac apache You don't have permission to access / on this server.的更多相关文章

  1. (转) 问题解决:Apache: You don't have permission to access / on this server

    问题解决:Apache: You don't have permission to access / on this server 转自:http://blog.csdn.net/crazyboy20 ...

  2. Apache: You don't have permission to access / on this server

    当我们需要使用Apache配置虚拟主机时,有可能会出现这个问题:Apache: You don't have permission to access / on this server # 同IP不同 ...

  3. 问题解决:Apache: You don't have permission to access / on this server

    虚拟主机(Virtual Host)是指在一个机器上运行多个网络站点 (比如:www.company1.com和www.company2.com). 如果每个网络站点拥有不同的IP地址,则虚拟主机可以 ...

  4. apache You don't have permission to access / on this server.无权访问

    环境:ubuntu16.4 apache2 原因:修改了apache web项目路径 解决: 1. 修改 /etc/apache2/sites-available/000-default.conf 文 ...

  5. Mac OS X中配置Apache后提示You don't have permission to access / on this server

    根据这篇博客http://www.cnblogs.com/snandy/archive/2012/11/13/2765381.html,在mac系统中,配置的apache,配置完成后,提示 You d ...

  6. mac osx下apache下的坑: you don’t have permission to access / on this server

    在Mac下Apache修改默认站点的目录时,遇到403错误, you don’t have permission to access / on this server 首先按照google到教程: 修 ...

  7. WampServer phpadmin apache You don't have permission to access

    1.Forbidden You don't have permission to access / on this server. 后来咨询了一下朋友(php高手),说修改一下php的配置文件http ...

  8. Apache提示You don't have permission to access / on this server问题解决

    测试时遇到将一本地目录设置为一apache的虚拟主机,在httpd-vhosts.conf文件中进行简单设置,然后在hosts文件中将访问地址指向本地,启动apache,进行访问,却出现了You do ...

  9. apache出现You don’t have permission to access / on this server问题的解决

    今天在部署一个系统时,在apache中新开了一个VirtualHost,然后设置了DocumentRoot,等访问时却提示“You don’t have permission to access / ...

随机推荐

  1. RMAN备份与恢复 —— 参数文件还原

         在RMAN用语中,“还原”与“恢复”具有不同的含义,还原(restore)是指访问先前生成的备份集,从中得到一个或多个对象,然后再磁盘上的某个位置还原这些对象.还原与恢复时分离的.恢复(re ...

  2. Ubuntu 安装 ansible

    sudo apt update sudo apt-get install software-properties-common sudo apt-add-repository --yes ppa:an ...

  3. SSH学习笔记(二)

    # 1. 关于 SSH Server 的整体设定,包含使用的 port 啦,以及使用的密码演算方式 Port 22 # SSH 预设使用 22 这个 port,您也可以使用多的 port ! # 亦即 ...

  4. hibernate.hbm.xml配置文件解析

    转自:https://www.cnblogs.com/uoar/p/6670612.html 1. <!DOCTYPE hibernate-mapping PUBLIC "-//Hib ...

  5. 云中沙箱学习笔记2-ECS之初体验

    1.1 背景知识 云服务器(Elastic Compute Service, 简称ECS),是一种简单高效,处理能力可以弹性伸缩的计算服务.ECS的相关术语说明如下: --实例(Instance):是 ...

  6. [转]Oracle 11g 基于CentOS7静默安装教程(无图形界面,远程安装) --有部份地方有问题

    Oracle 11g 基于CentOS7静默安装教程(无图形界面,远程安装) [转载]原文地址:http://canonind.blog.51cto.com/8239025/1883066 一.安装前 ...

  7. 调整notepad++的行距的方法

    notepad++是一款免费开源的文本编辑器,在windows平台上表现非常好,可以自定义的地方多,还支持主题导入,导出和切换,对各种语言的语法高亮支持也是在各大文本编辑器中名列前茅,插件库的内容也非 ...

  8. Angular Viewchild undefined

    Angular的viewchild在使用的时候报错 undefined 1 检查是否在元素上打上标识 #xxx 2 查看引用元素时的时机 是否在AfterViewInit之后 3 检查元素是否在*ng ...

  9. 神仙dcx出的一道题

    题目大意 \(\;\;\)在一个坐标系上, 以\((0, 0)\)为起点, 每走一步,可以从\((x,y)\)走到\((x+1,y),(x-1,y),(x,y+1),(x,y-1)\)中的一个点上, ...

  10. centos 6.5 安装 nginx

    从nginx官网下载安装包:nginx-1.8.1.tar.gz,解压 tar xvf nginx-1.8.1.tar.gz -C /usr/local 安装依赖 yum install gcc yu ...