美文网首页
MacOS安装nginx,启动、重启、关闭

MacOS安装nginx,启动、重启、关闭

作者: _灯火阑珊处 | 来源:发表于2019-08-19 15:37 被阅读0次

brew install nginx


Docroot is: /usr/local/var/www

The default port has been set in /usr/local/etc/nginx/nginx.conf to 8080 so that
nginx can run without sudo.

nginx will load all files in /usr/local/etc/nginx/servers/.

To have launchd start nginx now and restart at login:
brew services start nginx
Or, if you don't want/need a background service you can just run:
nginx


nginx配置文件目录:
/usr/local/etc/nginx/nginx.conf

启动nginx:
ngxin

重启nginx:
nginx -s reload

关闭/停止nginx:
先查询nginx对应端口号
ps -ef | grep nginx
501 53536 1 0 3:34下午 ?? 0:00.00 nginx: master process nginx
501 53569 53536 0 3:36下午 ?? 0:00.00 nginx: worker process
501 53611 52121 0 3:38下午 ttys000 0:00.00 grep nginx
kill nginx: master 端口号,即53536
kill -QUIT 53536

相关文章

网友评论

      本文标题:MacOS安装nginx,启动、重启、关闭

      本文链接:https://www.haomeiwen.com/subject/zizssctx.html