I’ve hosted this site and several others LiquidWeb’s shared servers for probably eight years. They are without question, the most dependable host I’ve ever used. [see update]
But LiquidWeb doesn’t offer Subversion. And I will no longer do web work without it.
For some time I’d been considering leaving LiquidWeb because the lack of svn was now hindering work on my own sites. For the same reason, I’ve had to pass them over several times when clients asked for hosting recommendations. Then the other night, I stumbled across a discussion about installing Subversion on a shared host. Why didn’t I try that years ago?
Installation Instructions
These instructions assume basic proficiency with the Unix command line. Note that the goal is to install the SVN client, plan on hosting your repositories somewhere else.
Connect to your account with ssh and create a working directory, mine’s called _src:
cd mkdir _src cd _srcNext, use wget to pull down the subversion sources. You could also use curl, but wget does the same with less typing. Choose a version from this list of Subversion sources. The parallel “subversion-deps” download includes all dependent sources required to build Subversion.
点击(此处)折叠或打开
- wget http://subversion.tigris.org/downloads/subversion-1.4.6.tar.gz
- wget http://subversion.tigris.org/downloads/subversion-deps-1.4.6.tar.gz
Next, untar the sources and dive into the directory:
tar -xzvf subversion-1.4.6.tar.gz tar -xzvf subversion-deps-1.4.6.tar.gz cd subversion-1.4.6One step, maybe (32-bit?)At this point, depending on your server configuration, you might be able to install with the following two commands:
./configure --prefix=$HOME --without-berkeley-db \That worked on some servers but not others, I spent many hours clumsily trying to figure out why. I found that the build process was linking to external libraries instead of the ones in subversion-deps, despite the configure directives.
On the 64-bit server (x86_64) this was a big problem, even though everything worked normally on two 32-bit (i686/i386) servers. Check server architecture with either arch, uname -a or cat /proc/cpuinfo. The solution for 64-bit machines is to build the three main components beforehand and then tell Subversion where to find them.
Build them, use them (64-bit?)The following commands systematically build each of the three shared libraries from the Subversion-deps sources. This should guarantee that the files Subversion links to will be compatible. In each step, we explicitly enable compilation of shared libraries and prefix the files into our home directory. This looks worse than it is.
Build apr, apr-util and neon, in that order:
cd apr ./configure --enable-shared --prefix=$HOMEWith those out of the way, we can now configure and build Subversion. According to the notes in Subversion’s configure file, the --with-ssl flag is not necessary since it’s just passed to neon and we already built neon. --without-apxs and --without-apache prevent Subversion from trying to install its Apache modules. Remember to point to the libraries we just built (in $HOME): (note: you may need to add the --without-serf flag as well, see this comment)
cd ../ ./configure --prefix=$HOME --without-berkeley-db \Subversion should now be installed! It’s likely you already have :~/bin in your user $PATH, if so, you can try it out right away:
svn --version svn, version 1.4.6 (r28521) compiled Jan 29 2008, 11:05:47So far, I’ve run this against two LiquidWeb shared accounts, one LiquidWeb CPanel container on a VPS and a HostingMatters shared account running JailShell. After some limited testing accessing different repositories with https and svn+ssh, everything seems to be working.
Now I just need to figure out where to put my repositories, here are some free Subversion hosts I’ve used or are considering:
- Beanstalk 20 MB free
- Assembla 500 MB free?! really?
- Unfuddle 15 MB free
- Google Code 100 MB free, must be open source
Two other sites which aren’t free, but I’m keeping in mind for the future: Wush and Project Locker.
The getting there was the hardest partWhile I was finally able to streamline this down to a fairly simple process, it was not easy to get there. I don’t do much compiling from source, so I’m very clumsy about troubleshooting. If any of these steps can be simplified, please leave a note.
Here are some of the errors I saw along the way: /usr/lib/libexpat.so: could not read symbols: File in wrong format /usr/lib/libexpat.so: could not read symbols: Invalid operation /home/joe/_src/subversion-1.4.6/neon/src/.libs/libneon.a: could not read symbols: Bad valueThe first two errors indicate that the build had grabbed the 32-bit libexpat from /usr/lib instead of the 64-bit version from /usr/lib64. However, redirecting to the 64-bit libraries introduced other problems such as the libneon.a bad value error. As mentioned above, what I needed to do was pull libraries from the subverson-deps code. To use those, I needed to compile each one first.
Resources:- Subversion’s INSTALL file
- ./configure -help
- These commands, from this original post almost worked.
- Installing Mephisto and Subversion on a Shared Host, first inkling this was possible
- similar problem with with /usr/lib instead of /usr/lib64.
- GATTAGA’s post was the first clue about working around the libexpat problem.
- SVNforum: libneon.a: could not read symbols: Bad value This was the post that gave me the final bit of information I needed
Related: How to install Git on a shared host
Update, November 2010: Sometime this year Liquid Web disallowed compiler access. I now host my sites at WebFaction and A2 Hosting.