nginx-bind() to 0.0.0.0:80 failed (13: Permission denied)解决方法
nginx-bind() to 0.0.0.0:80 failed (13: Permission denied)解决方法
·
非root用户只能绑定大于等于1024的端口
解决方法1
以root用户启动nginx
查询80端口是否被占用,占用了kill进程再启动
查询80端口
netstat -aon | grep "80"
解决方法2
普通用户启动,需要修改权限
cd /usr/local/nginx/sbin/
chown root nginx
chmod u+s nginx
命令解释:
chown root nginx:将 nginx 文件的所有者设置为 root 用户。
chmod u+s nginx:为 nginx 文件设置 SUID 位,这意味着无论谁运行这个文件,它都会以文件所有者(即 root 用户)的身份运行。
更多推荐




所有评论(0)