无法在centos 7上启动nginx

林诺布
service nginx start
Redirecting to /bin/systemctl start  nginx.service
Job for nginx.service failed. See 'systemctl status nginx.service' and 'journalctl -xn' for details.

[root@myvps ~]# systemctl status nginx.service
nginx.service - The nginx HTTP and reverse proxy server
   Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled)
   Active: failed (Result: exit-code) since Tue 2014-12-23 03:48:02 EST; 10s ago
  Process: 19895 ExecStart=/usr/sbin/nginx (code=exited, status=1/FAILURE)
  Process: 19892 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=0/SUCCESS)

Dec 23 03:48:00 myvps nginx[19892]: nginx: configuration file /etc/nginx...ul
Dec 23 03:48:00 myvps nginx[19895]: nginx: [emerg] bind() to 0.0.0.0:80 ...e)
Dec 23 03:48:00 myvps nginx[19895]: nginx: [emerg] bind() to 0.0.0.0:80 ...e)
Dec 23 03:48:01 myvps nginx[19895]: nginx: [emerg] bind() to 0.0.0.0:80 ...e)
Dec 23 03:48:01 myvps nginx[19895]: nginx: [emerg] bind() to 0.0.0.0:80 ...e)
Dec 23 03:48:02 myvps nginx[19895]: nginx: [emerg] bind() to 0.0.0.0:80 ...e)
Dec 23 03:48:02 myvps nginx[19895]: nginx: [emerg] still could not bind()
Dec 23 03:48:02 myvps systemd[1]: nginx.service: control process exited,...=1
Dec 23 03:48:02 myvps systemd[1]: Failed to start The nginx HTTP and rev...r.
Dec 23 03:48:02 myvps systemd[1]: Unit nginx.service entered failed state.
Hint: Some lines were ellipsized, use -l to show in full.

[root@myvps ~]# journalctl -xn
-- Logs begin at Mon 2014-12-22 15:26:47 EST, end at Tue 2014-12-23 03:48:02 EST
Dec 23 03:48:00 myvps nginx[19892]: nginx: configuration file /etc/nginx/ngin
Dec 23 03:48:00 myvps nginx[19895]: nginx: [emerg] bind() to 0.0.0.0:80 faile
Dec 23 03:48:00 myvps nginx[19895]: nginx: [emerg] bind() to 0.0.0.0:80 faile
Dec 23 03:48:01 myvps nginx[19895]: nginx: [emerg] bind() to 0.0.0.0:80 faile
Dec 23 03:48:01 myvps nginx[19895]: nginx: [emerg] bind() to 0.0.0.0:80 faile
Dec 23 03:48:02 myvps nginx[19895]: nginx: [emerg] bind() to 0.0.0.0:80 faile
Dec 23 03:48:02 myvps nginx[19895]: nginx: [emerg] still could not bind()
Dec 23 03:48:02 myvps systemd[1]: nginx.service: control process exited, code
Dec 23 03:48:02 myvps systemd[1]: Failed to start The nginx HTTP and reverse 
-- Subject: Unit nginx.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit nginx.service has failed.
-- 
-- The result is failed.
Dec 23 03:48:02 myvps systemd[1]: Unit nginx.service entered failed state.

/lib/systemd/system/nginx-service

[Unit]
Description=The nginx HTTP and reverse proxy server
After=syslog.target network.target remote-fs.target nss-lookup.target

    [Service]
    Type=forking
    PIDFile=/run/nginx.pid
    ExecStartPre=/usr/sbin/nginx -t
    ExecStart=/usr/sbin/nginx
    ExecReload=/bin/kill -s HUP $MAINPID
    ExecStop=/bin/kill -s QUIT $MAINPID
    PrivateTmp=true

    [Install]
    WantedBy=multi-user.target

nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN      17005/mysqld        
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      769/sshd            
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      772/sendmail: accep 
tcp6       0      0 :::80                   :::*                    LISTEN      1373/httpd          
tcp6       0      0 :::22                   :::*                    LISTEN      769/sshd            

我使用Epel 7.5在我的centos 7 64位上安装了nginx-1.6.2-4.el7.x86_64

克里斯·戴维森

正如@masegaloeh所说,您还有另一个进程正在监听端口80,在本例中为httpd。您需要先停止该服务(并且可能想在启动时将其禁用)。

停止Apache;

systemctl stop httpd

要停止Apache引导启动;

systemctl disable httpd

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

无法在CentOS 7上启动MongoDB 3.2.1

来自分类Dev

无法在CentOS 7上启动Postgresql服务

来自分类Dev

通过厨师在Centos 7上重新启动Nginx服务

来自分类Dev

CentOS 7 USB无法启动

来自分类Dev

CentOS 7 MongoDB无法启动

来自分类Dev

Varnish 4.0.1无法在CentOS 7上启动-Selinux问题

来自分类Dev

无法在CentOS 7上启动MongoDB 3.0.2服务

来自分类Dev

无法在centos 7服务器上启动Elasticsearch

来自分类Dev

dnsmasq无法在CentOS 7上启动dhcp服务器

来自分类Dev

NGinX无法在CentOS 7上连接到Jenkins

来自分类Dev

无法启动CentOS

来自分类Dev

Centos:VSFTPD无法启动

来自分类Dev

无法在centos 7中启动设置?

来自分类Dev

远程安装CentOS 7(VNC)-无法启动

来自分类Dev

Elasticsearch无法在centos上启动,权限被拒绝

来自分类Dev

MySQL Daemon无法在centos上启动

来自分类Dev

无法在CentOS 7上安装phpMyAdmin

来自分类Dev

无法在CentOS 7上更新glibc

来自分类Dev

无法摆脱Centos 7上的回购

来自分类Dev

无法在CentOS 7上安装amarok

来自分类Dev

CNTLM无法在CentOS 7上运行

来自分类Dev

无法在CentOS 7上安装XPad

来自分类Dev

无法在centos 7上安装cuda

来自分类Dev

在CentOS7上安装Ant,JDK和JRE之后,仍然无法启动.bat文件

来自分类Dev

Fail2ban无法在Centos 7上启动。缺少/ var / log / secure文件

来自分类Dev

无法启动其他计算机上USB上安装的CentOS 7

来自分类Dev

从MBR切换到UEFI后,无法使CentOS v7在Dell上启动

来自分类Dev

在CentOS7上重新启动服务后无法连接到工件

来自分类Dev

minikube 在 Centos7 上启动