Installing a WebServer on Win Server 2019 VM
Tags: webserver, virtualmachine, windows
Published: 2024-05-24 03:43:56

**First and foremost, what is a _web server_**?
Imagine you have a toy box at home where you keep all your favourite toys. Now, let’s say your friend wants to see what toys you have. Instead of coming to your house, they can use a special magic box that lets them see and even play with your toys from their own home. This magic box is connected to your toy box and shows your toys to your friend whenever they ask.

![webserver to a kid](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cd37hq033zqzbl9qzc9y.png)
A web server is like that magic box. It keeps a lot of information (like your toys) and when someone on the internet wants to see that information (like your friend), the web server shows it to them. So, it's a special computer that helps share information with other computers.

A **web server** is _a specialized software or hardware system responsible for handling HTTP(S) (Hypertext Transfer Protocol) requests from clients, typically web browsers, and serving them the appropriate web content, such as HTML pages, images, videos, or other resources_. The primary functions of a web server include:

1. **Hosting Websites**: Web servers store, process, and deliver web pages to users. They manage domain names, manage content, and ensure that web pages are available to users around the clock.
2. **Handling Requests and Responses**: When a user enters a URL in their browser, the web server processes the incoming HTTP request, retrieves the requested content, and sends it back to the client as an HTTP response.
3. **Security**: Web servers implement various security protocols, such as SSL/TLS, to encrypt data transmitted between the server and clients. They also handle authentication and authorization to protect sensitive data and resources.
4. **Load Balancing and Scalability**: Web servers can distribute incoming traffic across multiple servers to ensure efficient resource utilization, high availability, and reliability. They support scalability by adding or removing servers as demand fluctuates.
5. **Logging and Monitoring**: Web servers maintain logs of all transactions, which are crucial for analyzing traffic, debugging issues, and monitoring performance.

Popular web server software includes Apache HTTP Server, Nginx, Microsoft Internet Information Services (IIS), and LiteSpeed. Each of these solutions offers unique features and optimizations to cater to different performance, security, and scalability requirements.

In a previous [post](https://dev.to/olawaleoloye/a-guide-to-deploying-windows-11-using-azure-resources-3ao9), we deployed a Win 11 VM. Now, we shall install a webserver on a similar server (Win Server 2019). 

**Open PowerShell**
Click on the **Start** menu.

![PowerShell](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ezn1ulkvgdj5tjtn9d2j.png)
Type **PowerShell** and open **Windows PowerShell** or **Windows PowerShell ISE** as an **_administrator_**(right-click and select Run as administrator)
![PS as admin](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r26p97vh05zsobrb4fn0.png)
**Provide your credentials**
![Credentials](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uldq3ne7208yz061iza3.png)
**Install IIS by running this command**
```
Install-WindowsFeature -name Web-Server -IncludeManagementTools
```
![Run code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ypf470djsvx4m7vcovk5.png)
![Install progress](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/91hfu1o34qwx3szq0xts.png)
![Install Success](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rd3dz40u8d9fmjllaav3.png)