How to Install Subversion on a Shared Hostmonster Account
I’ve been using Hostmonster to host this site for about a year and a half now. I applied for SSH access, which requires a scan of a legal ID, a while ago, and today I needed to install Subversion by logging in via SSH. Hostmonster does not use Ubuntu for their servers, so apt-get was out of the question. I contacted Hostmonster support about this, and although they said they are unable to provide support for 3rd party software, they were very quick to respond and provided me with a link that might help. After some Googling, I came upon this post in a forum topic somewhere. Unfortunately the post was made in August of 2007, so the versions listed for some of the files are quite out-of-date. I couldn’t find any recent guides, but I wasn’t going to quit there.
I’m no Linux expert; in fact, I hardly know my way around the command line. I have messed around with Ubuntu, though, so I had knowledge enough to figure out what I needed to do. I now have a successful install of Subversion! Here is how to get it all working on a Hostmonster shared account. Note that this should work with Bluehost as well since they are related. Please forgive my terminology here. As I mentioned, I’m not really good with Linux, but I’ll do my best to explain.
First, we need to get two Apache tarballs that are required for building Subversion from source since they aren’t included in the Subversion tarball. They are both part of the Adobe Portable Runtime Project. We need APR and APR-util. As of this writing, the latest versions are 1.3.6 and 1.3.8 respectively. To find the download locations for the latest version, go to the download page and find the apr-[version].tar.gz and apr-util-[version].tar.gz files. You will need to use the download URLs for these to get the latest versions. Here are the commands to install these using a terminal. Replace the URLs and filenames to match those that you found on the download page.
1: mkdir ~/src
2:
3: cd ~/src
4: wget http://www.axint.net/apache/apr/apr-1.3.6.tar.gz
5: tar -xzf apr-1.3.6.tar.gz
6: cd apr-1.3.6
7: ./configure --prefix=$HOME
8: make
9: make install
10:
11: cd ~/src
12: wget http://www.axint.net/apache/apr/apr-util-1.3.8.tar.gz
13: tar -xzf apr-util-1.3.8.tar.gz
14: cd apr-util-1.3.8
15: ./configure --prefix=$HOME --with-apr=$HOME
16: make
17: make install
Next we need to find the latest version of Subversion to download and build. You can find a link to the latest version right on the home page for Subversion. As of this post, the latest version is 1.6.3. You will need the link to the .tar.gz file under Source Code. Here are the commands to get us started. Even if you know what you are doing, do not go any further than this yet because we need to do something else first. Replace the URL and filenames to match those that you found on the download page.
1: cd ~/src
2: wget http://subversion.tigris.org/downloads/subversion-1.6.3.tar.gz
3: tar -xzf subversion-1.6.3.tar.gz
When I first tried to configure Subversion as we will do soon, it gave me an error saying that it needs SQLite. It said to download the SQLite tarball and copy the sqlite3.c file from it to a sqlite-amalgamation/ subdirectory under the Subversion folder we just unpacked from the Subversion tarball. The latest version of SQLite can be found on the SQLite download page. You need the sqlite-amalgamation-[version].tar.gz file; it should be the second file in the Source Code category. As of this post, the current version is 3.6.16. Here are the commands to get the file we need from this tarball. Don’t forget to replace the URL and filenames with updated ones if you are using newer versions.
1: cd ~/src
2: wget http://www.sqlite.org/sqlite-amalgamation-3.6.16.tar.gz
3: tar -xzvf sqlite-amalgamation-3.6.16.tar.gz
4: cd sqlite-amalgamation-3.6.16
5: mkdir ~/src/subversion-1.6.3/sqlite-amalgamation
6: cp sqlite3.c ~/src/subversion-1.6.3/sqlite-amalgamation
Now we are ready to configure and build Subversion. Here are the commands to do so. As before, update the folder name accordingly.
1: cd ~/src/subversion-1.6.3
2: ./configure --prefix=$HOME --without-berkeley-db --with-zlib=/usr --with-ssl
3: make
4: make install
We’re all done! Use the following commands to make sure Subversion is now installed. Note the double dash in the second line.
1: cd
2: svn –version
You should now be able to use Subversion on your shared hosting account with Hostmonster or Bluehost. Many thanks to the original guide that provided the basis for my findings and to all the other places I don’t remember where I found some other bits and pieces that made this possible.
I hope this saves somebody else the hassles I went through trying to find this information!
Thanks for the great tutorial Compeek!
At this point though (excuse my ignorance) I’m at a standstill.
I have SVN installed (so it seems) and the svn –version works (giving me the version ofcourse)..
I just do not know how to ‘access’ this through..say… Tortoise SVN client!
How do I make it accessible via Apache (i suppose!) so that I can point the SVN Client on my dev box to a URL (where?!) so that I can create repos on that URL and checkout/commit files from there!
Basically when I open the SVN Client on some machine to browse repos – what do I type in as the address??
Any help would be appreciated! Thanks
@Arvind
Hey Arvind! I’m glad my tutorial helped.
However, it’s been a half of a year since I set up SVN, and about the same time since I’ve actually used SVN. I’m afraid I’m not sure how to do what you’re trying to do. In fact, I’m not sure I ever even managed to access the SVN repositories from another computer when I originally set it up. I’ll get back to you if I figure it out, but for now, I don’t think I can be of any help.
Good luck with it, though, and I hope you figure out something!
Hi Compeek,
I recently had an account with hostmonster & tried installing subversion. The apr installation went well, sqlite was also ok. When i tried making subversion, guess default libraries from /usr/include conflicted with my new ~/include/ files.
I am no makefile guy so i tweaked the Makefile & removed instance of /usr/include at all the commands. Svn installed with make & make install then.
Thanks for the pointers. The other places are too old to be able to help me much.
Thanks for the thorough instructions. Just wanted to report that it didnt work for me on hostmonster. I’m sure because this article is older things have changed. I got an error on the ‘make’ command -
/usr/lib/libexpat.so: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make: *** [subversion/libsvn_subr/libsvn_subr-1.la] Error 1
Hello,
I have followed your every step. But every time I run ‘make install’ it gave error.
Secondly, for last ‘make’ command for subversion step: it showed me this error: “/usr/lib/libexpat.so: could not read symbols: File in wrong format”,
collect2: ld returned 1 exit status
make: *** [subversion/libsvn_subr/libsvn_subr-1.la] Error 1
Even for ‘make install’ command, it’s the same message shown. Please help.
@Dave
I’m not really qualified to know what’s wrong, but you’re probably right; things have changed since I originally wrote this. However, check out this thread: http://www.bluehostforum.com/archive/index.php/t-8191.html About mid-way down, it looks like people were figuring out how to fix the same problem you had.
@Md. Sajjadul Farooque Robin
I just replied to Dave’s comment with this, but take a look at this thread: http://www.bluehostforum.com/archive/index.php/t-8191.html Hopefully you get it figured out! I’m not a Linux expert by any means, and it’s just been too long for me to know how to figure this out, but the people in that thread seem to have some solutions.