1. 打开终端,开启Apache:

//开启apache: sudo apachectl start

//重启apache: sudo apachectl restart

//关闭apache: sudo apachectl stop

回车会提示输入密码,也就是你电脑的密码,http://127.0.0.1/测试一下,成功则如下图:

MAC:本地服务器

2. 点击Finder,然后Command+Shift+G,前往如下路径(mac下Apache服务器的文件路径)

/Library/WebServer/Documents

MAC:本地服务器

3.以后就可以通过IP访问本地的东西了(注:不用的时候记得关闭)

本地IP:设置->网络->Tcp/Ip

 

 

相关文章: