2

I just did a clean install of Nginx, because I had problems with the port 0.0.0.0:80 and [::]:80 already being in use. Now I still have the same problem and I really could use your help here after trying loads of things. You should know that I'm only used to follow forums but when it comes to debugging I'm totally out of my league.

What I can give you are handlebars to aid you in getting the know what the actual problem is.

My nginx version is 1.17.3 Installed on a Ubuntu 18.04 server (DigitalOcean)

Nginx -t gives me the following:

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

systemctl status nginx is giving an error about a PID file that can't be found. The rest seems to be fine but I cant judge if this is a bad omen to the actual problem.

● nginx.service - nginx - high performance web server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2019-08-29 14:10:18 UTC; 23min ago
     Docs: http://nginx.org/en/docs/
  Process: 2307 ExecStop=/bin/kill -s TERM $MAINPID (code=exited, status=0/SUCCESS)
  Process: 2310 ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf (code=exited, status=0/SUCCESS)
 Main PID: 2320 (nginx)
    Tasks: 2 (limit: 504)
   CGroup: /system.slice/nginx.service
           ├─2320 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
           └─2322 nginx: worker process

wp-rest-api-ams-jeromejero systemd[1]: Starting nginx - high performance web server...
wp-rest-api-ams-jeromejero systemd[1]: nginx.service: Can't open PID file /var/run/nginx.pid (yet?) after start: No such file or directory
wp-rest-api-ams-jeromejero systemd[1]: Started nginx - high performance web server.

Now to show the actual problem I want to solve: nginx gives me the following. I know that there are multiple similar questions, but none helped.

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()

Now to check what's actually on this port: sudo netstat -tlpn | grep :80

tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      2083/nginx: master  
tcp6       0      0 :::80                   :::*                    LISTEN      2083/nginx: master  

It would be great there is anyone who could shed new light on this.

Jerome Braeken
  • 483
  • 5
  • 8

0 Answers0