Blogger and Linode VPS - Part 1: Custom domain setup

The main website of 24 Hour Apps is powered by Blogger. I will be writing about the process it took me to set up everything in the hopes of making it easier for someone else. I believe Blogger is a very good blogging platform due it the small about time required to get it working with 80% of functionality that most blogs need.

The first step is creating a Blogger account, creating a blog, then setting it up to use a custom domain name. Blogger has good help articles on how to achieve this so I won't re-write their instructions, however you should ignore advice about adding CNAME DNS records.

On the Linode side you need to Add a new domain zone for your domain, or if you have already done it click Edit on the domain you want to change. You should have Linode automatically insert default DNS entries to start you off, you need to do this because Linode will sort user added entries alphabetically which makes it difficult later on to do things like add wildcard and blank subdomains.

While Blogger instructions say that a CNAME record is required it is not an ideal solution for Linode's DNS service as it orders A/AAAA records before CNAME records which means if you have a wildcard hostname it will never reach the Blogger CNAME record. The solution to this is to add the wildcard host name first then edit the blank and www host name records (created by default by Linode) to point to; the IP address of the server.

After waiting up to 15 minutes for Linode's name server to update you can test your results from your shell account by typing dig and if it shows then everything is good to go. All you need to do now is wait for your domain name server to receive the changes to view your Blogger hosted blog from your domain.

As a final tip you should tell blogger to redirect to automatically to prevent any duplicate content penalties in Google.

Setting up a website with Linode

This is my first website with Linode and I have been quite happy with the experience. This post will explain how quickly it was to set up a functioning website on the VPS service.

Setting up Linux
The first step in setting up a Linode server is choosing the Linux distro and installing it on your available space. I chose Ubuntu 8.04 LTS as previous experiences with older Ubuntu servers made me realize that constant upgrades on a server is not really that desirable. Linode have their own Linux images available to the user and the Ubuntu image installed very quickly with only SSH enabled. Within 10 minutes I was able to log in to the root account with no problem.

Setting up the server

Having a basic server with only SSH makes sense as not all users may require the full LAMP stack and may simply wish to host a database, web, or etc. server on their node. However in my instance I needed the full LAMP stack and get it set up quickly using the following commands:
  • apt-get install ubuntu-standard - Updates Linode's minimal Ubuntu install to something most experienced users of Ubuntu are more accustomed to.
  • apt-get install lamp-server^ - Installs the full LAMP stack needed to host a website.
  • a2enmod rewrite - Enables mod rewrite.
  • dpkg-reconfigure tzdata - Set the correct timezone.
Some of the above will take longer to run than others and apt-get will also ask you to confirm whether you want to download the X MB of packages as well as set up your root MySQL password. But Ubuntu's comprehensive packages really shine here so not much work is needed. Now you have a fully functioning LAMP server ready to host web pages and applications.

To make the server available to the web the DNS entry must also be configured. Linode makes this very easy by providing their own DNS server and web-based interface; which can be quite limiting at times, but that is for another post.

The Linode DNS servers are,, etc. up to Set this as the location of your DNS servers in your domain name registrar's settings. I use GoDaddy for my registrar that allowed editing of these settings in their domain name manager web app.

Once you have set up your domain name's DNS records you will need to Add a new domain zone in Linode Manager's DNS Manager. It is very easy to spot once you login. Linode is pretty good with documentation and following their hints in setting up a domain zone will give you a pretty complete zone file that points to your server.

Once you have added the zone file you will need to wait for Linode's DNS servers to refresh, which takes up to 15 minutes, then you can check your settings by typing from your root account dig If your settings were right you should see the answer section's record showing the correct server IP for your server. Then it is just a matter of waiting for your ISP, or switch to Open DNS, to update their server records. I find Open DNS normally gathers updates within an hour while ISPs can take up to two days.

Setting up the website

Although this is not related to Linode and many sources abound for information on how to set up a website in Ubuntu I will add it here for completeness' sake.

The first step is to add a new user for the website's account. You can do this by typing adduser username with username being the desired name for the website's user. After you set the password you can login as the user and create a directory such as www and a basic index.html file.

As root, go to /etc/apache2/sites-available then create a file called Enter the following into the file:
NameVirtualHost *
DocumentRoot /home/username/www/

Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all

Replace all occurrences of mydomain, username, and www, with the relevant real values and save the file. Then in /etc/apache2/sites-enabled type:
rm 000-default
ln -s ../sites-available/
/etc/init.d/apache2 reload

Now try in a web browser and you should see the contents of index.html. The first line of rm 000-default is only needed to remove the default Ubuntu Apache virtual host entry for new sites you add to your server it is not required.

For those with dynamic websites that need database access, check out Slicehost's article on creating MySQL users.

Project zero

Welcome to 24 hour apps. This is a place for me to publish and write about my projects. The goal of this web site is to:
  1. Create usable applications in 24 working hours
  2. Create one application a week for 52 weeks in 2009
  3. Open source all applications
  4. Share knowledge gained through development
  5. Take the most efficient path to the desired result
I have already accomplished my first project of setting up a web site and a blog to publish information. Hopefully all goes well next year too.