Mac Os自带Apache修改自定义项目配置报403 Forbidden, You don't have permission to access/on this server解决
2017-04-25 22:56
806 查看
Mac OS X 系统已经集成了 Apache+PHP 环境,依次进入“系统偏好设置 -> 共享” ,开启“Web 共享”,就可以打开 Apache。
但新版的 Mac OS X 中,苹果取消了这个共享功能的图形界面,只能从命令行开启。
2
在终端里输入命令,启动 Apache: sudo apachectl start
关闭 Apache: sudo apachectl stop
重启 Apache:sudo apachectl restart
查看 Apache 版本:httpd -v
Mac OS X 10.9.X 中的 Apache 版本信息:
Server version: Apache/2.2.26 (Unix) Server built: Dec 10 2013 22:09:38
3
启用 Apache 之后,在浏览器中访问 http://localhost 或 http://127.0.0.1,如果出现“It works!”就表示运行正常。
以上内容来自http://jingyan.baidu.com/article/0aa22375b553a488cc0d64b5.html ,
不过我在修改/etc/apache2/httpd.conf配置,将默认的项目路径由 /Library/WebServer/Documents/ 都替换成自己的路径,比如 /Users/juliana/myphpspace
重启apache后,报403 Forbidden,You don't have permission to access/on this server ,解决方案:
1).将#<Directory />
# AllowOverride none
# Require all denied
#</Directory>
改为:<Directory />
Options Indexes FollowSymLinks
AllowOverride None
Order deny,allow
Allow from all
</Directory>
2).将AllowOverride None改为AllowOverride
All
DocumentRoot "/Users/juliana/newsp/testing/Test/www"
<Directory "/Users/juliana/newsp/testing/Test/www">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options # for more information.
#
Options FollowSymLinks Multiviews
MultiviewsMatch Any
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
# AllowOverride None
AllowOverride All
#
# Controls who can get stuff from this server.
#
Require all granted
</Directory>
然后重启apache服务器,就正常了!
但新版的 Mac OS X 中,苹果取消了这个共享功能的图形界面,只能从命令行开启。
2
在终端里输入命令,启动 Apache: sudo apachectl start
关闭 Apache: sudo apachectl stop
重启 Apache:sudo apachectl restart
查看 Apache 版本:httpd -v
Mac OS X 10.9.X 中的 Apache 版本信息:
Server version: Apache/2.2.26 (Unix) Server built: Dec 10 2013 22:09:38
3
启用 Apache 之后,在浏览器中访问 http://localhost 或 http://127.0.0.1,如果出现“It works!”就表示运行正常。
以上内容来自http://jingyan.baidu.com/article/0aa22375b553a488cc0d64b5.html ,
不过我在修改/etc/apache2/httpd.conf配置,将默认的项目路径由 /Library/WebServer/Documents/ 都替换成自己的路径,比如 /Users/juliana/myphpspace
重启apache后,报403 Forbidden,You don't have permission to access/on this server ,解决方案:
1).将#<Directory />
# AllowOverride none
# Require all denied
#</Directory>
改为:<Directory />
Options Indexes FollowSymLinks
AllowOverride None
Order deny,allow
Allow from all
</Directory>
2).将AllowOverride None改为AllowOverride
All
DocumentRoot "/Users/juliana/newsp/testing/Test/www"
<Directory "/Users/juliana/newsp/testing/Test/www">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options # for more information.
#
Options FollowSymLinks Multiviews
MultiviewsMatch Any
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
# AllowOverride None
AllowOverride All
#
# Controls who can get stuff from this server.
#
Require all granted
</Directory>
然后重启apache服务器,就正常了!
相关文章推荐
- 解决 403 Forbidden You don't have permission to access / on this server
- Apache 403 Forbidden:You don't have permission to access / on this server.
- Apache配置问题Forbidden You don't have permission to access / on this server
- 访问 apache 显示 Forbidden You don't have permission to access /index.html on this server. 解决方法
- php多站点配置以及Forbidden You don't have permission to access / on this server问题解决
- CentOS 7.4 解决 403 Forbidden : You don't have permission to access / on this server
- Apache 403 Forbidden:You don't have permission to access / on this server.
- apache 403异常 You don't have permission to access on this server
- WampSever 远程访问出现Forbidden You don’t have permission to access / on this server.解决方法
- apache 403错误 显示如下: You don't have permission to access / on this server. 解决办法
- localhost访问错误Forbidden You don't have permission to access / on this server.解决办法(亲测)
- apache默认配置 访问目录403错误 出现You don't have permission to access / on this server
- You don\'t have permission to access /test.php on this server.怎样解决Forbidden
- apache出现You don’t have permission to access / on this server问题的解决
- Apache刚装好重启出现You don't have permission to access / on this server. 错误的解决办法
- Wamp下的虚拟主机报错403 Forbidden, You don't have permission to access / on this server.
- apache 问题 You don't have permission to access /test.php on this server 解决方法
- apache问题you don't have permission to access / on this server如何解决
- Apache提示You don't have permission to access / on this server问题解决
- 403 forbidden you don’t have permission to access / on this server