Stealth subversion install - access over SSH...
Submitted by dave on Thu, 11/15/2007 - 18:18
Want to use SubVersion but only have access to a box via SSH? Maybe you've got a cheap web hosting account and the host hasn't gotten with the program to officially offer SubVersion as a feature? This post outlines a way to install SubVersion server and have your client access the repositories via SSH. Pros:
- If you've got SSH access and rights to compile some code, you can get SubVersion running. I was able to do this on a cheap Bluehost.com account.
- You can access your repository from anywhere. You don't have to rely on being connected to local filesystems or a WebDAV enabled server.
- SubVersion is a rocking version control system.
- Your checkins will be tagged with the user account of the SSH user. Most web hosts only give you 1 SSH login. This can be not so great if you have multiple developers but just 1 login.
- Client access can be trickier than local file access or WebDav access.
- You may have to set up a SSH tunnel manually depending on what client you use.
- The url you have to use is a pain to remember.
- Performance, this is not the optimal scaling solution for a SubVersion installation.
mkdir ~/src2 ) Install APR
cd ~/src wget http://www.mirrorgeek.com/apache.org/apr/apr-0.9.16.tar.gz tar -xzf apr-0.9.16.tar.gz cd apr-0.9.16 ./configure --prefix=$HOME make make install3 ) Install APR-Util
cd ~/src wget http://www.mirrorgeek.com/apache.org/apr/apr-util-0.9.15.tar.gz tar -xzf apr-util-0.9.15.tar.gz cd apr-util-0.9.15 ./configure --prefix=$HOME --with-apr=$HOME make make install4 ) Get and make Subversion
cd ~/src wget http://subversion.tigris.org/downloads/subversion-1.4.5.tar.gz tar -xzf subversion-1.4.5.tar.gz cd subversion-1.4.5 ./configure --prefix=$HOME --without-berkeley-db --with-zlib --with-ssl # at this point there's a bit of complaining about berkeley db, let's ignore that... make make install5 ) Test it!
cd ~ svn --version svnadmin --version6 ) Create a repository
cd ~ mkdir svn cd svn mkdir test svnadmin create /home/[user]/svn/test7 ) Update path You may need to update your path (like in .bashrc) to make sure the /home/[user]/bin directory is included. This will be required so sshd can find the Subversion binaries. 8 ) Login via svn+ssh From here on out you can use SubVersion with your favorite client. Right now my favorite Windows client is Tortoise. Its got built in support for PLINK so you don't have to do any fancy tunneling junk manually. If you use a different client you may have to do some VPN tunneling magic. There is an article that covers that here and here. Just remember if you're working on Windows, putty is your friend (along with its related utilities like plink). Import some code into your test repository, then check it out. The url you will use needs to look like this (replace the items in square brackets with values for your setup):