How to Restart Bitnami Apache, Mysql and PHP

You may have edited some config files for Apache, PHP-FPM, phpMyAdmin or MySQL, and now it’s time to restart for the changes to take affect. For reference, I’m running Bitnami WordPress on Google Cloud Compute Engine.

Still working as of 22 June 2019.

Note: Keep in mind that it’s bad practice to shutdown and restart the entire VM. You could run into a Bitnami error screen (which you can fix by reading the bottom of the post.)

Let’s restart Bitnami services

Let’s do it the safe way by SSH’ing into your GCP VM. We will need to run commands to restart the Bitnami services. Do one at a time or just the one you need to restart. Restart Apache the Bitnami way

sudo /opt/bitnami/ctlscript.sh restart apache

Restart MySQL the Bitnami way

sudo /opt/bitnami/ctlscript.sh restart mysql

Restart PHP-FPM the Bitnami way

sudo /opt/bitnami/ctlscript.sh restart php-fpm

Restart all services with one command.

sudo /opt/bitnami/ctlscript.sh restart

Fix Bitnami white screen after restarting VM server

The other Apache 2 service can automatically start if you restart a Google VM (virtual machine). This throws an error and can cause your Bitnami WordPress (or other apps) to white screen. We will fix the Bitnami white screen error by simply forcing the other Apache service to stop.

You can use either commands to stop the Apache2 Service.

sudo systemctl stop apache2.service
sudo service apache2 stop

Only Bitnami’s Apache should be running now. Test out your site and restart Apache the Bitnami way, rather than shutting down the VM on Google Compute Engine.

Here are the offical Bitnami Docs.