2.mac版安装步骤

2.1 安装homebrew

2.1.1 $ brew -v

查看是否正确安装,括号内有内容

注: homebrew没安装成功的可以执行下面命令:$ xcode-select --install。

xcode安装后,可以再次查看版本,一般就会显示有git内容了,然后可以执行下一步;如果还没有内容,可以执行 ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"命令安装homebrew

mac安装homebrew和nginx

2.1.2 $ brew update

注:若无反应可进行切换镜像,可更换镜像,清华大学的镜像:https://mirrors.tuna.tsinghua...

mac安装homebrew和nginx

2.2 安装nginx

2.2.1 $ brew search nginx

未正确安装homebrew执行这个命令是这样的:

mac安装homebrew和nginx

正确安装homebrew后执行命令:

mac安装homebrew和nginx

2.2.2 $ brew install nginx

mac安装homebrew和nginx

2.2.3 $ nginx -v 查看nginx版本

mac安装homebrew和nginx

2.3 nginx启动运行关闭

查看nginx信息:$ brew info nginx

启动nginx:$ nginx 访问网址:http://localhost:8080

重启nginx:$ nginx -s reload

关闭nginx:$ ps -ef|grep nginx

mac安装homebrew和nginx

mac安装homebrew和nginx

参考:

mac安装nginx https://segmentfault.com/a/1190000019294492

相关文章:

  • 2022-01-20
  • 2021-05-25
  • 2021-05-02
  • 2021-06-25
猜你喜欢
  • 2021-10-29
  • 2022-12-23
  • 2022-12-23
  • 2021-11-23
  • 2021-08-22
  • 2021-12-03
  • 2022-02-12
相关资源
相似解决方案