我在 Debian 上运行 Plesk 因为我大约 6 个月前安装了 Plesk,每次重新启动服务器时 nginx 都无法在启动时启动,我必须手动重新启动它。今天我需要再次重新启动服务器,但这一次我什至无法手动重新启动 nginx。
我明白了:
Starting nginx (via systemctl): nginx.serviceJob for nginx.service failed.
See 'systemctl status nginx.service' and 'journalctl -xn' for details.
failed!
systemctl status nginx.service 返回:
● nginx.service - Startup script for nginx service
Loaded: loaded (/lib/systemd/system/nginx.service; enabled)
Active: failed (Result: exit-code) since Wed 2016-03-09 23:00:15 MST; 25min ago
Process: 4723 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=1/FAILURE)
Process: 4720 ExecStartPre=/usr/bin/test $NGINX_ENABLED = yes (code=exited, status=0/SUCCESS)
Mar 09 23:00:15 fineartschool.net nginx[4723]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
Mar 09 23:00:15 fineartschool.net nginx[4723]: nginx: [emerg] bind() to 64.4.6.100:80 failed (99: Cannot assign requested address)
Mar 09 23:00:15 fineartschool.net nginx[4723]: nginx: configuration file /etc/nginx/nginx.conf test failed
Mar 09 23:00:15 fineartschool.net systemd[1]: nginx.service: control process exited, code=exited status=1
Mar 09 23:00:15 fineartschool.net systemd[1]: Failed to start Startup script for nginx service.
Mar 09 23:00:15 fineartschool.net systemd[1]: Unit nginx.service entered failed state.
日志 -xn 读取
-- Logs begin at Wed 2016-03-09 22:49:30 MST, end at Wed 2016-03-09 23:10:01 MST. --
Mar 09 23:05:01 fineartschool.net CRON[6067]: pam_unix(cron:session): session closed for user root
Mar 09 23:09:01 fineartschool.net CRON[7188]: pam_unix(cron:session): session opened for user root by (uid=0)
Mar 09 23:09:01 fineartschool.net CRON[7189]: (root) CMD ( [ -x /usr/lib/php5/sessionclean ] && /usr/lib/php5/sessionclean)
Mar 09 23:09:01 fineartschool.net CRON[7188]: pam_unix(cron:session): session closed for user root
Mar 09 23:09:47 fineartschool.net CRON[4606]: pam_unix(cron:session): session closed for user root
Mar 09 23:10:01 fineartschool.net CRON[7505]: pam_unix(cron:session): session opened for user root by (uid=0)
Mar 09 23:10:01 fineartschool.net CRON[7506]: pam_unix(cron:session): session opened for user root by (uid=0)
Mar 09 23:10:01 fineartschool.net CRON[7507]: (root) CMD (/opt/psa/admin/bin/php -dauto_prepend_file=sdk.php '/opt/psa/admin/plib/modules/magicspam/script|
Mar 09 23:10:01 fineartschool.net CRON[7508]: (root) CMD (/opt/psa/admin/bin/php -dauto_prepend_file=sdk.php '/opt/psa/admin/plib/modules/plesk-mobile/scr
Mar 09 23:10:01 fineartschool.net CRON[7505]: pam_unix(cron:session): session closed for user root
和 nginx 错误日志
2016/03/09 22:28:57 [emerg] 952#0: bind() to 64.4.6.100:80 failed (99: Cannot assign requested address)
2016/03/09 22:31:14 [emerg] 2675#0: bind() to 64.4.6.100:80 failed (99: Cannot assign requested address)
2016/03/09 22:34:56 [emerg] 914#0: bind() to 64.4.6.100:80 failed (99: Cannot assign requested address)
2016/03/09 22:38:36 [emerg] 2670#0: bind() to 64.4.6.100:80 failed (99: Cannot assign requested address)
2016/03/09 22:39:26 [emerg] 941#0: bind() to 64.4.6.100:80 failed (99: Cannot assign requested address)
2016/03/09 22:42:17 [emerg] 2795#0: bind() to 64.4.6.100:80 failed (99: Cannot assign requested address)
2016/03/09 22:42:32 [emerg] 2912#0: bind() to 64.4.6.100:80 failed (99: Cannot assign requested address)
2016/03/09 22:46:17 [emerg] 4026#0: bind() to 64.4.6.100:80 failed (99: Cannot assign requested address)
2016/03/09 22:46:26 [emerg] 4092#0: bind() to 64.4.6.100:80 failed (99: Cannot assign requested address)
2016/03/09 22:49:49 [emerg] 795#0: bind() to 64.4.6.100:80 failed (99: Cannot assign requested address)
2016/03/09 22:52:31 [emerg] 2517#0: bind() to 64.4.6.100:80 failed (99: Cannot assign requested address)
2016/03/09 23:00:15 [emerg] 4723#0: bind() to 64.4.6.100:80 failed (99: Cannot assign requested address)
任何帮助将不胜感激!
提前致谢!
答案1
嗯,这很尴尬。因此,在查看重复出现的模式“(99:无法分配请求的地址)”之后,我决定查看分配 IP 地址的服务器,结果发现它没有获取静态 IP 地址,而是获取了动态 IP 地址。
更正此问题后,我能够重新启动 nginx。希望其他人能够从中受益。