machttp文件服务器,Mac 安装Apache http 服务器

安装

brew install httpd

| ~ @ micodeMacBook-Pro (micocube)

| => brew install httpd

==> Downloading https://homebrew.bintray.com/bottles/httpd-2.4.29_1.high_sierra.

Already downloaded: /Users/micocube/Library/Caches/Homebrew/httpd-2.4.29_1.high_sierra.bottle.tar.gz

==> Pouring httpd-2.4.29_1.high_sierra.bottle.tar.gz

==> Caveats

DocumentRoot is /usr/local/var/www.

The default ports have been set in /usr/local/etc/httpd/httpd.conf to 8080 and in

/usr/local/etc/httpd/extra/httpd-ssl.conf to 8443 so that httpd can run without sudo.

To have launchd start httpd now and restart at login:

brew services start httpd

Or, if you don't want/need a background service you can just run:

apachectl start

==> Summary

🍺 /usr/local/Cellar/httpd/2.4.29_1: 1,625 files, 26MB

配置

注意安装时的输出信息

DocumentRoot is /usr/local/var/www.

The default ports have been set in /usr/local/etc/httpd/httpd.conf to 8080 and in

/usr/local/etc/httpd/extra/httpd-ssl.conf to 8443 so that httpd can run without sudo.

To have launchd start httpd now and restart at login:

brew services start httpd

Or, if you don't want/need a background service you can just run:

apachectl start

默认的工作路径是/usr/local/var/www,http配置文件在/usr/local/etc/httpd/httpd.conf向外暴露端口8080,https配置文件在/usr/local/etc/httpd/extra/httpd-ssl.conf向外暴露8443

如果需要在系统重启用户登陆的时候就启动httpd,可以执行brew services start httpd,如果你不想在后台执行httpd,可以执行apachectl start

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值