你好,我使用Oneinstack搭建的LNAMP環境下,一直無法成功啓動Nginx,提示錯誤98,XX端口被占用
而且更換了幾個端口且都無法解決,apache端口已經手動改為8080
平台:AliBaBaCloud輕量伺服器
Linux版本:Centos7.6
截取部分日志(nginx沒有錯誤日志輸出)
[root@sakurax ~]# 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()
[root@sakurax ~]# kill -9 22547
[root@sakurax ~]# nginx
[root@sakurax ~]# 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()
[root@sakurax ~]# 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
[root@sakurax ~]# 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.
[root@sakurax ~]# killall -9 nginx
[root@sakurax ~]# systemctl start nginx
[root@sakurax ~]# 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()
[root@sakurax ~]# systemctl restart nginx
[root@sakurax ~]# 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()
而且更換了幾個端口且都無法解決,apache端口已經手動改為8080
平台:AliBaBaCloud輕量伺服器
Linux版本:Centos7.6
截取部分日志(nginx沒有錯誤日志輸出)
[root@sakurax ~]# 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()
[root@sakurax ~]# kill -9 22547
[root@sakurax ~]# nginx
[root@sakurax ~]# 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()
[root@sakurax ~]# 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
[root@sakurax ~]# 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.
[root@sakurax ~]# killall -9 nginx
[root@sakurax ~]# systemctl start nginx
[root@sakurax ~]# 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()
[root@sakurax ~]# systemctl restart nginx
[root@sakurax ~]# 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()