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.