我非常想更新我的 nginx,但每次更新时,它都会崩溃,重新启动/启动时会出错。状态如下:
● nginx.service - nginx - high performance web server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2018-05-02 07:11:10 UTC; 2min 0s ago
Docs: http://nginx.org/en/docs/
Process: 1055 ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf (code=exited, status=1/FAILURE)
Main PID: 774 (code=exited, status=0/SUCCESS)
May 02 07:11:10 mixt4vps systemd[1]: Starting nginx - high performance web server...
May 02 07:11:10 mixt4vps nginx[1055]: nginx: [emerg] module "/usr/lib64/nginx/modules/ngx_http_geoip_module.so" version 1012002 instead of 1014000 in /usr/share/nginx/modules/mod-http-geoip.conf:1
May 02 07:11:10 mixt4vps systemd[1]: nginx.service: control process exited, code=exited status=1
May 02 07:11:10 mixt4vps systemd[1]: Failed to start nginx - high performance web server.
May 02 07:11:10 mixt4vps systemd[1]: Unit nginx.service entered failed state.
May 02 07:11:10 mixt4vps systemd[1]: nginx.service failed.
你们知道我该怎么办吗?我一直在恢复快照,但每次我尝试再次更新时,都会再次发生这种情况。
答案1
在 Debian 上暂时禁用 nginx 服务:sudo systemctl disable nginx
。然后升级软件包。如果需要,安装缺少的模块:例如:
sudo apt install libnginx-mod-http-passenger libnginx-mod-http-geoip libnginx-mod-http-image-filter libnginx-mod-mail libnginx-mod-stream-geoip
一旦所有东西都安装完毕,重新启用 nginx 服务并启动它:
sudo systemctl enable nginx; systemctl start nginx