So you have WHS and you fancy running
a few websites on it... good for you.
Well let me tell you it is not as daunting as one would think, so without further ado lets get stuck in.
1. You are running WHS v1
2. You have a DYNAMIC IP provided to you by your ISP
3. You have a router with UPnP functionality and it is enabled or you have configured your router to open the required default ports to your WHS (1723,80,443,4125), albeit 80 is the only one you need for this exercise. The latter configuration meaning your WHS has a fixed IP address on your network
4. If assumption 3 is spot on, then you should already have your <blah>.homeserver.com website up and running
5. You have registered a number of domain names, which currently resolve to some default registration provider web page and you want to host and develop them on your WHS
6. You don't want to use any forwarding, or dodgy URL cloaking to access your web sites, you want to host them the kosher way
[Life's a Beach]
1. Off the shelf WHS runs an IIS web server which will already be hosting the <blah>.homeserver.com website that you no doubt have kicked into action via the WHS console->Settings-Remote Access option.
2. IIS Web server supports running multiple websites out of the box, you just need to give each new website a unique host header, which in laymens terms is basically the website URL without the http://
This allows IIS to redirect the incoming URL to the correct website it is hosting, if none match it uses the default website, in WHS case the default is <blah>.homeserver.com.
[It's always raining]
1. In the world of the common Internet user, your home Internet address changes often, as most ISPs allocate Dynamic IP addresses to its customers, purely for ease of management. That makes running websites on your WHS a tad inconvenient, if someone types in the URL to your website, how does the internet know that the website is hosted on your WHS and how does it keep up to date if your address keeps changing?. Same principle applies if your home street address kept changing how would you inform your mates how to find you?
2. If you have already got your <blah>.homeserver website up an running we are already cooking, if not the configuration world of routers and firewalls awaits you.
3. You do need to tread a little careful when dealing with IIS, as you wouldn't want to delete the wrong thing or willy nilly change the configuration of the sites without knowing what you are doing. Last thing you want is to have to do a WHS server re-install.
4. There ain't no such thing as a free lunch so this is going to cost me, right? I'm afraid the solution I am going to propose is going to cost you some hard earned greenbacks.
5. I've registered my domain names but how do I get them to point to my WHS? At the moment they just open up a default page which states this domain has been reserved.
[Solution - Step 1 - Dynamic DNS Setup]
DNS is the internet's solution to matching URL friendly names to their home address, your external IP. However we have an external IP address that keeps changing so what we need is a dynamic DNS solution. We need something on our home network to tell the Internet DNS of our address every time our external IP changes.
Microsoft has a Dynamic DNS solution built into WHS which is how the <blah>.homeserver.com website resolves to your own WHS. WHS has a client which chats every so often to homeserver.com DNS to let it know where it is now living.
So can we use this... well we could if we hosted the new websites under the WHS default website and we implemented domain forwarding from the provider where you registered your domain. However this is a bit of a fudge in my book. When I type the URL of my website into a browser e.g. www.mydomainname1.com
I don't want to see it changed to http://<blah>.homeserver.com/mydomainname1, I want it to stay there. Also when my site is indexed in the search engines I want it indexed under the domain name I registered not the WHS domain name.
Our kosher solution lies with a Dynamic DNS provider and I have chosen http://www.dyndns.com to undertake this role.
What we need is for each of your new websites domain names to resolve to the very same external IP address provided by your ISP, and it must be kept in sync.
DynDNS has a service called "DynDNS Custom: Managed DNS Hosting Solution", this is what we need to sign up to. For each domain name you register under this service it will unfortunately set you back $29.95, and it is also a re-occuring cost each year.
Hear is an example showing my domains:
Once you have entered all your domains make sure you preactivate each of their custom DNS entries. This basically loads the DNS entries into the DynDNS servers. They won't be able to become active yet as your domains are still registered or delegated to an alternate DNS server which is likely to be the one you registered the Domain with on purchase. In my case this was with Easyspace.com and DynDNS showed each of my sites were currently delgated to the following DNS servers:
DynDNS will also show you what nameservers these need to be changed to, take note of these, as you need these details later, in my case they were:
The next thing to do is to install the DynDNS client on your WHS, which will ensure your domains always resolve to your external IP no matter how many times it changes. The client will install as a service, and make sure during the install you select start with windows option, so it will always be running and ensure to include all your domains for update. You will have to Remote Desktop into your WHS in order to perform the install.
You can download the DynDNS client from their support page https://www.dyndns.com/support/
N.B. It is worth mentioning you may have a router which can automatically act as an update client for DynDNS. This can indeed be used, but generally they only support the updating of one domain, if you have more than one, then you need to use the DynDNS client tool.
[Solution - Step 2 - Change Your Domain Nameservers]
As mentioned above I registered my Domains with Easyspace.com, but now instead of using their DNS servers I want to use the DynDNS custom ones I setup earlier, which point the domains to my WHS. Most domain registration sites like easyspace.com will allow you to change a domains nameservers via their website control panel. If you are unlucky enough not to have this option then you can most likely raise a ticket or phone their helpdesk to request the change.
With easyspace.com just log into the control panel and navigate to Domain Management and finally select Nameserver settings. You should be presented with a similar screen to that below:
All you now have to do is enter in the ns1.mydyndns.org and ns2.mydyndns.org values in the New Nameserver fields and click submit. There is no need to enter any values in the NS IP Address fields. This has now kicked off a chain reaction which will point that domain to your WHS, which is all very exciting. Now do the same with all the other Domains you have also registered with DynDNS. It may typically take 12-24hrs for the change to ripple through the internet.
[Solution - Step 3 - Undertake Some Basic Checks]
12 Hours has passed and your now ready to undertake the next part of the adventure. Firstly log back into your DynDNS account and go to My Zones/Domains. Click on each of your domains in turn and hopefully at the top of each page you will see a status of Active in a lovely shade of green.
Assuming sunny day scenario you can try and enter your domain names/website URLs into your browser of choice, and what you should be presented with is your default WHS website web page, just as if you had entered your <blah>.homeserver.com website address.
Well done if you have got this far and it is all working, now onto the next step of setting up your new websites in IIS...
[Solution - Step 3 - Creating your new Websites]
I have a share called "Websites" setup on WHS and within it I have created subdirectories called "1. Live" and "2. Development". Within each of these subdirectories I have further directories which house each of my websites.
Obviously you need to point the registered domain names to the live code source, so lets get on and do that now using the IIS Manager.
After you have Remote Desktop into WHS, fire up IIS Manager from the control panel Administrative Tools->Internet Information Services (IIS) Manager and expand the Web Sites branch. You should see only two entries "Default Web Site" and "WHS Site", see picture below:
Next right click on "Web Sites" and select New->Web Site this should fire up the new web site wizard.
- Enter a description for the website, the domain name would suffice and click "Next".
- On the IP Address and Port Settings page, just click "Next", we will modify the host header information a little later.
- On the Web Site Home Directory page assuming you have selected to use the same directory structure as me, click "Browse" and navigate too "D:\shares\Websites\1. Live\<your website name>" and then click "Ok", followed by "Next".
- The next page shows the web site access permissions. Normally the default of "Read" permission will suffice, but if you have ASP or PHP scripts you will have to check "Run Scripts" checkbox too. Click "Next" when ready.
- Finally the wizard should give you a confirmation message to say it successfully created your website, click "Finish" to exit.
More to follow...