Google Cloud Platform Web Server – Insurance Blog

Would you like to host your own website on Google Cloud Platform? In this article, we will guide you through the process of installing an Apache web server on a Linux virtual machine. It’s easier than you think!

Google Cloud Platform Web Server
Google Cloud Platform Web Server

Step 1: Log in to Google Cloud Console

First, log in to your Google Cloud project and navigate to the Compute Engine section. Click “Virtual Machine,” then select “Create New Instance.”

Step 2: Configure your virtual machine

Give your virtual machine a name and choose the region and zone where it will be hosted. This determines the location of your server. Keep in mind that region and zone selection is important and can affect performance. If you need more information on this topic, check out our dedicated video on this topic.

Step 3: Change Startup Disk Type and Allow Firewall

In the Machine Configuration section, you do not need to make any changes except for the No Service Accounts option. In the Bootable Disk section, choose the SSD option for faster performance. Additionally, click “Allow HTTP Traffic” in the Firewall section. Once you’re done, click “Create” to create your virtual machine.

Step 4: Log in to your virtual machine

After a few minutes, your virtual machine will be ready. Click the SSH button to connect to your virtual machine. A new window will open, asking for your permission to log in. Click “Allow” to continue.

See also  Top 10+ Best scanner app for iphone

Step 5: Update Packages and Install Apache

Now that you are in the virtual machine, update all packages by running the command sudo apt-get update. This ensures that your virtual machine has the latest software updates. Once done, install the Apache server by running the command sudo apt-get install Apache2 php7.0. Give your permission to proceed with the installation.

Step 6: Update the Landing Page

To personalize your server’s landing page, modify the index.html file located in the var/www/html phone book. Replace the content with your own, for example “Hello World from your domain name”. Save the changes.

Step 7: Test your website

To test your website, find the external IP address of your virtual machine. Click the link and you should see the edited landing page with your personalized content.

Step 8: Don’t forget to delete your virtual machine

Once you are finished experimenting or studying, it is important to delete your virtual machine to avoid unnecessary charges to your account. Click on the three vertical dots and select “Stop” to shut down the virtual machine. Once the shutdown is complete, click the dots again and select “Delete” to delete the virtual machine.

You now know how to install an Apache web server on a Linux virtual machine hosted on Google Cloud Platform. Be sure to follow these steps and remember to delete your virtual machine when you’re done to avoid additional charges. Good accommodation!

Image source: Technical Potpourri


YouTube video

Google Cloud Platform Web Server