Mac上搭建Web服务器

开启Apache


开启Web服务器的方法有两种:

  • 打开“系统设置偏好(System Preferences)” -> “共享(Sharing)” -> “Web共享(Web Sharing)”
  • 通过在terminal终端直接运行Apache的启动命令来打开:sudo apachectl start

启动后,我们在浏览器输入  http://localhost 会发现 


这里写图片描述


Apache服务器默认的web根目录在:/Library/WebServer/Documents 
Apache的配置文件在:/etc/apache2

猜你喜欢

转载自www.cnblogs.com/eliteboy/p/8970719.html