在Mac OSX上,默认的localhost文件夹位于/Library/WebServer/Documents
PS已通过MacOS Sierra 10.12.6测试
查找httpd.conf
默认情况下,Apache被启用并安装在httpd.conf
文件中的/etc/apache2/
,找到DocumentRoot
来告诉默认localhost文件夹在哪里。
sudo vim /etc/apache2/httpd.conf
# 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">
#...
</Directory>
参考文献
翻译自: https://mkyong.com/mac/mac-osx-where-is-default-localhost-folder/