Sooty Solutions - Burnaby BC Consulting Company - Advising Business Managers on Security, Information Technology, Business Process Performance, & Best Practices
Sooty HomeContractors are BetterThe Sooty ApproachLong Range PlanningThe Sooty PartnersContact Us

Setting up a Web Server in Your Basement

Part 3: Connecting your Domain Name to Your IP Adress

Secure Console and File Copies
Time to get off the server console and log in with secure shell (SSH) from your Windows computer. This allows you to cut & paste command strings to the server and cut & paste stuff from the server into your documentation (you are docmenting all this aren't you?)...or into Google when things go wrong. It also allows you to pull the screen and keyboard off it and put it on a shelf somewhere like a proper server (all it needs is a power cable and an ethernet cable).

I use an SSH client called PuTTY which has both an encrypted console client (PuTTY)and an encryptped file transfer client (PSCP). Get your copy at http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html. If the link fails Google "PuTTY" and see if it's been moved. Or pick up it up from my putty.zip copy.

There is no installation...just make a C:\Putty directory and copy the contents of the ZIP file into it. I'd make a shortcut my desktop to C:\Putty\PUTTY.EXE and change the icon to the one in the PUTTY.EXE. When you run you just make sure you are using port 22 (SSH) and enter the address of your server (192.168.0.99). It should look like this:


When you first connect to your server there is an exchange of encryption keys...just accept the key. This key will work for both the PuTTY console and the PSCP file copy.

Subscribing to an DNS Provider
This part is tricky because is depends on the provider you choose. I'll first do the free NO-IP sevice then the EasyDNS service. I am using EasyDNS because it can transfer and register .ca domains. If your domain has a country suffix you'll need to find a provider that handles the suffix. If you have a global suffix (.com, .net, .org) you can pretty much use any provider.

Google "No-IP" and take the "No-IP Free" link. Give them your email address and when they send a confirmation link set up your free account. I set mine up on syte.net so my website is at sooty.syte.net. Select the simplest type "DNS Host(A)and enter your ISP ip address. In a few hours the DNS will propigate acress the internet and you'll be able to access your server website using your No-IP name. Easy...except for having to log in once a month and update the account information.

If No-IP is able to handle your registered domain name (they don't do .ca) then you can upgrade the account to use your domain name for $15. They provide their own dynamic DNS client for Linux. Cheap...I can't use their service so I can't confirm this is the only cost. Setting up sooty.ca on EasyDNS was about as easy as No-IP but the $15 service is only for static ip addresses...I have to pay $35/year for the upgrade that allows dynamic ip address. You can buy a static ip address for $15/month (ouch) so it's cheaper to stay with the dynamic ip and pay for the upgraded DNS service.

Install the DNS Updater Client
EasyDNS does not have their own Linux client (the thing that updates the ip address at the provider) but there a re a lot of free ones available. When chosing a client make sure it includes the provider protocol. The one I used was ez-ipupdate which supports EasyDNS (and others .

I could not get ddclient which supposts many protocols to work. It installed fine, ran without logging any errors, but did not update my EasyDNS account.

sudo apt-get install ez-ipupdate will install ez-ipdate. apt-get is the way ubuntu systems go out to the internet and download the latest software packages. The install keyword means "install it after you download it". The installation finishes by bringing up the wizard that builds the configuration file. Answer all the questions (protocol, dailup?, account name, account password, domain name, and enet interface). This will build a configuration file that only runs once and sends 192.168.0.99 to your DNS provider. This will clearly not work...so you have to manually edit the configuration file.

A note on sudo. You will see this in front of all of the commands. By default ubuntu keeps the adminstrative user in a safe normal user mode. You have to "SUperuser DO" commands if they could harm the system in any way. A superuser is usually called a root user because in older linux versions system maintenance was done by loggin into the root account. In ubuntu there is no root account. You must provide a password to enter this mode and it "times out" so you'll often have to provide your password to sudo things.

sudo nano /etc/ez-ipupdate/default.conf to bring up the nano editor and change the (little) conf file to make the client useful.

First add a line with the keyword "daemon" to file. This means run the client continuously (600 second update) as a background task.

To get EasyDNS the ISP address I had to add the line "address=1.1.1.1" to the end of the file. This tells EasyDNS not to use the address in the transmitted packet (192.168.0.99) but use the address (like 70.79.139.238) that sent the transmission. If you use a different DNS provider you may need a different method.

Now ez-ipupdate only does one domain per conf file. You need at leastthree. In my case that is "www.sooty.ca" "sooty.ca" and "mx.sooty.ca" so I need three conf files. The nice thing about ez-ipupdate is if you put three conf files in /etc/ez-ipupdate directory it will start a separate daemon for each conf file.

I removed the default.conf and added in three files; www.sooty.ca.conf, sooty.ca.conf, mx.sooty.ca.conf.

An example of my conf file for sooty.ca is:
sudo cat /etc/ez-ipupdate/sooty.ca.conf

#!/usr/sbin/ez-ipupdate -c
###
### Default ez-ipupdate configuration file - EDIT WITH CARE
### Use `dpkg-reconfigure ez-ipupdate' to update the debconf-generated lines.
###
### The following lines were generated by debconf

service-type=easydns
#server=(default)
user=mumbleuser:mumblepassword
host=sooty.ca
interface=eth0
#wildcard
#mx=(none)
run-as-user=ez-ipupd
cache-file=/var/cache/ez-ipupdate/default-cache
daemon
address=1.1.1.1

Now start ez-ipupdate:
sudo /etc/init.d/ez-ipupdate start

Note that ez-update is in the /etc/init.d directory. This means every time the server reboots ez-ipupdate will run and create the three client daemons...and we are fully automated.

With the DNS provider pointing traffic at our server it's now time to put some content in it.

Next...Part 4: Set up your web site (HTTP server)

Part 1: Back to server installation (LAMP configuration)

Part 2: Back to router configuration

Part 5: Set up file upload/download (FTP server)

Part 6: Set up mail server (SMTP/MX server)