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下运行


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM