[FIXED] AWS Bitnami WordPress: “httpd could not be started” | Apache Server not Restarting
August 18, 2019
If you come across the error /opt/bitnami/apache2/scripts/ctl.sh : httpd could not be startedwhen you try restarting apache server by running the command sudo /opt/bitnami/ctlscript.sh restart apache, there is a quick way to solve this.
I faced this issue when my AWS EC2 instance was stuck and I had to reboot the instance. After the instance was rebooted, the site was still down as the apache server was inactive because the port 80 was occupied by nginx process.
How to Fix httpd could not be started error?
Step 1: Check if your apache server can start/already running by entering the command sudo /opt/bitnami/ctlscript.sh start apache
Step 2: If the apache servers are not active, you will get this status with error message httpd could not be started.
Step 3: There must be some other process blocking the socket / port 80 and you need to kill it. In my case, it was ngix process. Kill ngix and kill apache too.
sudo pkill -f nginx
sudo pkill -f apache
Step 4: Now start apache using this command
sudo /opt/bitnami/ctlscript.sh start apache
Hopefully your apache should be working fine now, go ahead, refresh your website and comment on what happened! If nothing works, keep reinstalling WordPress as the last option. Reinstalling won’t take much time and you may refer to this AWS WP installation guide for detailed info.
Ninad Maneghatta is the Founder and the Editor in Cheif of MGNAD Media. He has a Master's Degree in Computer Engineering from Arizona State University, USA. He is a tech enthusiast, content creator and an active participant in various national level tech conferences.