I've an instance running CentOS 7. And I'm having a difficulty when/if I restart httpd
.
My configuration is working fine, my sites are broadcasted as I wanted; moreover, when I execute the command sudo apachectl configtest
, I get back Syntax OK
.
But when I restart httpd
, it fails to comply with the following status message:
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Tue 2018-08-28 12:30:26 CEST; 6s ago
Docs: man:httpd(8)
man:apachectl(8)
Process: 9569 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
Process: 9568 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
Main PID: 9568 (code=exited, status=1/FAILURE)
Aug 28 12:30:26 vps httpd[9568]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
Aug 28 12:30:26 vps httpd[9568]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
Aug 28 12:30:26 vps httpd[9568]: no listening sockets available, shutting down
Aug 28 12:30:26 vps httpd[9568]: AH00015: Unable to open logs
Aug 28 12:30:26 vps systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Aug 28 12:30:26 vps kill[9569]: kill: cannot find process ""
Aug 28 12:30:26 vps systemd[1]: httpd.service: control process exited, code=exited status=1
Aug 28 12:30:26 vps systemd[1]: Failed to start The Apache HTTP Server.
Aug 28 12:30:26 vps systemd[1]: Unit httpd.service entered failed state.
Aug 28 12:30:26 vps systemd[1]: httpd.service failed.
I get that something else is working in place of httpd
when I restart it. Therefore I execute netstat -tulpn | grep :80
.
tcp 0 0 0.0.0.0:8060 0.0.0.0:* LISTEN 2560/nginx: master
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 2560/nginx: master
tcp 0 0 127.0.0.1:8080 0.0.0.0:* LISTEN 1434/unicorn master
tcp 0 0 127.0.0.1:8082 0.0.0.0:* LISTEN 1307/sidekiq 5.1.3
The above result kind of confuses me since I don't have Nginx
installed on my system and which nginx
also returns nothing.
However, when I reboot my instance, httpd
works as intended.
What should I do to resolve my issue?
ps -Af |grep $pid
to see the full path of the program.