Mac environment to build nginx server

Install a

1 Install Homebrew

  macOS missing package manager to install Reference official website. (May be a wall)

2 install nginx.

 brew install nginx

  First update homebrew, then install nginx dependencies, then install nginx, approximately wait a few minutes.

 

Two start

  nginx

  View in Browser

  

Three View / terminate the process

nginx after startup, to run in the background (daemons) in a manner daemon unix system, a background process contains a master process and multiple worker processes. 

ps -ef | grep nginx view the process

kill -9 process ID to terminate the process

 

Four commonly used commands

 nginx -v View version

 nginx -h Display help

 -s represents signal, send signal to the main process: stop, quit, reopen, reload

 nginx -s quit    elegant closed (first complete service opened connections)

 nginx -s stop fast closing

 

 quit and stop will stop nginx (using ps -ef | grep nginx, you will be found to have no primary process, work processes),

 

Guess you like

Origin www.cnblogs.com/sea-breeze/p/11014797.html