I’ve had a GoDaddy hosting account for far too long, but decided to use it anyway, to host an Octopress instance. Yes, I know I can use GitHub Pages or Heroku for free, and they would be much simpler to use. But I felt like taking on a challenge. Below is (roughly) the steps I had to take to host Octopress on a GoDaddy Linux server.
Required Software
I followed the Octopress installation and setup docs as best I could. But if you are trying to setup on GoDaddy, you’ll immediately discover that the GoDaddy Linux servers are missing some essential software – in particular, rsync and git.
First, let’s check what version the server is running and which CPU architecture (32 or 64 bit):
1 2 | |
At the time I ran this command, the returned values were CentOS release 5.5 (Final) and 64-bit (i386 or i686) for the CPU arch.
I then searched online for appropriate RPMS for rsync and git and installed them in my home directory on the GoDaddy server. First with rsync:
1 2 3 4 5 6 7 8 9 10 11 12 | |
Then with git (if you choose to also host your remote git repository):
1 2 3 | |
Note: The URLs above may no longer be valid for the hosting system you use. Make sure you have the right one.
However, it’s still not 100% perfect, since the apps we added aren’t in the path when using a non-interactive session to the GoDaddy server. We need to tell the local app where to look for any of its dependencies on the server. For example, to do a clone of a git repository on that server, it would look something like this:
1 2 3 4 5 | |
Octopress Configuration
In general, I followed the documentation, especially Deploying with Rsync.
In the Rakefile, I had to change how rsync was invoked, in order to specify the necessary --rsync-path:
1 2 3 4 5 6 7 8 | |
Setup Git Repository
I decided to host my own version control repository, again on the GoDaddy server. I followed the instructions here to first set up my remote repository and then to update the git config. One thing different is that I didn’t input the pwd URL as the new repo URL (git config branch.master.remote origin) – instead, I have myexample.com:git/octopress.git, where “myexample.com” is an entry in .ssh/config:
1 2 3 | |
The main reason I created this config file is because my GoDaddy username is different than my local username, and i got tired of always doing ssh -i ~/.ssh/identity myusername@myexample.com. With that config, I can now just type ssh example.com. It’s also useful for the Octopress scripts.
Now, after creating the repository on the server, running any git commands locally won’t work, complaining that it can’t find git-upload-pack. You can fix that by specify that executables location on the server:
1 2 3 4 5 | |
An easier way is to add these to the .git/config file, under the heading for the GoDaddy server:
1 2 3 4 5 | |
With that, it should all work.
References
Here are some sites that helped me with this task: