mac web 服务

我们经常性的需要使用局域网搭建 Web 服务器测试环境,如部署局域网无线安装企业应用等,Mac OS X 自带了 Apache 和 PHP 环境,我们只需要简单的启动它就行了。

启动 Apache

查看 Apache 版本

打开终端,输入httpd -v可以查看 Apache 版本信息。

$ httpd -v

Server version: Apache/2.4.16 (Unix)

Server built:  Aug 22 2015 16:51:57

$

启动 Apache

在终端输入sudo apachectl start即可启动 Apache。


那么 Apache 就启动成功了,站点的根目录为系统级根目录/Library/WebServer/Documents。

启动后,你可以通过编辑/etc/apache2/httpd.conf文件来修改 Apache 配置。

停止 Apache:sudo apachectl stop

重启 Apache:sudo apachectl restart

作者:小白不是总

链接:http://www.jianshu.com/p/d006a34a343f

來源:

著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

你可能感兴趣的:(mac web 服务)