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.

No related posts.

This entry was posted in Uncategorized, Web Development and tagged , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>