Mac启动Apache之后访问localhost提示403 Forbidden

来源:互联网 发布:ppt数据分析怎么做 编辑:程序博客网 时间:2024/05/16 19:03

最近学习PHP需要, 需要在Mac上启动Apache, 启动后出现访问localhost之后提示

ForbiddenYou don't have permission to access / on this server

网上百度了很多解决方法, 包括修改User Group, Directory块与新建{用户名}.conf, 都不管用.

最后试着恢复原先的设置, 并且将DocumentRoot与Directory路径修改会默认的路径:

## DocumentRoot: The directory out of which you will serve your# documents. By default, all requests are taken from this directory, but# symbolic links and aliases may be used to point to other locations.#DocumentRoot "/Library/WebServer/Documents/"<Directory "/Library/WebServer/Documents/">

终端: 停止Apache

sudo apachectl stop

终端: 启动Apache

sudo apachectl start

之后访问localhost, 成功!
访问域名

访问ip

阅读全文
0 0
原创粉丝点击