Mac开启自带的Apache服务器


OSX版本10.13.6

1、开启 sudo apachectl start

2、关闭 sudo apachectl stop

3、重启 sudo apachectl restart

默认的Apache的文件的根目录在/Library/WebServer/Documents,我们可以修改/etc/apache2/httpd.conf文件里面的DocumentRoot的值,修改更目录的路径, DocumentRoot 下面的那个值也需要修改成你的更目录。

修改/etc/apache2/httpd.conf,把Options FollowSymLinks Multiviews改成Options Indexes FollowSymLinks Multiviews

注意:当新的更目录不在/User/你的用户名/文件夹下面的话,会出现没有:Forbidden 403 错误,You don't have permission to access /on this server.

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM