打开终端,开启Apache:
-
开启apache: sudo apachectl start
-
重启apache: sudo apachectl restart
-
关闭apache: sudo apachectl stop
-
可以打开http://127.0.0.1/测试一下,如果开启成功页面会出现“It works!”。
-
使用过后,记得关闭服务器,要不然会一直消耗你电脑内存,后果你懂的。
找到文件所在位置
- 点击Finder,然后Command+Shift+G,输入“/Library/WebServer/Documents“(mac下Apache服务器的文件路径)。
- http://127.0.0.1其实默认打开的是index.html.en。