DEV Community

Cover image for Installing Web Server Role on a Virtual Machine
Yemisi Oyesainu
Yemisi Oyesainu

Posted on

Installing Web Server Role on a Virtual Machine

A virtual machine is a digital equivalent of a physical computer. It can perform all functions that a physical computer can perform. These include running programs and operating systems, storing data, connecting to networks etc. It requires upkeep such as updates and system monitoring just like the physical computer.

Lets quickly run through how to create one, then we will connect to it and install a server role on the Virtual machine.

1.Create a Virtual Machine
a)Log in to Azure Portal and select Virtual Machine

Image description

Image description

b)Click on Create

Image description

Image description

c)Complete the following fields:
Subscription, Resource group(I will create MayWorkload1), Virtual Machine Name(Give the Virtual Machine a name, I will name this one Abby), Region(Select a Region of your choice) and Availability zone

Image description

Image description

Select Windows for the VM Image
Leave Security type, VM Architecture and Size at default

Image description

Under Administrator Account, Create User Name and Password
For this demo, our username is Azureuser and the password is Password123*
Note that these are the log in details for the Virtual Machine
Image description
Inbound Port Rules: Select HTTP 80 and RDP

Image description

Go to Monitoring and disable Diagnostics

Image description

d)Click on Review and Create

Image description

If Validation is passed, click on Create and if not, check to fix any error detected and move on

e)When the VM is fully deployed, click on Go to Resource.

Image description

Image description

2.Connect to the Virtual Machine
a)Click on Connect and select RDP

Image description

b)Click on Download RDP Files and open the file downloaded

Image description

A Window for the Remote Desktop Connection will come up.

Image description

c)Click on Connect and enter the User name and Password created in Step 1(c) above

Image description

d)Click OK
The Virtual Machine is ready

Image description

3.Install a Web Server role using PowerShell
a)On the desktop of the VM, use the Search window to search for Windows PowerShell. Click on it and select Run as Administrator

Image description

b)When the Terminal is ready, type this command in front of the Username: Install-WindowsFeature Web-Server
Type in this command exactly as it appears here because the PowerShell terminal window is case sensitive

Image description

Then press enter to allow it to install the Web Server
When the Web server has been fully installed, it will show Success as seen in the Image below

Image description

d)Go to the Overview page of the VM on the Azure portal and copy the Public IP Address of the VM.

Image description

Place it in your web browser to test the web server installed

Image description

Image description

You can see that we have successfully install a web server role on the Virtual Machine

I will like to have your feedbacks if you find this piece helpful

Top comments (0)