nginx 错误Failed to start The nginx HTTP and reverse proxy server.

nginx 错误Failed to start The nginx HTTP and reverse proxy server.


nginx 启动中可能会报以下错误,演示如下:

[centos@localhost nginx-1.16.1]$ :<<!
 启动 nginx
!
[centos@localhost nginx-1.16.1]$ sudo systemctl start nginx
Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.
[centos@localhost nginx-1.16.1]$ :<<!
 检查 nginx 状态
!
[centos@localhost nginx-1.16.1]$ sudo systemctl status nginx.service 
[sudo] centos 的密码:
● nginx.service - The nginx HTTP and reverse proxy server
   Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since 二 2020-04-21 11:27:49 CST; 13min ago
  Process: 68706 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=1/FAILURE)
  Process: 68702 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)

4月 21 11:27:49 localhost.localdomain systemd[1]: Starting The nginx HTTP and reverse proxy server...
4月 21 11:27:49 localhost.localdomain nginx[68706]: nginx: [emerg] module "/usr/lib64/nginx/modules/...f:1
4月 21 11:27:49 localhost.localdomain nginx[68706]: nginx: configuration file /etc/nginx/nginx.conf ...led
4月 21 11:27:49 localhost.localdomain systemd[1]: nginx.service: control process exited, code=exited...s=1
4月 21 11:27:49 localhost.localdomain systemd[1]: Failed to start The nginx HTTP and reverse proxy server.
4月 21 11:27:49 localhost.localdomain systemd[1]: Unit nginx.service entered failed state.
4月 21 11:27:49 localhost.localdomain systemd[1]: nginx.se
[centos@localhost nginx-1.16.1]$ :<<!
 查看 nginx 输出的错误
!
[centos@localhost nginx-1.16.1]$ sudo /usr/sbin/nginx

要查看输出的错误是什么?键入命令 /usr/sbin/nginx 运行即会显示明显的错误。一般是端口80被占用的错误,也有可能模块上(编译时)的错误。错误类型较多,需要逐个根据自己的错误情况进行解决。

此处给个报错例子,可能产生以下错误:

[centos@localhost ~]$ sudo /usr/sbin/nginx
[sudo] centos 的密码:
nginx: [emerg] module "/usr/lib64/nginx/modules/ngx_http_image_filter_module.so" is not binary compatible in /usr/share/nginx/modules/mod-http-image-filter.conf:1

此处的解决办法请参考我的另一篇博客:Nginx 添加第三方模块,出现 is not binary compatible in 错误的问题解决

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值