在10.8以后, 需要
1. nano /etc/apache2/users/pengcheng.conf
在其中加入, 其中pengcheng/Sites这个文件夹如果不存在, 可以自行建立.
<Directory "/Users/pengcheng/Sites/">
Options Indexes Multiviews
AllowOverride AuthConfig Limit
Order allow,deny
Allow from all
</Directory>
2.
sudo apachectl start
3. 这时如果apache运行正常, 应该可以访问 http://127.0.0.1/, 返回it works.
4. 想要暴露的东西放在/Users/pengcheng/Sites下, 比如/Users/pengcheng/Sites/folder1/text1.txt
那么可以访问http://127.0.0.1/~pengcheng/folder1/text1.txt
本文介绍如何在MacOS系统上配置Apache服务器,使其实现特定目录的文件服务,并通过本地IP地址进行访问。主要内容包括编辑Apache配置文件、启动服务及验证访问。
1626

被折叠的 条评论
为什么被折叠?



