This guide explains how to use a Bash script to monitor website uptime and automatically restart a Google Cloud VM if the website is down. The script also restarts the Apache HTTP server (httpd
) on the VM after it has started.
- Google Cloud SDK:
Ensure the Google Cloud SDK is installed and configured on your system.