3 Replies - 1217 Views - Last Post: 30 May 2017 - 11:29 AM

#1 jlis  Icon User is offline

  • D.I.C Head

Reputation: 13
  • View blog
  • Posts: 227
  • Joined: 02-February 15

NGINX starting error ?

Posted 29 May 2017 - 05:10 PM

Hi all,

I have a fresh install of NGINX on my CentOS machine. When I execute the command 'sudo service nginx start' I get the error: Redirecting to /bin/systemctl start 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.

If I then run : 'journalctl -xe', this is my output.

Anybody have any ideas how to fix ? I've made no changes to the config file either.

I have no idea what 0.0.0.0:80 failed (98: Address already in use) means, is that saying my port 80 is occupied ? :s

NGINX noob, apologies in advance!

-- Unit nginx.service has begun starting up.
May 30 01:04:53 localhost.localdomain nginx[23874]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
May 30 01:04:53 localhost.localdomain nginx[23874]: nginx: configuration file /etc/nginx/nginx.conf test is successful
May 30 01:04:53 localhost.localdomain nginx[23876]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
May 30 01:04:54 localhost.localdomain nginx[23876]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
May 30 01:04:54 localhost.localdomain nginx[23876]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
May 30 01:04:55 localhost.localdomain nginx[23876]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
May 30 01:04:55 localhost.localdomain nginx[23876]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
May 30 01:04:56 localhost.localdomain systemd[1]: nginx.service: control process exited, code=exited status=1
May 30 01:04:56 localhost.localdomain nginx[23876]: nginx: [emerg] still could not bind()
May 30 01:04:56 localhost.localdomain systemd[1]: Failed to start nginx - high performance web server.
-- 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.
May 30 01:04:56 localhost.localdomain systemd[1]: Unit nginx.service entered failed state.
May 30 01:04:56 localhost.localdomain systemd[1]: nginx.service failed.
May 30 01:04:56 localhost.localdomain polkitd[604]: Unregistered Authentication Agent for unix-process:23857:1179755 (system bus name :1.174, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale e


This post has been edited by jlis: 29 May 2017 - 05:11 PM


Is This A Good Question/Topic? 0
  • +

Replies To: NGINX starting error ?

#2 ndc85430  Icon User is online

  • I think you'll find it's "Dr"
  • member icon

Reputation: 712
  • View blog
  • Posts: 2,896
  • Joined: 13-June 14

Re: NGINX starting error ?

Posted 29 May 2017 - 08:11 PM

View Postjlis, on 30 May 2017 - 01:10 AM, said:

I have no idea what 0.0.0.0:80 failed (98: Address already in use) means, is that saying my port 80 is occupied ? :s


Yes. Do you have another web server running on port 80? If you want to run both processes, you'll need to change the port of one obviously.
Was This Post Helpful? 1
  • +
  • -

#3 jlis  Icon User is offline

  • D.I.C Head

Reputation: 13
  • View blog
  • Posts: 227
  • Joined: 02-February 15

Re: NGINX starting error ?

Posted 30 May 2017 - 08:47 AM

I have a home webserver running from a raspberry pi.

For some reason I thought using localhost and the port rather than the LAN IP for the NGINX server wouldn't conflict. Stupid me. Now I feel dumb :(

Thanks for the help! I will update the config of NGINX later and resolve.
Was This Post Helpful? 0
  • +
  • -

#4 no2pencil  Icon User is offline

  • Professor Snuggly Pants
  • member icon

Reputation: 6601
  • View blog
  • Posts: 30,793
  • Joined: 10-May 07

Re: NGINX starting error ?

Posted 30 May 2017 - 11:29 AM

This error would not indicate another device, it is saying that port 80 on itself is already in use. You are correct in thinking that localhost should be separate than your rasberri pi.

You should be able to find what application is binding port 80 with netstat.

Are you running Skype by chance? That often will snatch port 80.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1