nginx issue: Failed to start nginx - high performance web se

Issues related to applications and software problems
Post Reply
ramasilveyra
Posts: 7
Joined: 2014/10/05 21:25:42

nginx issue: Failed to start nginx - high performance web se

Post by ramasilveyra » 2014/10/05 21:37:39

Hello everybody,
I am very noob in the world of linux. Recently i install nginx in my vps with CentOS 7 and get this issue, and don't know how to solve (i search a lot but nothing appear):

Code: Select all

nginx.service - nginx - high performance web server
   Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled)
   Active: failed (Result: exit-code) since dom 2014-10-05 18:14:53 ART; 20min ago
     Docs: http://nginx.org/en/docs/
  Process: 24026 ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf (code=exited, status=1/FAILURE)
  Process: 24024 ExecStartPre=/usr/sbin/nginx -t -c /etc/nginx/nginx.conf (code=exited, status=0/SUCCESS)

oct 05 18:14:50 vps-931914-x.dattaweb.com nginx[24024]: nginx: configuration file /etc/nginx/nginx.conf test is successful
oct 05 18:14:50 vps-931914-x.dattaweb.com nginx[24026]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
oct 05 18:14:51 vps-931914-x.dattaweb.com nginx[24026]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
oct 05 18:14:51 vps-931914-x.dattaweb.com nginx[24026]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
oct 05 18:14:52 vps-931914-x.dattaweb.com nginx[24026]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
oct 05 18:14:52 vps-931914-x.dattaweb.com nginx[24026]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
oct 05 18:14:53 vps-931914-x.dattaweb.com nginx[24026]: nginx: [emerg] still could not bind()
oct 05 18:14:53 vps-931914-x.dattaweb.com systemd[1]: nginx.service: control process exited, code=exited status=1
oct 05 18:14:53 vps-931914-x.dattaweb.com systemd[1]: Failed to start nginx - high performance web server.
oct 05 18:14:53 vps-931914-x.dattaweb.com systemd[1]: Unit nginx.service entered failed state.
Can you help me?
Thanks!

User avatar
TrevorH
Site Admin
Posts: 33221
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: nginx issue: Failed to start nginx - high performance we

Post by TrevorH » 2014/10/05 23:12:21

You already have a web server installed and running and listening on port 80.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

ramasilveyra
Posts: 7
Joined: 2014/10/05 21:25:42

Re: nginx issue: Failed to start nginx - high performance we

Post by ramasilveyra » 2014/10/06 00:26:04

I thought it's a clean install of CentOs, and how to check what web server it's running? And how to disable?

User avatar
TrevorH
Site Admin
Posts: 33221
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: nginx issue: Failed to start nginx - high performance we

Post by TrevorH » 2014/10/06 07:15:01

Run lsof -i :80

I'd suspect you have apache httd running. Try running systemctl status httpd
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

ramasilveyra
Posts: 7
Joined: 2014/10/05 21:25:42

Re: nginx issue: Failed to start nginx - high performance we

Post by ramasilveyra » 2014/10/06 14:49:41

When systemctl status httpd i get this:

Code: Select all

httpd.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)
So Apache isn't the problem.
But when lsof -i :80 i get:

Code: Select all

COMMAND   PID  USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
nginx   23739  root    6u  IPv4 294032      0t0  TCP *:http (LISTEN)
nginx   23740 nginx    6u  IPv4 294032      0t0  TCP *:http (LISTEN)
Could it be a conflict or a bad configuration of nginx? And how to solve?

User avatar
TrevorH
Site Admin
Posts: 33221
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: nginx issue: Failed to start nginx - high performance we

Post by TrevorH » 2014/10/06 15:12:45

So nginx is already running.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply