服务无法启动:nginx.service failed because the control process exited

$ systemctl status nginx.service
nginx.service - Startup script for nginx service
   Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Tue 2016-03-08 13:23:35 GMT; 2min 20s ago

Mar 08 13:23:33 startdedicated.com nginx[8315]: nginx: [emerg] bind() to ------------ f...e)
Mar 08 13:23:33 startdedicated.com nginx[8315]: nginx: [emerg] bind() to ----- f...e)
Mar 08 13:23:34 startdedicated.com nginx[8315]: nginx: [emerg] bind() to ----- f...e)
Mar 08 13:23:34 startdedicated.com nginx[8315]: nginx: [emerg] bind() to ----- f...e)
Mar 08 13:23:35 startdedicated.com nginx[8315]: nginx: [emerg] bind() to ----- f...e)
Mar 08 13:23:35 .startdedicated.com nginx[8315]: nginx: [emerg] still could not bind()
Mar 08 13:23:35 startdedicated.com systemd[1]: nginx.service: control process exited, code=...=1
Mar 08 13:23:35 startdedicated.com systemd[1]: Failed to start Startup script for nginx service.
Mar 08 13:23:35 startdedicated.com systemd[1]: Unit nginx.service entered failed state.
Mar 08 13:23:35 startdedicated.com systemd[1]: nginx.service failed.

这是由于端口被占用,需要kill掉

sudo fuser -k 80/tcp
sudo fuser -k 443/tcp

最后再重启

sudo service nginx restart

Post Comment