dinsdag 25 januari 2011
Translated blogpost on Multiple websites on one dynamic IP.
[Update at the end of this post]
I want to run two websites on my DS-108j. Both sites should be accesable via their respective domain names.
My router runs on a dynamic ip-address. This means I can't point my domainnames to a fixed ip-address, because after every reboot of my modem, the address might have changed and I'd have to modify these numbers by hand.
Thankfully Synology provides a built-in DDNS-updater in their DiskStation Manager software. Combined with a free account with a DDNS-provider this will make your DS always accessible via a domain-name:
Domain-name --> DDNS --> DiskStation
jeroenvanomme --> vanomme.getmyip.com --> ip-address of my DS
But what if you want to host more than one domain on your DS? DSM 3.0 offers the option to define more than one server. Follow these steps to create servers:
- Configuration screen --> Web-services
- (Switch on WebStation if this is not done already)
- Click on Virtual host
- Now you can add new hosts with the "Create"-button:
- Subfolder: the folder below /web/ where you want to store your pages
- Hostname: Not sure what this does
- Protocol (HTTP or HTTPS)
- Portnumber.Enter a number not already in use. Update your modem settings, this port should be forwarded to your DS.
The problem we have now is adding any extra (virtual) host to the DYNDNS-service. DSM does not offer this option, it can only handle one host.
A solution to this problem is offered by QTip, moderator of the German Synology forum. His ddnsupdater_1.16.spk is a package written in Perl that can be installed easily via Package Management in DSM. First though, Init_3rdpartyHelp_1.0.spk should be installed (also via Package Management) to prepare some PHP settings.
Both packages are available from the German forum. Unfortunately, registration is required before you can download them.
You can check if the installation of Init_3rdpartyHelp_1.0.spk has succeeded by going to the main DSM3 start-screen (the little triangle in the top-left of the desktop). You should see PHP Info in the list of programs.See A in the image below.
Starting this program will result in this information-screen:
Now you can install the DDNS updater, again via Package Management.
If the installation succeeded, DDNS Updater can be found in the start-menu (See B in the image).
Start this application to start defining hosts.
Click " Add" to add a host. The following should be entered:
- Provider. The application can communicate with a large number of DDNS providers. Select the one you're using.
- Protocol/Server. Is automatically filled, based on the provider you selected.
- Hostname. Name of the host you created with the provider(for example <hostname>.getmyip.com)
- Wildcard / Static / Custom. These are not used in this example.
- Login / Password / Confirm password. The userid / password you use with the DDNS provider.
- MX Hostname / MX Priority / Backup MX. Not used in this instance, must be filled if you're using your own mailserver.
Press Save. Now start the updater using the green arrow in the toolbar. The screen should look something like this:
I turned of Synology's own DDNS updater completely and now use QTip's updater for all my hosts. This should save some resources on my DS.