I recently installed Subversion on my hosted server, Hostmonster.
Here are the steps I took:
- Install
- Create a repo
- Create a project
- Import project
- Test
- Checkout a copy of your project
1. Install
The first step is to install Subversion on your server.
- Connect to your account with ssh and create a src directory
mkdir src cd src
- use wget to get the subversion sources
wget http://subversion.tigris.org/downloads/subversion-deps-1.6.11.tar.gz wget http://subversion.tigris.org/downloads/subversion-1.6.11.tar.gz
- untar the sources
tar -xzvf subversion-deps-1.4.6.tar.gz tar -xzvf subversion-1.4.6.tar.gz
- go into the subversion folder
cd subversion-1.4.6
- install with following commands
./configure --prefix=$HOME --without-berkeley-db --with-ssl --with-editor=/usr/bin/vim --without-apxs --without-apache make && make install
..and if a 64-bit server you need to build three main componentts and tell Apache where they are
cd apr ./configure --enable-shared --prefix=$HOME make && make install cd ../apr-util ./configure --enable-shared --prefix=$HOME --with-expat=builtin --with-apr=$HOME --without-berkely-db make && make install cd ../neon ./configure --enable-shared --prefix=$HOME --with-libs=$HOME --with-ssl make && make install
- Configure subversion
cd .. ./configure --prefix=$HOME --without-berkeley-db --with-editor=/usr/bin/vim --with-apr=$HOME --with-apr-util=$HOME --with-neon=$HOME --withou-apxs --without-apache make && make install
- check to see that subversion is installed
svn --version
- if installed successfully, you should see something like this:
svn, version 1.6.15 (r1038135) compiled Dec 6 2010, 12:13:48 Copyright (C) 2000-2009 CollabNet.
2. Create a Repo
- Create a repo
svnadmin create path/to/repo/name
- The easiest way is to cd into the directory you want to create your repo in, and then do svnadmin create reponame
3. Create a Project
- cd into your repo and create project directory
cd path/to/repo mkdir projectname
4. Import Project
cd path/to/projectname svn import file:///full/path/to/projectname
Checkout repo
svn checkout file:///path/to/repo
-Create files – either create new files in your repo or copy them over from somewhere else
- Add files to repo
svn add *
- Commit files
svn commit * -m "log message"
And that should be it
5. Test
Now, do a test run. Create a test folder and checkout your project
mkdir testfolder/ cd testfolder/ svn checkout file:///full/path/to/projectname
If that worked successfully, now you can move on to doing the same thing to your public_html folder, but first, make a backup of your files just to be safe
6. Checkout a Copy of Your Repo
- Delete everything in your public_html folder (or whatever folder you’re working on)
cd ../public_html rm -rf *
- Checkout your repo
svn checkout file:///full/path/to/projectname
That’s it! Now, you can make changes in your projectname folder, commit them, and when you cd into your public_html folder you should be able to see the changes to be updated:
To see the changes:
cd public_html svn stat -u
To update all the changes:
svn up
Because I have multiple websites on my hosted server, I will need to set up my repos a little bit differently, but following the steps above should work for you if you have one site hosted on Hostmonster.






