What you would do to host multiple websites on a locally hosted web server?

One of our clients previously mapped one public IP to a web server and created virtual directories/subfolders or sub-domains to host additional websites. They would they mask the redirection so the user out on the interweb sees a friendly url. However, in most cases, this broke client scripts like javascript or ajax.
The steps I have outlined here apply only to those who host their own web server inside their local network. If you have your website hosted online with one of the many hosting providers out there like godaddy, domains priced right, or network solutions just to name a few, you would have a control panel or a dashboard that you can use. This is for another discussion however.

In order to host multiple sites, you would need to do a few things in a specific order.

1)Create a new website.
If you are using IIS, launch IIS Manager, right-click on Web Sites, and create a new website.

2)If you are using IIS, edit the properties for the web site to listen on TCP port 80 and add the domain name for this web site in the host header field.

3)On your local DNS server, point the domain name zone records www and @ to the local IP address of the web server.

4)On the external DNS server, point the domain name zone records www and @ to point to the external IP address of your firewall. For most, this is done with the registrar, usually Network Solutions. The wait time is up to 2 hours for changes to take effect on the Network Solutions zone and 24-48 hours out on the internet.

5)Login to your firewall and create a PAT (port address translation) rule to forward external or internal requests to view TCP port 80 from the external IP address, to the local IP address of the web server.
Doing a PAT rule ensures you limit access to web traffic only.

And that’s it. Very simple to do but I wanted to post this out there because a client of ours asked about this. If it isn’t clear for one, I’m sure others will have the same questions.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.