Nginx地址端口80已被使用

时间:2019-08-29 14:51:34

标签: ubuntu nginx ubuntu-18.04 port80

我刚刚进行了Nginx的全新安装,因为端口0.0.0.0:80和[::]:80的使用已经出现问题。现在,我仍然遇到同样的问题,在尝试了很多事情之后,我真的可以在这里使用您的帮助。您应该知道,我只习惯关注论坛,但是在调试方面,我完全不在我的讨论范围之内。

我能提供给您的是把手,可以帮助您了解实际的问题所在。

我的nginx版本是1.17.3 安装在Ubuntu 18.04服务器(DigitalOcean)上

Nginx -t给了我以下内容:

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

systemctl status nginx给出了有关找不到的PID文件的错误。其余的似乎很好,但我无法判断这是否是解决实际问题的好兆头。

● 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.

现在显示我要解决的实际问题:nginx给了我以下内容。我知道有多个类似的问题,但无济于事。

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

现在要检查此端口上的实际内容: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  

任何人都可以对此有所了解的很好。

0 个答案:

没有答案