Hello.
I installed "nginx" on CentOS 7 x64 but it can't run. why?
Code:
[root@localhost ~]# service nginx status -l
Redirecting to /bin/systemctl status -l nginx.service
● nginx.service - The nginx HTTP and reverse proxy server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Sat 2017-06-17 06:24:38 EDT; 1min 52s ago
Process: 9221 ExecStart=/usr/sbin/nginx (code=exited, status=1/FAILURE)
Process: 9217 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=0/SUCCESS)
Process: 9214 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)
Jun 17 06:24:36 localhost.localdomain nginx[9221]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Jun 17 06:24:36 localhost.localdomain nginx[9221]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Jun 17 06:24:37 localhost.localdomain nginx[9221]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Jun 17 06:24:37 localhost.localdomain nginx[9221]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Jun 17 06:24:38 localhost.localdomain nginx[9221]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Jun 17 06:24:38 localhost.localdomain nginx[9221]: nginx: [emerg] still could not bind()
Jun 17 06:24:38 localhost.localdomain systemd[1]: nginx.service: control process exited, code=exited status=1
Jun 17 06:24:38 localhost.localdomain systemd[1]: Failed to start The nginx HTTP and reverse proxy server.
Jun 17 06:24:38 localhost.localdomain systemd[1]: Unit nginx.service entered failed state.
Jun 17 06:24:38 localhost.localdomain systemd[1]: nginx.service failed.
The output of "netstat -tulpn" tell me:
Code:
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 9093/nginx: master
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 30584/sshd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 2723/master
tcp 0 0 127.0.0.1:9051 0.0.0.0:* LISTEN 5272/ssh
tcp6 0 0 127.0.0.1:9200 :::* LISTEN 5894/java
tcp6 0 0 ::1:9200 :::* LISTEN 5894/java
tcp6 0 0 127.0.0.1:9300 :::* LISTEN 5894/java
tcp6 0 0 ::1:9300 :::* LISTEN 5894/java
tcp6 0 0 :::22 :::* LISTEN 30584/sshd
tcp6 0 0 ::1:25 :::* LISTEN 2723/master
Thank you.