nginx 报错

来源:14-3 uwsgi配置文件方式启动以及代码更新后的重启

幕布斯9381828

2019-05-13

sudo service nginx restart 
Redirecting to /bin/systemctl restart nginx.service
Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.

systemctl status nginx.service               

● nginx.service - The nginx HTTP and reverse proxy server
   Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Mon 2019-05-13 17:15:38 CST; 7min ago
  Process: 24060 ExecStart=/usr/sbin/nginx (code=exited, status=1/FAILURE)
  Process: 24056 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=0/SUCCESS)
  Process: 24054 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)
ps aux | grep nginx                                                                                                    
root     23885  0.0  0.0 125100  2164 ?        Ss   16:57   0:00 nginx: master process /usr/sbin/nginx
nginx    23886  0.0  0.0 125620  3636 ?        S    16:57   0:00 nginx: worker process
nginx    23887  0.0  0.0 125620  3636 ?        S    16:57   0:00 nginx: worker process
yak      24099  0.0  0.0 112708   976 pts/7    S+   17:26   0:00 grep --color=auto nginx

图片描述

sudo /usr/sbin/nginx
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
nginx: [emerg] still could not bind()
写回答

1回答

bobby

2019-05-15

这里报错是说因为80端口被占用了。你是不是安装过其他的nginx或者安装过apache,导致这个端口被其他服务占用了?

0
0

Python3.6+django+xadmin,打造在线教育平台

【毕设】Python 2.7到3.6 完美适配,Django升级2.0

3677 学习 · 4041 问题

查看课程