Enabling Web Server Role in virtual machines
- Enter via the RDP protocol to the vm-vvillar virtual machine opening a remote desktop and typing <the public IP of the load balancer>:5000
- Click on Use a different account and type the credentials of our virtual machine
- Click on yes in the certificate that will appear and we will have access via remote desktop to the vm-vvillar virtual machine
- Dar click en Add Roles and Features dentro del Server Manager, en la parte de Server Roles dar click en el cuadro de Web Server (IIS) y en la ventana emergente dar click en Add Features
- Leave everything else by default and click on Install
- Once the web server role is installed in the vm-vvillar virtual machine, we will modify the html file that comes by default to add a phrase and identify that it is the virtual machine 1. To do this, go to C:\inetpub\wwwroot , open a Notepad and drag the file iistart.html to the Notepad
- Under the label <body> insert the following code
<h1> Server 01 </h1>
Save and close the Notepad
- Do the test entering by the public IP of the virtual machine through a browser
- Repeat the same procedure for the virtual machine vm-vvillar2 accessing through the public IP of the balancer and port 5001 on a remote desktop
- Accept the certificate and then perform, as in the previous virtual machine, the enabling of the Web Server (IIS) role and configure the HTML file with the code
<h1> Server 02 </h1>
Access to the websites through the load balancer and execution of failover tests
- UOnce the role of web server is implemented in both virtual machines, we will proceed to enter through a browser using the public IP of the Load Balancer (188.8.131.52 in my case). We see that the load balancer is redirecting us to website 01.
- To do the failover tests, we will turn off the server so that when we access again the IP of the load balancer, it will take us to the website of the other virtual machine.
- Entering with the IP of the load balancer, we see that it now takes us to the website of the other virtual machine.