Thursday, January 21, 2016

Domain name to web hosting (DNS set up)



Now this is really basic. I've read about how DNS works. There are also some questions at ServerFault that talk about complex DNS configurations and stuff but my problem is that I don't get the basic of it. My question is pretty simple, even embarrassing but there's something huge I'm missing and it's driving me crazy.



When you need to link a domain name with a web hosting server, you have the domain name and the DNS of the hosting server and you point the domain name to the DNS server (either hostname or IP).



But how do you tell it which website should it display in a shared hosting? There is more than one website with the same IP.



Thank you!



Answer



On shared hosting, your provider will have a control panel to set that up for you. If you're setting up Apache yourself, this is stored in the vHosts portion of the config file.



Essentially, the webserver (usually Apache) figures out which webpage to serve to the end user, since every modern browser sends the HOST header indicating which hostname it intends to access. If you browse to the IP without telling the server which website you want to visit, most webservers display a generic error unless configured otherwise.


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...