您的位置:首页 > 运维架构 > Apache

how-to setup apache on mac

2013-04-26 09:25 447 查看
在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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: