In this lab you use Google Cloud Launcher to quickly and easily deploy a LAMP (Linux, Apache HTTP Server, MySQL, and PHP) stack on a Compute Engine instance.

What you need

To complete this lab, you need:

Internet access

Access to a supported Internet browser:

A Google Cloud Platform project

What you learn

In this lab, you:

In this lab, you deploy a fully-integrated and ready to run LAMP development environment to a Compute Engine instance.

Bitnami LAMP Stack provides a complete PHP, MySQL and Apache development environment for Linux that can be launched in one click. It also bundles phpMyAdmin and more.

Component

Role

Linux

Operating system

Apache HTTP Server

Web server

MySQL

Relational database

PHP

Web application framework

phpMyAdmin

PHP administration tool

For more information on the Bitnami LAMP stack, see: https://bitnami.com/stack/lamp.

Before you can launch virtual machines using Google Compute Engine in a project, you must first enable the Compute Engine API in that project if it is not already enabled. To confirm that the Compute Engine API is enabled:

Step 1

Confirm that, in the top bar of the Google Cloud Platform Console, cp100 is displayed as the current project. If you see a different project name, click that name, then click on cp100 in the Select dialog that appears.

Step 2

In the Cloud Platform console, click the top left three-bar icon to open the Products & Services menu. The console's online help and documentation refer to this menu as the "left-side menu."

In the left-side menu, click APIs & Services > Dashboard.

Step 3

Click Enable APIs and Services.

Step 4

In the search bar, type: Compute Engine

Step 5

Click Google Compute Engine API in the search results.

Step 6

If you see a Disable button at top, the Compute Engine API is already enabled. Do not click the Disable button. Instead, skip to the "Using Cloud Launcher" section below.

Otherwise, you will see an Enable button at top. The presence of this button means that the Compute Engine API is not presently enabled in this project, so you must enable it now. Click the Enable button.

Wait for the operation to complete. Several minutes may be required. The operation is complete when the Disable button appears, together with several graphs of usage (all blank, because the Compute Engine API has just been enabled). Do not click the Disable button. Instead, proceed to the "Using Cloud Launcher" section below.

To deploy a LAMP stack using Google Cloud Launcher:

Step 1

In the left-side menu, click Cloud Launcher.

Step 2

In the search bar, type: LAMP.

Step 3

Click the LAMP by Bitnami.

Step 4

On the LAMP page, click Launch on Compute Engine.

Step 5

When the New LAMP deployment page opens, accept all of the default deployment options. You may change the Zone in which your LAMP stack will be deployed if you wish.

Step 6

Click Deploy.

Step 7

If you are shown a ‘‘Welcome to Deployment Manager' window, click Close to dismiss it.

The status of the deployment appears in the console window. You see the status of the various components being deployed. When the deployment of the infrastructure is complete, the status changes to "lampstack-1 has been deployed". Once the software has been installed, you see a summary of the details for the instance, including the site address.

To verify the deployment of your LAMP stack:

Step 1

When the deployment is complete, click the link in the Site address field at the top of the lampstack page. Alternatively, you can also use the button labeled ‘Visit the site' in the ‘Get started with LAMP' section of the page.

A new browser tab should open displaying a congratulations page indicating the Apache HTTP Server is running.

Step 2

Close the congratulations tab.

Step 3

On the Cloud Platform Console page, underneath ‘Get started with LAMP', click SSH.

Step 4

In the SSH window, type the following command to switch to the bitnami directory.

cd /opt/bitnami

Step 5

Type the following command to copy the phpinfo.php script from the installation directory to a publicly accessible location under the Web server document root.

sudo cp docs/phpinfo.php apache2/htdocs

Step 6

Type the following command to close the SSH window.

exit

Step 7

Open a new browser tab.

Step 8

Type the following URL. Replace <site-address> with the URL in the Site address field. You can find the Site address at the top of the lampstack page.

<site-address>/phpinfo.php

A summary of the PHP configuration of your server is displayed.

Step 9

Close the phpinfo tab.

To remove the resources created in this lab:

Step 1

In the deployment summary page of the Cloud Platform Console, to the right of ‘lampstack-1', click Delete.

Step 2

In the ‘Delete deployment' dialog, click Delete to confirm your choice.

Step 3

Leave the Google Cloud Platform Console tab open.

©Google, Inc. or its affiliates. All rights reserved. Do not distribute.