rt,使用 brew 安装的 nginx-full,用sudo brew services start
设置了自启,也确认了自启项加到了/Library/LaunchDaemons
,可每次电脑重启后还是访问不了 80 端口,8080 倒是正常。。非得手动sudo brew services restart
一下才行。。。
1
huijiewei 2017-05-05 19:34:01 +08:00 via iPhone
launchrocket
|
2
nan 2017-05-05 20:05:27 +08:00 via iPhone
使用 80 端口自启需要设置 bin/nginx 的权限和所有者,比如 chown root:wheel 和 chmod u+s
|
3
lyf362345 2017-05-05 20:55:54 +08:00 1
又是一个不认真看输出的
brew info nginx-full - Tips - Run port 80: $ sudo chown root:wheel /usr/local/opt/nginx-full/bin/nginx $ sudo chmod u+s /usr/local/opt/nginx-full/bin/nginx Reload config: $ nginx -s reload Reopen Logfile: $ nginx -s reopen Stop process: $ nginx -s stop Waiting on exit process $ nginx -s quit To have launchd start homebrew/nginx/nginx-full now and restart at login: brew services start homebrew/nginx/nginx-full Or, if you don't want/need a background service you can just run: nginx |
4
coa OP 可能乌龙了。。设置的反向代理没跑起来,所以直接就挂了,可是正常进入系统后 restart 下服务又能行,猜测会不会和启动时的联网状态有关。。不知道有没有办法等确认能够正常联网后才启动 nginx ?
正常的 80 端口可以访问了,感谢楼上各位。。。 |
5
lucifer9 2017-05-08 15:22:27 +08:00
就我一个理解错了 随机启动 的意思了么
|