"TASK 2(Video Link):- https://drive.google.com/file/d/1kfbO1cISb63TnjV0ivw7qdAxoaC1XOzK/view?usp=drive_link"
• 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.
• 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.
• 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.
• 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.
• 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.
• 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.
• 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.
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.