nginx服务常用操作
#查看nginx服务状态
systemctl status nginx.service
#启动nginx服务
systemctl start nginx.service
#停止nginx服务
systemctl stop nginx.service
#重启nginx服务
systemctl restart nginx.service
#重新读取nginx配置(这个最常用, 不用停止nginx服务就能使修改的配置生效)
systemctl reload nginx.service
启动nginx报错:Failed to start The nginx HTTP and reverse proxy server
文章来源:https://www.toymoban.com/news/detail-549076.html
对于报错的描述是Address already in use,说明端口被占用:
Jun 01 09:54:24 cloud-codec-test-1cd7f2e4d.qiyi.virtual nginx[47909]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Jun 01 09:54:24 cloud-codec-test-1cd7f2e4d.qiyi.virtual nginx[47909]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Jun 01 09:54:25 cloud-codec-test-1cd7f2e4d.qiyi.virtual nginx[47909]: nginx: [emerg] bind() to 0.0.0.0:8900 failed (98: Address already in use)
Jun 01 09:54:25 cloud-codec-test-1cd7f2e4d.qiyi.virtual nginx[47909]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Jun 01 09:54:25 cloud-codec-test-1cd7f2e4d.qiyi.virtual nginx[47909]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
查看被占用端口:
文章来源地址https://www.toymoban.com/news/detail-549076.html
kill占用端口:kill -9 49147
重新启动nginx,成功
到了这里,关于Failed to start The nginx HTTP and reverse proxy server的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!