nginx安装问题解决

一、nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
报错信息:
在这里插入图片描述
解决方案:
1.先使用ps -e | grep nginx查看是否已经启动了nginx

2.如果没有的话则按照提示,查看0.0.0.0:80端口谁占用了,使用netstat -ltunp命令,可以看到

可以看到0.0.0.0:80端口被httpd这个进程占用了(也就是apcache占用)
在这里插入图片描述
然后关闭httpd:

service httpd stop

二、 nginx: [error] open() “/usr/local/nginx/logs/nginx.pid” failed (2: No such file or directory)
在这里插入图片描述
解决方法:
1./usr/local/nginx/sbin/nginx -c/usr/local/nginx/conf/nginx.conf
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/songlldc/article/details/89645295
今日推荐