Subversive behaviour on a Shared Host

I’m now running a couple of WordPress-based sites. For complete flexibility in the functionality of those sites I’m diving into creating custom WordPress plugins. I want to be organised from the get-go so I’ve decided to manage my code via a hosted private source code repository.  This provides the following benefits:

  • my source code is carefully revision controlled (provided I’m disciplined)
  • my source code repository is hosted on a remote server (which provides a remote backup of my code and the code’s revision history)
  • I can access the repository from my development machine (a MacBook) and my shared hosting account
  • I have a mechanism for updating custom plugins installed in my websites from the hosted repository (after first making and then testing the updates on my MacBook)

I’ve used this sort of setup with a Media Temple hosting account and an Assembla code repository in the past. Media Temple had the advantage of being configured with the subversion client, however that’s not provided with my current hosting provider.

After organising for SSH command-line access to be enabled on my shared web hosting account, I then set about installing the subversion client by following the instructions found here. With a few tweaks to that process, this is what worked for me.

1. Login to the shared hosting account via SSH and download the subversion source tarballs (NB I recommend you download the latest versions):

mkdir _src
cd _src
wget http://subversion.tigris.org/downloads/subversion-1.6.16.tar.bz2
wget http://subversion.tigris.org/downloads/subversion-deps-1.6.16.tar.bz2

2. Extract the contents of the tarballs:

tar -xvjpf subversion-1.6.16.tar.bz2
tar -xvjpf subversion-deps-1.6.16.tar.bz2

3. Build apr, apr-util and neon:

cd subversion-1.6.16
cd apr
./configure --enable-shared --prefix=$HOME
make && make install

cd ../apr-util
./configure --enable-shared --prefix=$HOME \
     --with-expat=builtin --with-apr=$HOME \
     --without-berkeley-db
make && make install

cd ../neon
./configure --enable-shared --prefix=$HOME \
     --with-libs=$HOME --with-ssl
make && make install

4. Build subversion:

cd ../
./configure --prefix=$HOME --without-berkeley-db \
     --with-editor=/usr/bin/vim --with-apr=$HOME \
     --with-apr-util=$HOME --with-neon=$HOME \
     --without-apxs --without-apache
make && make install

6. Provided ~/bin is in your $PATH, you can run the following basic test of the subversion client:

# svn --version
svn, version 1.6.16 (r1073529)
 compiled Mar 14 2011, 00:14:38

Copyright (C) 2000-2009 CollabNet.
Subversion is open source software, see http://subversion.apache.org/
This product includes software developed by CollabNet (http://www.Collab.Net/).

The following repository access (RA) modules are available:

* ra_neon : Module for accessing a repository via WebDAV protocol using Neon.
 - handles 'http' scheme
 - handles 'https' scheme
* ra_svn : Module for accessing a repository using the svn network protocol.
 - with Cyrus SASL authentication
 - handles 'svn' scheme
* ra_local : Module for accessing a repository on local disk.
 - handles 'file' scheme
* ra_serf : Module for accessing a repository via WebDAV protocol using serf.
 - handles 'http' scheme
 - handles 'https' scheme

Now we’re cooking with gas! I now have a subversion client installed on my shared host. This will allow me to remotely access my Assembla repsoitory from my web hosting account command-line.

Assembla provide a great service that was originally free. Users with free accounts were eventually forced to upgrade to a paid service. Assembla have since revised their services and have commenced a generous free source code hosting service with 2GB of storage!  This does not contain project tracking / tickets / multi-user features, however it’s adequate  as I only require a subversion repository. 2GB is well and truly adequate storage for my needs. The Assembla free account also allows multiple spaces (read repositories) to be created. In my case, I will setup one space for each individual theme and plugin I am managing via Assembla.

I won’t explain the process of using subversion here since information on that is covered in some detail by the definitive guide ‘The Subversion Red Book‘.

NB:
I’m a Unix/Linux command-line junkie from way back, however if you’d like to use the TortoiseSVN desktop client, Assembla have these instructions for you.

Posted in Uncategorized, Web Development | Tagged , , , , | Leave a comment

Creating your first WordPress Plugin

I’ve been using WordPress since 2007. I’ve often tweaked themes to achieve basic changes in functionality. Sometimes that’s not the right approach because you’ll lose that functionality when you switch to another theme. A better approach is to put this functionality into a plugin. I first started by hand-crafting plugins from scratch by following the plugin API documentation in the WordPress Codex. That can be a little complicated if you’re new to WordPress development.

Continue reading

Posted in Uncategorized, Web Development, Wordpress | Tagged , , | Leave a comment

Creating a Background Pattern

WordPress 3.1 ships with the Twenty Ten theme. On my site after a standard install it looks like this. The gray background looks a little bland as you can see below.

This site - before

A simple solution to this that is WordPress, maintenance and theme friendly is to create a child theme which overrides the theme’s background. I won’t go into that detail here as I’m using this post to demonstrate one of the great generator tools that’s freely available and easy to use for basic design tasks.

Continue reading

Posted in Web Development | Tagged , , , , | Leave a comment

Finally decided to set up a blog

I’ve been using the internet since 1990. When the web appeared on the scene a couple of years later I was encouraged by friends at Uni to setup a personal website. I never really bothered. Despite my day job (which is incredibly interesting at the moment), I’ve spent the last 8 years developing up to 20 PHP-based sites for other people. In that time I’ve never really maintained a continuous blog. This is an attempt to share some of my website development techniques, deal with my unreliable memory and keep these skills current.

I’ll also use this site to share information on other topics that interest me such as gadgets and Apple stuff. I’m setting up a second site focusing on my more active pursuits. More on that later.

Hopefully some of you will find this site useful.

Why the name of this site …? Maximus is the name of my cat (and I couldn’t think of anything else). It can also be very hard to find any unused domain name these days.

Posted in News, Site News | Tagged , | 2 Comments