Ubuntu系统中Nginx无法开机自动启动问题求助
各位大佬好,我最近在折腾本地的Nginx多流服务器,别的功能都搞定了,唯独开机自启这块卡壳了,想请大家帮我看看问题出在哪。
目前的情况是这样的:
- Nginx本身是能正常运行的,我手动执行
sudo service nginx start之后,服务器运行完全没问题,多流功能也正常工作 - 我照着网上的教程,执行了
sudo systemctl enable nginx来开启开机自启,命令显示执行成功了,但每次Ubuntu开机的时候,Nginx就是不自动启动 - 开机之后手动执行
sudo systemctl start nginx或者service nginx start,都能正常启动服务,用sudo systemctl status nginx也能确认服务处于正常运行状态,就是没法跟着系统开机自动跑起来
我查了journalctl -xeu nginx.service的启动日志,关键错误信息如下:
-- 单元 nginx.service 已开始启动
[系统时间戳] ubuntu systemd[1]: Starting A high performance web server and a reverse proxy server...
[系统时间戳] ubuntu nginx[具体进程号]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
[系统时间戳] ubuntu nginx[具体进程号]: nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
[系统时间戳] ubuntu nginx[具体进程号]: nginx: [emerg] still could not bind()
[系统时间戳] ubuntu systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
[系统时间戳] ubuntu systemd[1]: nginx.service: Failed with result 'exit-code'.
[系统时间戳] ubuntu systemd[1]: Failed to start A high performance web server and a reverse proxy server.
备注:内容来源于stack exchange,提问作者Martin Mac

