Tutorial Nginx de instalação no Mac

1. Instale o nginx Primeiro instale o homebrew

1.  HomebrewÉ uma ferramenta de gerenciamento de pacotes que atualmente suporta macOSe linuxsistema

Instalar

/bin/bash -c "$(curl -fsSL https://gitee.com/ineo6/homebrew-install/raw/master/install.sh)"

Desinstalar (usar o script oficial também encontrará uninstallo problema de o endereço não poder ser acessado, você pode usar o seguinte script :)

/bin/bash -c "$(curl -fsSL https://gitee.com/ineo6/homebrew-install/raw/master/uninstall.sh)"

2. Configure variáveis ​​de ambiente

  Se for m1um chip, Macvocê precisa definir manualmente a variável de ambiente:

zsh:

echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"

festa:

echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.bash_profile
eval "$(/opt/homebrew/bin/brew shellenv)"

Para não- m1chip, você pode tentar adicionar variáveis ​​de ambiente manualmente:

zsh

echo 'eval "$(/usr/local/Homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/usr/local/Homebrew/bin/brew shellenv)"

festa

echo 'eval "$(/usr/local/Homebrew/bin/brew shellenv)"' >> ~/.bash_profile
eval "$(/usr/local/Homebrew/bin/brew shellenv)"

Dois, instale o nginx

1. Consulte se o software a ser instalado existe

brew search nginx  

2. Veja informações sobre a instalação do nginx

brew info nginx

 3. Instalar

brew install nginx

 Em seguida, insira o caminho do arquivo de configuração nginx através de open

Reabastecimento:

启动命令: nginx

快速停止命令 nginx -s stop

平稳退出命令:nginx -s quit

重新启动:nginx -s reload

重新加载配置文件命令:nginx -s reload

检查配置文件正确性:nginx -t

查询nginx主进程号:ps -ef | grep nginx

正常停止:kill -QUIT 主进程号

快速停止:kill -TERM 主进程号 /kill -INT 主进程号

强制停止:kill -9 主进程号

Acho que você gosta

Origin blog.csdn.net/qq_42717015/article/details/130098477
Recomendado
Clasificación