Wed 14 May |
|
I'm a big fan of Subversion, not only for storing pure code, but also for documents, CSS files, photoshop assets and whathaveyounot. We're already using SVN in the workplace, but I wanted my own repository for my personal stuff. And as there is a whole lot of bandwidth and diskspace going to waste on my ISP service account, I'd thought I'd get my own private SVN up and running, accessible from my Windows machine (using TortoiseSVN). Here's a short writeup of all the steps I took to get it working. Most is puzzled together from help files and posts on message boards - I copy/pasted and ordered it in a logical fashion here, to get all info together in one place. At least it can serve me in a few months to remember what I did exactly. Most of this information is exactly tuned to how Bluehost works, but I suspect the process at any other decent ISP should prove out to be quite similar.
Step 1: get the dependencies correctSSH accessSSH access is not enabled by default. Get your ISP to enable it for you. They require typically a scanned ID card for prove of identity.
Step 2: install Subversion
Once you got SSH access, we need a SSH client. I'm using putty, and I will presume that's what you'll be doing as well. Download putty.exe from: www.chiark.greenend.org.uk/~sgtatham/putty/download.html Then use your hostname as the host to contact to:
As there's no access to write anything to the webserver's /bin directory (luckily), we'd need to create our own $HOME/bin dir. Here's where we'll install SVN. Note: I tried installing from the latest source tarball that can be found at http://subversion.tigris.org/, but I got errors on missing 'apr' and 'apr-util' (apache portable runtime) packages. Downloading and configuring these got me even further from home. Until I found this post by birdsnare, stickied on the Bluehost support forum. Just copy and paste this (remember to hit return after the last command), and all will get installed for you:
That should have given us a working svn, installed in $HOME/bin. Step 3: create a /svn dir and a first svn repositoryI'm going to have all my svn repositories in one dir, so I created $HOME/svn to store all these: cd Then we create a svn repository for our project 'myproject' svnadmin create --fs-type fsfs myproject There, that's done. Step 4: add the svn binaries to your path on the server, and test it
Use a putty SSH session to add the installed svn binaries to your $PATH environment variable. As found in a lifesaving post by bkohl: There is a way to remotely use a Subversion repository running on your Bluehost account using svn+ssh. It only requires a very simple modification to one file. My .bash_profile had this line: PATH=$PATH:$HOME/bin which I added to my .bashrc file using vi. Once this is done test access to your repository from within the server by doing the following: svn list svn+ssh:// This e-mail address is being protected from spambots. You need JavaScript enabled to view it _DOMAIN.com/home/YOUR_HOME_DIR/YOUR_SVN_REPOSITORY _DIR Step 4: Create a private/public keypairIf you don't want to be bothered by TortoiseSVN asking you to type your password over and over again, each time you access svn (and believe me, you don't), we need a private/public keypair to install a trusted relationship. This info is coming directly from our wiki at work. And that on itself is an aggregation of several other websites out there who explain more or less the same. Step 4.1: Download and install
Step 4.2: create a keypair on the serverFire up putty.exe again (see above) cd make sure to leave the passphrase empty (two times). mkdir ~/.ssh Step 4.3: download the private key file to your computerCreate a directory where you can store your keyfiles in. Should remain on your system, so not /temp or anything like it. Then use WinSCP to copy the private key file to your computer:
You should now cleanup the server and remove your key files cd Step 5: Install TortoiseSVNStep 5.1: Download and InstallGet TortoiseSVN here: tortoisesvn.net Step 5.2: Convert the key for use in putty
Step 5.3: Test the key
Step 5.4: setup TortoiseSVN to use the SSH tunnelOn WinXP, look for a file called: C:\Documents and Settings\YOUR_LOCAL_USERNAME\Application Data\Subversion\config Or on Vista: C:\Users\YOUR_LOCAL_USERNAME\AppData\Roaming\Subversion\config Make sure you uncomment (remove the '#', if there's any) the #tunnels section and add a line like this: ssh = c:\\Program\ Files\\TortoiseSVN\\bin\\TortoisePlink.exe Note the double backslashes and the single backslash to escape the space.
Step 7: checkout the svn repository to a directory on your local harddiskWe're almost there now. Step 7.1: Retrieving files from the repository
svn+ssh://youraccount@yourdomain/home/youraccount/svn/myproject
Step 7.2: Adding files to the repositoryYou can now copy / move / create your files and directories in your local folder, and use the standard TortoiseSVN shell commands to commit and update.
>> Only registered users can write comments! Please Login or Create an account
Powered by !JoomlaComment 3.25
3.25 Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved." |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Last Updated on Friday, 20 June 2008 06:46 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||