Installing a Web Server using NGINX on a VM Instance.
In the previous part, we created a VM Instance using Compute Engine. Next, we will proceed with the web server installation process on our VM Instance. Before that, make sure you can access your VM Instance either through SSH or using the CMD from your local environment.
After entering the created server, type the command :
sudo apt-get update
sudo apt-get upgrade
Next, we will install our web server using Nginx. Enter the command :
sudo apt-get install nginx
and press enter. Type "Y" and press enter once again to confirm the installation.
Then, after installing Nginx, we will configure the firewall to access the web server we created earlier. In the Cloud Console, type "firewall" in the search bar and select "Firewall" under VPC network.
Once you are in the firewall settings, select the "Create Firewall Rule" option from the top menu.
Recommended by LinkedIn
Enter the name for the firewall configuration as per your preference. In this demo, I have already used the configuration name "allow-all-http," so you must use a new configuration name.
In the "Targets" section, choose "Specified target tags" and enter the target tags that you previously input when creating the VM Instance, such as "allow-health-check" if you assigned tags to your VM instance.
In the "Protocols and ports" section, select "Specified protocols and ports," then check "TCP" and set the ports to "80." After configuring everything successfully, click the "Create" button to save the firewall configuration.
Next, go back to the VM Instance menu, copy the External IP of the created VM Instance, and paste it into your browser to ensure that the web server we installed earlier is running or not.
If your browser displays "Welcome to nginx!" then the installation of the web server on the VM Instance has been successful.
That concludes this post on Installing a Web Server using NGINX on a VM Instance. So, don't hesitate to ask if you are unsure or want to add something that might be missing in this post. Thank you for taking the time to read this! 🤗
Graphic Designer at GDG Makassar | Web Designer & Graphic Designer
2yThank you for taking the time to comment on this article Nizar Akbar Meilani and Muhammad Abdur Rofi M. I appreciate your suggestions and input, which I will review more thoroughly later for this article. It's a pleasure to engage in discussions with you.
Linux System Administrator with The Analysis Skill of Reverse Engineer
2yYes especially the new version, they have improved detection of misbehaving clients when using HTTP/2 (HTTP2 Rapid Reset Attack).