AWS KC Videos: How do I host multiple websites on an EC2 Windows instance?
Articles,  Blog

AWS KC Videos: How do I host multiple websites on an EC2 Windows instance?

hello I’m on mass a cloud Support Engineer here at the AWS Sydney office sometimes customers ask me how do I host multiple websites on an Amazon ec2 windows innocence I tell them that they can achieve that by setting multiple host names in is let me walk you through the process I’m already signed into my AWS management console let’s go to ec2 console and pick up our instance IP address and connect there that’s our instance and here is a public IP address let’s RDD to this IP address now I have already logged into the instance let’s open the is manager if you are running your instance as a web server and you’re already hosting one web application there and later on you decided that you want to add more website to our more web applications how you can host that in the is the is differentiate between these websites using bindings and the bindings consist of the IP address port and host name so if you host your second website on the same server that means you will be using the same ITM port let me quickly show you that here if we click on the server and put aside default website you see bindings here this is the thing that the is differentiate between the website so if I have the same IP and port if you will add later on 20 websites so you will use the same IP and for 20 times so that will conflict for sure so the way to differentiate between that or the way to add more website on your is you have to use the hostname so I will add 3 websites now the first one is running already in port 80 so let me add the next website add website I call it side 2 and let’s look at the folder and it was ready to be wrote there I just also add there a dummy file index.html that passed one line there and I will click OK you see here we got error message saying that the bindings on port 80 is assigned to another site so it’s just like a warning are you sure you want to have this duplicate so if I click the yes it will add the website but it will be stopped and if I try to start this website I will get their message saying that this website cannot be started another website may be using the same port so the way to fix that is adding the hostname so let’s add the hostname so I will add the hostname here call it fighter ok close now I’ll be able to start my website and I will change the default website bindings click Edit and give it hostname site 1 click OK close I will add my third website there call it site 3 pick up the website folder not here see in it Bob Davi Davi Road side 3 ok and give it hostname side 3 if you are accessing that website locally so you would need to update the host file or if you are accessing that externally you would need to update your host provider so I will so I will show you here how you can do that locally I will update the machine Haute file I will pick a post and here in the host file we add the IP address and the host names we added in the is so I would say site 1 right 2 and side 3 and it’s how the is will differentiate between the different websites let’s test that now yeah it works so when we write fight one in the browser it land in the default website here the one that has site one in the hostname let’s test the second one so if I try to try to it land inside to so this is working let’s test five three yeah the requests go to site 3 thanks for watching this video and happy cloud computing from all of us here at AWS


Leave a Reply

Your email address will not be published. Required fields are marked *