Mac 命令行安装nginx

Posted on 2020-04-15 11:20  郑小胖  阅读(564)  评论(0编辑  收藏  举报

一. brew 安装

mac终端:ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"(需要VPN)

     或国内镜像 /bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

brew 升级命令:sudo brew update

 

二. nginx安装、启动

nginx安装:sudo brew install nginx

启动nginx服务:sudo brew services start nginx

重新启动nginx服务:sudo brew services restart nginx

关闭nginx服务:sudo brew services stop nginx

 

参考文章:https://blog.csdn.net/weixin_39788856/article/details/94540125
     https://zhuanlan.zhihu.com/p/111014448?utm_source=wechat_session&utm_medium=social&s_r=0