# BASIC LAB INTERACTION #GCPday5

After completing the previous sections of discussing resources and access in google cloud I moved on to a small interactive Lab session with GCP.

In this lab, I used Google Cloud Marketplace to quickly and easily deploy a LAMP (Linux, Apache, Mysql, PHP) stack on a Compute Engine instance. The Bitnami LAMP Stack provides a complete web development environment for Linux that can be launched in one click.

The roles of different components of the LAMP stack are

1. Linux :- Operating System
    
2. Apache HTTP server:- web server
    
3. MySQL:- Relational Database
    
4. PHP:- Web Application Framework
    
5. phpMyAdmin:- php Administration Tool
    

The Objective of the lab session was to earn how to launch a solution using Cloud Marketplace. Entire lab session was distri buted in three task sections.

## TASK1:- **Sign in to the Google Cloud Console**

For each task, we will get a fixed set of resources for a fixed time with no cost

steps in this task are explained below :

1. Sign in to Qwiklabs using an **incognito window**.
    
2. Note the lab's access time (for example, `1:15:00`), and make sure you can finish within that time.  
    There is no pause feature. You can restart if needed, but you have to start at the beginning.
    
3. When ready, click **Start lab**.
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1687149673953/fdb8c30b-d088-4849-8e83-0edb4a29bfb6.png align="center")
    
4. Note your lab credentials (**Username** and **Password**). You will use them to sign in to the Google Cloud Console.
    
5. Click **Open Google Console**.
    
6. Click **Use another account** and copy/paste credentials for **this** lab into the prompts.  
    If you use other credentials, you'll receive errors or **incur charges**.
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1687149719853/3de86a23-1254-47be-aad1-89a9b27297a8.png align="center")
    
7. Accept the terms and skip the recovery resource page.
    

## TASK 2:-**Use Cloud Marketplace to deploy a LAMP stack**

The steps in this task in marked below

1. In the Google Cloud Console, on the **Navigation menu** (), click **Marketplace**.
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1687149941031/a5ee6ab6-dfe6-4da9-899e-0b462728bb9b.png align="center")
    
2. In the search bar, type `LAMP` and then press **ENTER**.
    
3. In the search results, click **LAMP Packaged by Bitnami**.
    
    If you choose another LAMP stack, such as the Google Click to Deploy offering, the lab instructions will not work as expected.
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1687149979019/016c277f-a167-4548-b94e-df38c848fcc3.png align="center")
    
4. On the LAMP page, click **Launch**.
    
    If this is your first time using Compute Engine, the Compute Engine API must be initialized before you can continue.
    
5. For **Zone**, select the deployment zone that Qwiklabs assigned to you.
    
6. For **Machine Type**, select **E2** as the **Series** and **e2-medium** as the **Machine Type**.
    
7. Leave the remaining settings as their defaults.
    
8. Accept the Google Cloud Marketplace Terms of Service near the bottom of the page.
    
9. Click **Deploy**.
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1687150127720/e5ddff6e-8976-4ec5-954b-216d3b641874.png align="center")
    
10. If a **Welcome to Deployment Manager** message appears, click **Close** to dismiss it.
    

## **Task 3:- Verify your deployment**

1. When the deployment is complete, click the **Site address** link in the right pane. (If the website is not responding, wait 30 seconds and try again.) If you see a redirection notice, click on that link to view your new site.
    
2. Close the congratulations browser tab.
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1687150237828/b17895f3-ed6c-4f6a-ab3d-9595a7c6ad5c.png align="center")
    
3. On the Google Cloud Console, under **Get started with LAMP Packaged by Bitnami**, click **SSH**.
    
    In a new window, a secure login shell session on your virtual machine appears.
    
4. In the SSH window, to change the current working directory to `/opt/bitnami`, execute the following command:
    
    ```plaintext
    cd /opt/bitnami
    ```
    
    Copied!content\_copy
    
5. To copy the `phpinfo.php` script from the installation directory to a publicly accessible location under the web server document root, execute the following command:
    
    ```plaintext
    sudo sh -c 'echo "<?php phpinfo(); ?>" > apache2/htdocs/phpinfo.php'
    ```
    
    Copied!content\_copy
    
    The phpinfo.php script displays your PHP configuration. It is often used to verify a new PHP installation.
    
6. To close the SSH window, execute the following command:
    
    ```plaintext
    exit
    ```
    
    Copied!content\_copy
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1687150311156/7240d729-c230-4bfb-8feb-dd34f3d8b290.png align="center")
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1687150353980/9457eabb-ac20-4bf8-adc6-c66abf7d4eba.png align="center")
    
7. Open a new browser tab.
    
8. Enter the following URL, and replace `SITE_ADDRESS` with the URL in the **Site address** field in the right pane of the **lampstack** page.
    
    ```plaintext
    http://SITE_ADDRESS/phpinfo.php
    ```
    
    Copied!content\_copy
    
    A summary of the PHP configuration of your server is displayed.
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1687150411743/5adedc3c-8126-4a76-969c-9b296889295d.png align="center")
    
9. Close the **phpinfo** tab.
    

This ends our small interaction session with the GCP marketplace.

Thank you everyone.
