Failed to start SYSV: Nginx is an HTTP(S) server, HTTP(S) reverse proxy an...erver.

NGINX源码安装,第一次启动。报错
[root@test ~]# /etc/rc.d/init.d/nginx start
Starting nginx (via systemctl): Job for nginx.service failed because the control process exited with error code. See “systemctl status nginx.service” and “journalctl -xe” for details.
[失败]
[root@test ~]# systemctl status nginx.service
● nginx.service - SYSV: Nginx is an HTTP(S) server, HTTP(S) reverse proxy and IMAP/POP3 proxy server
Loaded: loaded (/etc/rc.d/init.d/nginx)
Active: failed (Result: exit-code) since 三 2019-07-24 11:10:54 CST; 41s ago
Docs: man:systemd-sysv-generator(8)
Process: 2977 ExecStart=/etc/rc.d/init.d/nginx start (code=exited, status=1/FAILURE)

7月 24 11:10:52 test nginx[2977]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
7月 24 11:10:53 test nginx[2977]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
7月 24 11:10:53 test nginx[2977]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
7月 24 11:10:54 test nginx[2977]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
7月 24 11:10:54 test nginx[2977]: nginx: [emerg] still could not bind()
7月 24 11:10:54 test nginx[2977]: [失败]
7月 24 11:10:54 test systemd[1]: nginx.service: control process exited, code=exited status=1
7月 24 11:10:54 test systemd[1]: Failed to start SYSV: Nginx is an HTTP(S) server, HTTP(S) reverse proxy an…erver.
7月 24 11:10:54 test systemd[1]: Unit nginx.service entered failed state.
7月 24 11:10:54 test systemd[1]: nginx.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
[root@test ~]# systemctl start nginx
Job for nginx.service failed because the control process exited with error code. See “systemctl status nginx.service” and “journalctl -xe” for details.
解决路程:
一直查
Failed to start SYSV: Nginx is an HTTP(S) server, HTTP(S) reverse proxy an…erver.报错
https://www.cnblogs.com/taui/p/6197045.html
kill niginx进程,还是不行
后来,发现
nginx: [emerg] still could not bind()*
就查了下
https://blog.csdn.net/u013344860/article/details/83988584
尝试就解决啦
1、mount镜像
2、yum search netstat
3、查看80占用端口
4、杀死进程(kill -9 不行),我是用的killall httpd
5、可以启动啦

ps:操作
已安装:
net-tools.x86_64 0:2.0-0.17.20131004git.el7

完毕!
[root@test init.d]# netstat -ntlp | grep 80
tcp6 0 0 :::80 ::? LISTEN 1186/httpd
[root@test init.d]# kill -9 7043
-bash: kill: (7043) - 没有那个进程
[root@test init.d]# kill -9 1186
[root@test init.d]# netstat -ntlp | grep 80
tcp6 0 0 :::80 ::? LISTEN 1829/httpd
[root@test init.d]# kill -9 1829
[root@test init.d]# netstat -ntlp | grep 80
tcp6 0 0 :::80 ::? LISTEN 1830/httpd
[root@test init.d]# killall httpd
[root@test init.d]# netstat -ntlp | grep 80
[root@test init.d]# /etc/rc.d/init.d/nginx start
Starting nginx (via systemctl): [ 确定 ]

你可能感兴趣的:(linux)