Failed to start the apache HTTP server
After pushing my Laravel project on my development server, it seems that I can not run apache 2 anymore.
After running the command line :
sudo systemctl status apache2
I get the following error :
● apache2.service - The Apache HTTP Server Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Mon 2020-02-03 02:17:48 UTC; 1min 17s ago Process: 1631 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
After searching a bit on Google it appears that apache can not start because multiple processes are using port 80..
However, after running the command line :
sudo lsof -i tcp:80
I get the list of the following processes :
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME google_ne 716 root 7u IPv4 18497 0t0 TCP instance-development-webapp-eatology.c.webapp-eatology.internal:34086->metadata.google.internal:http (ESTABLISHED) google_ac 717 root 5u IPv4 18475 0t0 TCP instance-development-webapp-eatology.c.webapp-eatology.internal:34082->metadata.google.internal:http (ESTABLISHED) google_cl 719 root 5u IPv4 18478 0t0 TCP instance-development-webapp-eatology.c.webapp-eatology.internal:34084->metadata.google.internal:http (ESTABLISHED) google_cl 719 root 6u IPv4 18402 0t0 TCP instance-development-webapp-eatology.c.webapp-eatology.internal:34080->metadata.google.internal:http (CLOSE_WAIT)
Problem is, I do not understand how to kill each one of these processes, I've tried many command lines without any success..
Thanks for your help !
11 Answer
Run :
netstat -tulpn | grep 80 Look at the line where you have :
Proto : tcp
Local address : *.*.*.*:80Get the Pid or the Process Name column value :
<pid_or_process_name>:80Kill the process that holds the ports 80 using its pid or process name :
pkill -9 <process_name> Or
kill -9 <pid>Finally this still a workaround, you have to find out the process that is responsible of exposing the port 80 and disable it or just change its configuration file to point on a different port rather than tcp/80 because you will be on the same issue after a reboot.