0

I'm currently trying to install Apache on Centos 7 using the following tutorial https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-centos-7.

When i type in the following command systemctl start httpd.service to start up Apache, I get the following error: Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.

can anyone help me understand what is going wrong here? also bare in mind that I'm a complete noob when it comes to servers and linux, as i have never used them before.

Also i entered the following command systemctl status httpd.service and got the following back:

httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Thu 2016-08-04 10:39:59 IST; 3min 20s ago
     Docs: man:httpd(8)
           man:apachectl(8)
  Process: 6515 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
  Process: 6513 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
 Main PID: 6513 (code=exited, status=1/FAILURE)

Aug 04 10:39:59 localhost.localdomain httpd[6513]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
Aug 04 10:39:59 localhost.localdomain httpd[6513]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
Aug 04 10:39:59 localhost.localdomain httpd[6513]: no listening sockets available, shutting down
Aug 04 10:39:59 localhost.localdomain httpd[6513]: AH00015: Unable to open logs
Aug 04 10:39:59 localhost.localdomain systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Aug 04 10:39:59 localhost.localdomain kill[6515]: kill: cannot find process ""
Aug 04 10:39:59 localhost.localdomain systemd[1]: httpd.service: control process exited, code=exited status=1
Aug 04 10:39:59 localhost.localdomain systemd[1]: Failed to start The Apache HTTP Server.
Aug 04 10:39:59 localhost.localdomain systemd[1]: Unit httpd.service entered failed state.
Aug 04 10:39:59 localhost.localdomain systemd[1]: httpd.service failed.

if any of that helps.

HBruijn
  • 72,524
  • 21
  • 127
  • 192
noobCoder
  • 103
  • 2

1 Answers1

1

Address already in use: AH00072: make_sock: could not bind to address [::]:80 / 0.0.0.0:80

Another process is already listening to the default HTTP port, port 80 so it can't be used by Apache and it fails to start. To investigate what the following commands may be of use:

 sudo netstat -tnlp | grep :80

or

 ss -tnlp | grep :80
HBruijn
  • 72,524
  • 21
  • 127
  • 192