Install Subversion on a Shared Host (Outdated)
Monday, September 8th, 2008 · 0 comments
This article keeps getting lost. Let's try and keep it in one place from now on. I may create a dedicated page for it eventually, since my blog is an ever changing void. Please note: This guide is outdated. I've since moved away from shared hosting, and can no longer support it. Anyone is free to follow it at their own risk. The latest release of Subversion is 1.5.2. The guide is meant for 1.4.6, it may or may not work for the latest release.
This is an updated version to my original guide on compiling and installing Subversion (SVN) on a shared host. This guide is meant for the latest stable build as of today (22-12-2007), version 1.4.6.
Subversion
Subversion is one of the most popular version control systems.A Version Control System, or VCS, is simply a piece of software allowing one, or many people to manage multiple versions of the same information. See Subversion's website for more information.
Backup Please!
It's not in my best interests to see your hosting account irreparable. I understand many people are confident (with Linux) enough to proceed without backing up their account, but if you have the slightest doubt then please make a backup. All of the instructions here are offered at your own risk.
Prerequisites
Your shared host must have:
- A Linux based operating system
- Apache web server*
- Have some form of SSH access
* SVN requires the Apache Portable Runtime (APR) libraries built with the Apache web server. If you aren't using Apache see the Without Apache section under Downloading and Extracting.
A basic knowledge of Linux and the terminal are not required, but can be very beneficial for troubleshooting any configuration or compilation errors.
If You Run Into Problems
The very first step I recommend is to read the instructions again. If the problem persists, feel free to leave a comment. Include the error (if any), your host's specs, and any other information you think may be helpful. I'll do my best to help.
The Setup
Login to your account via SSH, and navigate to your home directory.
cd ~/
Having a cluttered desk reduces efficiency. I like to keep everything neat and tidy, and continue that trend into my computer's workspace. Create a folder called src, this will act as a sandbox, where we download, unzip and compile code in one place, rather than all over:
mkdir ~/src
cd ~/src
Downloading and Extracting
The second step is to download the Subversion source code, then extract extract it to its own folder. These lines are best copied and pasted to your terminal, to avoid a typo (if you're not running Apache please skip this section and look to Without Apache).
curl -O http://subversion.tigris.org/downloads/subversion-1.4.6.tar.gz
tar xzvf subversion-1.4.6.tar.gz
cd subversion-1.4.6
Subversion source code is downloaded and unzipped in our src directory.
Without Apache
So you're not running Apache? This can be problematic, as Subversion depends on the APR libraries included with Apache. Fear not though, building the APR requires only two extra lines:
curl -O http://subversion.tigris.org/downloads/subversion-1.4.6.tar.gz
curl -O http://subversion.tigris.org/downloads/subversion-deps-1.4.6.tar.gz
tar xzvf subversion-1.4.6.tar.gz
tar xzvf subversion-deps-1.4.6.tar.gz
cd subversion-1.4.6
Configuring and Installing
If you're Linux savvy feel free to configure SVN to your needs. For everyone else, here's a basic configuration that should meet the needs of an average developer:
./configure --prefix=$HOME --without-berkley-db -with-zlib --with-ssl
Don't panic if you see any warnings about Berkley DB. Now, let's compile the source, and finally, install:
make
make install
To make sure it worked:
svn --version
Something like this should pop up:
svn, version 1.4.6 (r28521)
compiled Dec 22 2007, 18:11:14
Copyright (C) 2000-2007 CollabNet.
Subversion is open source software, see http://subversion.tigris.org/
This product includes software developed by CollabNet (http://www.Collab.Net/).
The following repository access (RA) modules are available:
* ra_dav : Module for accessing a repository via WebDAV (DeltaV) protocol.
- handles 'http' scheme
- handles 'https' scheme
* ra_svn : Module for accessing a repository using the svn network protocol.
- handles 'svn' scheme
* ra_local : Module for accessing a repository on local disk.
- handles 'file' scheme
That means Subversion was successfully installed!
Extending This Guide
Now that you have SVN installed, the next logical step is to setup a repository. O'Reilly has published a free book with all the information to get started, check out Version Control with Subversion.
