nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
·
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied) 这个是因为80 端口要root 用户才能启动,网上都说要root 账号。。。没一个好用的,后来想了下只要让非root用户使用80端口就可以了。
解决办法如下:
# 给指定程序设置 CAP_NET_BIND_SERVICE 能力
$ setcap cap_net_bind_service=+eip /path/to/application
测试如下:
# sudo setcap cap_net_bind_service=+eip /usr/local/nginx/sbin/nginx
再启动nginx 就ok了。
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
更多推荐
已为社区贡献3条内容
所有评论(0)