NuncaMind

Setting Up a Linode Server for Octopress

This website is run on a Linode server and is powered by Octopress. I previously walked through setting up Octopress, and figured I should document my steps for setting up my Linode server to help others who might consider doing the same. Below are the steps that I followed and links to the resources I used.

Sign Up for a Linode VPS

If you use my referral link it helps me out.

Install Ubuntu 10.04

Installing Ubuntu to your Linode server is a very simple process. Here’s the official documentation if you need any help. I chose Ubuntu 10.04 because I was familiar with it and because it is the newest Long Term Support release.

Set Up SSH Authorized Keys

I followed this guide to set up ssh authorized_keys. This allows you to log in from your main machine without having to type in a password each time.

Set Up Apache

With Octopress you don’t need MySQL or PHP, so you only need to install and setup Apache. I followed these instructions on Linode. Only follow up to and not including the ”Install and Configure the MySQL Database Server” step.

Install Rsync

I love package management in Linux.

1
sudo apt-get install rsync

Deploy Your Octopress

Octopress has good documentation on how to deploy on your own server using rsync.

Create a Git Repository Locally

I chose to back up my Octopress folder using git in order to be able to roll back any accidental or regrettable changes I make to my installation.

1
2
3
git init
git add * 
git commit -m "initial commit"

After my initial commit, I have elected to use Gitbox to manually edit my commits. It’s easier to use than the command line and I feel more secure that I’m doing what I think I’m doing, which is pretty important when it comes to version control.

Backup Your Octopress On Dropbox

As I mentioned in a previous post on symbolic links, it’s easy to use symbolic links to get Dropbox to back up a directory not in the Dropbox folder.

1
ln -s ~/octopress ~/Dropbox/octopress

Install Apache Modules For Caching

In order to enable caching, you have to enable the mod_headers and mod_expires modules. As described here, they can be enabled quite easily.

1
2
3
a2enmod headers
a2enmod expires
/etc/init.d/apache2 restart

Enable Caching Via .htaccess File

I set my site’s root .htaccess file to be identical to Matt Gemmel’s (check near the end of the post), and so far have had no problems.

Change A Record on Hover to Point to the Linode Server

Now for the DNS fun. I’ve registered this domain using Hover, so I followed their directions to change my A record to point to my new Linode server.

Change Records on Linode

I then followed Linode’s guide to configuring the DNS on Linode’s end.

Change Nameservers on Hover

Finally, I was able to change the nameservers on Hover to use Linode’s nameservers (ns1.linode.com, ns2.linode.com, etc.)

Set Up VNC

In a pinch, I wanted to be able to VNC in to my server and treat it like a normal home Ubuntu installation. I followed this guide to get VNC up and running, and connect remotely on my Mac using the free Chicken of the VNC application.

After these steps, I now have a fully deployed website with a custom domain. It is running an Octopress instance that is easy to deploy, backed up in version control manually, and backed up automatically via Dropbox. I also set up caching so that my site will not crumble if it gets an unexpected traffic spike, and enabled VNC so that I can connect remotely. Not bad for a half day’s work.