nginx更新启动不了

it2023-06-26  79

1.更新了一下nginx,发现启动不了

[root@pc1 //]# systemctl status nginx ● nginx.service - nginx - high performance web server Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; vendor preset: disabled) Active: failed (Result: exit-code) since Sun 2020-10-18 21:18:47 CST; 1 day 19h ago Docs: http://nginx.org/en/docs/ Oct 18 21:18:47 pc1 systemd[1]: Starting nginx - high performance web server... Oct 18 21:18:47 pc1 nginx[28222]: nginx: [emerg] module "/usr/lib64/nginx/modules/ngx_http_image_filter_module.so" version 1016001 instead of 1012002 in /usr/share/nginx/modules/mod-http-image-filter.conf:1 Oct 18 21:18:47 pc1 nginx[28222]: nginx: configuration file /etc/nginx/nginx.conf test failed Oct 18 21:18:47 pc1 systemd[1]: nginx.service: control process exited, code=exited status=1 Oct 18 21:18:47 pc1 systemd[1]: Failed to start nginx - high performance web server. Oct 18 21:18:47 pc1 systemd[1]: Unit nginx.service entered failed state. Oct 18 21:18:47 pc1 systemd[1]: nginx.service failed. [root@pc1 //]# 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. [root@pc1 //]# journalctl -xe|grep nginx Oct 20 17:08:50 pc1 systemd[1]: Starting nginx - high performance web server... -- Subject: Unit nginx.service has begun start-up -- Unit nginx.service has begun starting up. Oct 20 17:08:51 pc1 nginx[32537]: nginx: [emerg] module "/usr/lib64/nginx/modules/ngx_http_image_filter_module.so" version 1016001 instead of 1012002 in /usr/share/nginx/modules/mod-http-image-filter.conf:1 Oct 20 17:08:51 pc1 nginx[32537]: nginx: configuration file /etc/nginx/nginx.conf test failed Oct 20 17:08:51 pc1 systemd[1]: nginx.service: control process exited, code=exited status=1 Oct 20 17:08:51 pc1 systemd[1]: Failed to start nginx - high performance web server. -- Subject: Unit nginx.service has failed -- Unit nginx.service has failed. Oct 20 17:08:51 pc1 systemd[1]: Unit nginx.service entered failed state. Oct 20 17:08:51 pc1 systemd[1]: nginx.service failed.

2.这个原因是因为以前nginx modules 和现在官方的modules 不匹配需要我们先将旧的modules 卸载安装新版官方的modules

命令:

yum remove nginx-mod* yum install nginx-module-* systemctl restart nginx

解决~~~

最新回复(0)