安装完nginx启动的时候报这个错误
[root@emq01 sbin]# ./nginx
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] still could not bind()

那是因为没有指定配置文件nginx.conf的地址
使用nginx -c的参数指定nginx.conf文件的位置
执行以下指令指定配置文件位置
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
再次启动nginx成功启动,执行停止和启动那些指令也不会报错了

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐