Nginx本地项目启动日记

啊哈哈哈哈哈哈

首先在mac中安装brew,通过它来安装nginx

brew install nginx
  • 安装成功后 对应如下几个命令行
nginx  #启动nginx
nginx -s quit  #快速停止nginx
nginx -V #查看版本,以及配置文件地址
nginx -v #查看版本
nginx -s reload|reopen|stop|quit   #重新加载配置|重启|快速停止|安全关闭nginx
nginx -h #帮助
nginx安装文件目录
open   /usr/local/Cellar/nginx
nginx配置文件目录
open  /usr/local/etc/nginx
config文件目录
open  /usr/local/etc/nginx/nginx.conf
系统hosts位置
open  /private/etc/hosts

如果报如下的错误,表示你没有权限,加上 sudo 便可

Nginx启动报错:could not open error log file: open() "/usr/local/nginx/logs/error.log" failed

如果发现安装成功了能打印版本但是依旧不能运行,尝试找到 cd 到 nginx下运行

posted @ 2020-08-16 15:36  小数  阅读(831)  评论(0编辑  收藏  举报