Skip to content

Latest commit

 

History

History
105 lines (59 loc) · 4.95 KB

File metadata and controls

105 lines (59 loc) · 4.95 KB

DEPLOY-SIMPLE-STATIC-WEBSITE-ON-GOOGLE-CLOUD-PLATFROM(GCP)-BY-USING-STORAGE_BUCKET.

"TASK 2(Video Link):- https://drive.google.com/file/d/1kfbO1cISb63TnjV0ivw7qdAxoaC1XOzK/view?usp=drive_link"

Deploy a Simple Static Website on GCP by using Cloud Stoarge Bucket.

Step 1:- Launch a New VM Instance (“Compute Engine”- Google Cloud).

• Log in to the Google Cloud Console.
• Navigate to Compute Engine → VM instances.
• Click Create Instance.
--Set the instance name and specifications as needed.
--Keep Firewall rules as default for now.
• Click Create to launch your instance.

Create VM Instance on Google Cloud-Image

Step 2:- Connect via SSH & Gain Root Access & Update Package Lists.

• Use the SSH option in the Google Cloud Console to access your instance securely. This provides a command-line interface.
• Run “sudo su”- to switch to the root user.
• This gives you administrative privileges needed for installations and configurations.
• Execute “apt-get update”- to ensure your package lists are up-to-date, which is crucial for installing the latest software.

Connect SHH-Image

Root & Packages Update-Image

Step 3:- Install Apache2 & Check Apache Status.

• Use “apt-get install apache2” - to install the Apache server, which will host your web application or static website.
• Verify Apache is running by using - “systemctl status apache2” or “service apache2 status”.
• This ensures your server is active and ready.

Installing Apache2-Image

Apache2 Status-Image

Step 4:-Create a Cloud Storage Bucket & Upload Files to the Bucket.

• Go to the Cloud Storage section in the console.
• Click Create Bucket.
• Configure the bucket:
--Name: Provide a globally unique name.
--Storage Class: Select the appropriate class (e.g., Standard).
--Location: Choose the desired location.
--Set permissions (e.g., public or private access).
• Click Create.

Bucket Created-Image

• Upload your static website files:
--Go to your bucket.
--Click Upload Files or Upload Folder.
--Select the file(s) from your local machine and upload.

Uploaded-Image

Step 5:-Copy File from Cloud Storage to VM Instance.

• Use the gsutil command to copy the file from the bucket to the VM: --“gsutil cp gs://sachin-bg01/one-page-website/* /var/www/html”
• -sachin-bg01 with the name of storage bucket.
• -one-page-website with the name of the uploaded file.
• -/var/www/html with the destination directory on our VM instance.

Copied to Bucket to VM Instance-Image

Step 5:- OUTPUT - Deploy Static Web Application.

• Copy the external/public IP address of your VM instance.
• Open a web browser and paste the IP address in the URL bar.
• Your static website should now be live.

Copied Public IP-Image

Pasted on browser-image

Output Home-Image

Output-Image

Output-Image

Output-Image

Output-Image

Conclusion:

In this task, we successfully deployed a static website on Google Cloud using a virtual machine (VM) instance and Apache server. We began by creating a VM instance, then connected to it via SSH to gain root access and install Apache. After setting up the Apache server, we created a Cloud Storage bucket, uploaded our website files, and transferred them to the VM using the gsutil command. Finally, by accessing the VM's public IP, we verified that the static website was live and accessible from the web. This process provided hands-on experience with key cloud computing services such as Compute Engine and Cloud Storage, as well as deploying a basic static website in a cloud environment.