LNAMP下Nginx無法正常監聽端口

问答中心分类: NginxLNAMP下Nginx無法正常監聽端口
SkyFaklist 提问 2周 前

你好,我使用Oneinstack搭建的LNAMP環境下,一直無法成功啓動Nginx,提示錯誤98,XX端口被占用
而且更換了幾個端口且都無法解決,apache端口已經手動改為8080
平台:AliBaBaCloud輕量伺服器
Linux版本:Centos7.6
 
截取部分日志(nginx沒有錯誤日志輸出)
 
[[email protected] ~]# nginx
nginx: [emerg] bind() to 0.0.0.0: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 0.0.0.0: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 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] still could not bind()
[[email protected] ~]# kill -9 22547
[[email protected] ~]# nginx
[[email protected] ~]# nginx
nginx: [emerg] bind() to 0.0.0.0: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 0.0.0.0: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 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] still could not bind()
[[email protected] ~]# netstat -ntpl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:32000 0.0.0.0:* LISTEN 1417/java
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 3681/mysqld
tcp 0 0 127.0.0.1:11211 0.0.0.0:* LISTEN 1962/memcached
tcp 0 0 127.0.0.1:6379 0.0.0.0:* LISTEN 965/redis-server 12
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 22688/nginx: master
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 16502/httpd
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 886/pure-ftpd
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 2219/sshd
tcp6 0 0 :::33060 :::* LISTEN 3681/mysqld
tcp6 0 0 :::21 :::* LISTEN 886/pure-ftpd
[[email protected] ~]# systemctl restart nginx
Job for nginx.service failed because the control process exited with error code. See \\\\\\\\”systemctl status nginx.service\\\\\\\\” and \\\\\\\\”journalctl -xe\\\\\\\\” for details.
[[email protected] ~]# killall -9 nginx
[[email protected] ~]# systemctl start nginx
[[email protected] ~]# nginx
nginx: [emerg] bind() to 0.0.0.0: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 0.0.0.0: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 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] still could not bind()
[[email protected] ~]# systemctl restart nginx
[[email protected] ~]# nginx
nginx: [emerg] bind() to 0.0.0.0:88 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:88 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:88 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:88 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:88 failed (98: Address already in use)
nginx: [emerg] still could not bind()
 

1 问题
SkyFaklist 回答 2周 前

自己製作的插件導致nginx被啓動數次,已經解決