解决mac下自定义apache 目录出现403的错误

博主的apache 自定义目录为:/Volumes/Volumes/Repo/Apache
首先打开/etc/apache2/httpd.conf,并且关闭 apache 服务器
sudo apachectl stop
找到DocumentRoot,按照下面配置修改配置文件,

#DocumentRoot "/Library/WebServer/Documents"
#<Directory "/Library/WebServer/Documents">

# 自定义 DocumentRoot 路径

DocumentRoot "/Volumes/Volumes/Repo/Apache"
<Directory "/Volumes/Volumes/Repo/Apache">
    Options FollowSymLinks Multiviews
    Options Indexes FollowSymLinks
    MultiviewsMatch Any
    Require all granted
</Directory>

<Directory />
    dexes FollowSymLinks
    AllowOverride None
    Order deny,allow
    Allow from all
</Directory>

然后在终端输入sudo chmod -R 755 /Volumes/Volumes/Repo/Apache
然后在开启 apache 服务器就不会初现404报错了
sudo apachectl start

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • 首先,先看一些Apache服务器的基础设置,他可以帮你在Ubuntu CentOS 和OSX下安装和配置一个apa...
    Brice_Zhao阅读 11,725评论 5赞 12
  • 手残升级了mac系统,结果php环境不能用了:sudo apachectl start访问 localhost ...
    abs1004阅读 5,021评论 0赞 4
  • 我们经常性的需要使用局域网搭建 Web 服务器测试环境,如部署局域网无线安装企业应用等,Mac OS X 自带了 ...
    大诗兄_zl阅读 1,865评论 0赞 2
  • 我能守住的世界很小,我向往的世界很大。 大四的我马上要毕业了,最近投递了一些简历面试了一些公司,然后就没有然后了。...
    畔池学子阅读 273评论 0赞 0
  • zzq,我喜欢你。 犹豫着要不要再等一段时间再向你告白,但一旦错过了这个早就给自己定下的最后期限,便很难再下定决定...
    吟游之狼阅读 370评论 0赞 0

友情链接更多精彩内容