Install SVN on Bluehost – Complete Step-by-Step

admin 16/03/2011

1. Request SSH access from Bluehost

You’ll need SSH Access, so make sure you request that through the “SSH/Shell Access” option on your CPanel.

2. Download and install Putty (SSH client)

You’ll also need a SSH client, so download the latest version of PuTTY.
[http://tartarus.org/~simon/putty-snapshots/x86/putty.exe]

3. Install Subversion in the server.

Access SSH terminal and execute the following commands:

(Update the version as needed)

# mkdir ~/src && cd ~/src
# wget http://subversion.tigris.org/downloads/subversion-deps-1.6.16.tar.gz
# wget http://subversion.tigris.org/downloads/subversion-1.6.16.tar.gz
# tar -xzvf subversion-deps-1.6.16.tar.gz
# tar -xzvf subversion-1.6.16.tar.gz
# cd subversion-1.6.16# ./configure --prefix=$HOME --without-berkeley-db --witth-ssl LDFLAGS="-L/lib64"
# make && make install

4. Create your repository and verify it

# cd ~ && svnadmin create [your_repository]
# svn list svn+ssh://[user]@[hostname]/home/[user]/[your_repository]

5. Create an authentication Key Par

Type the following commands (You can leave the passphrase empty if you wish)

# ssh-keygen rsa -t

Copy the key to the authorized_key files

# cp .ssh/id_rsa.pub .ssh/authorized_keys

Edit authorization_keys and add the following command  in front of your key

command="/home/USERNAME/system/bin/svnserve -t"

The authorization_key file should look like

command="/home/USERNAME/system/bin/svnserve -t" ssh-rsa AABBcddeEEDDD...[COMPLETE KEY REMOVED]

* Alternative commands

# ssh-keygen -f ~/.ssh/id_rsa_svn -N '' -q
# echo 'command="~/bin/svnserve -t" ' | cat - ~/.ssh/id_rsa_svn.pub >> ~/.ssh/authorized_keys

6. Importing private key to local computer with PuTTyGen
[http://tartarus.org/~simon/putty-snapshots/x86/puttygen.exe]

By  using a ftp client or cPanel File Manager, copy the private key “id_rsa” to a folder of your choice. Open PuttyGen then select the Conversions menu and select Import Key. Find the id_rsa file you just downloaded and import it. After it is imported select the “Save Private Key”button and export the .PPK file to your choosing.

7. Saving a Putty session

Open Putty, fill in “Host Name” with the whole domain, go to SSH and then to AUTH and then select the private key you exported above. You can also insert your default user (auto-login) in the option Connection – Data.  Go back to the sessions option, name your “Saved Session” as “Subversion” and push the Save button. Test your Putty session clicking on Open. If everything is right, you should be logged in without typing your password.

8. Install and configure Tortoise
[http://tortoisesvn.net/downloads]

After installing Tortoise, edit your subversion config file located at
Windows XP:

C:\Documents and Settings\YOUR_LOCAL_USERNAME\Application Data\Subversion\config

Vista or Win7:

C:\Users\YOUR_LOCAL_USERNAME\AppData\Roaming\Subversion\config

Find the section [tunnels] and add the following:

ssh = c:\\Program\ Files\\TortoiseSVN\\bin\\TortoisePlink.exe

 

*Optional: You can also change the subversion config from inside BlueHost.
Edit your subversion config file located at

Bluehost:

~/.subversion/config

Again, inside the section [tunnels] add the following:

ssh = ssh -i ~/.ssh/id_rsa_svn user@hostname ~/bin/svnserve -t #

or
ssh = ssh -q -i ~/.ssh/id_rsa_svn user@hostname ~/bin/svnserve -t #

9. Configure and run Pageant
[http://the.earth.li/~sgtatham/putty/0.60/x86/pageant.exe]

Open Pageant, you should see an icon in taskbar. Right-click the icon, select “Add Key.” and add your private key file previously imported and generated (.ppk).  If you Open up PuTTY again and reconnect using your “Subversion” session. You’ll be asked for your username, but you should no longer have to enter a passphrase.

10. Connect to the repository using Tortoise

Open up Pageant  and add your private key again. Right-click in some folder, select “TortoiseSVN > RepoBrowser”. A dialog box will come up. Type in “svn+ssh://[user]@[domain]/home/[user]/[your_repository] and execute the operation.

That’s it, your repository should be accessible through SSH

Fernando Calzzani

References
http://serverfault.com/questions/182549/subversion-bluehost-and-tortoisesvn
http://www.franklinstrube.com/blog/installing-subversion-on-bluehost
http://www.mikespicer.net/wp/?p=41

About the Author

8 comments

  • March 26, 2011 at 10:05 pm

    Thank you so much for this updated tutorial! I have been using SVN on bluehost for a while now but they recently upgraded one of their libraries so my old SVN didn’t work. I was having trouble installing a new SVN because I couldn’t find the right dependencies. Your technique of grabbing the svn-deps worked wonderfully, however!

    I do have one fix:
    cd subversion-1.6.16# ./configure –prefix=$HOME –without-berkeley-db –witth-ssl LDFLAGS=”-L/lib64″

    should be:

    cd subversion-1.6.16# ./configure –prefix=$HOME –without-berkeley-db –with-ssl LDFLAGS=”-L/lib64″

    (you have two ‘t’s in with”.

    Thanks again, this was super helpful!

    Reply
  • admin
    April 1, 2011 at 3:25 pm

    Thanks Erick! Feel free to ask me about anything, I will do my best in answering. What are your doubts about the last part?

    Reply
  • May 2, 2011 at 8:09 am

    Hi there,

    I have tried the above instructions however fail to run SVN LIST command. The following error comes up;
    bash: svnserve: command not found

    I got no clue on how to make this work now. Any ideas?

    Regards,
    Afzal

    Reply
    • admin
      May 3, 2011 at 3:48 pm

      Hi Afzal

      I guess you must be root to install svn so, before “make install”, please execute the command “su” and type your root password.

      Try it and let me know.

      Fernando

      Reply
  • August 5, 2011 at 8:52 pm

    i keep getting Permission denied and using ‘su’ doesnt work. is there something i missed

    -bash: su: command not found

    Reply
    • admin
      August 18, 2011 at 1:27 pm

      Please, try the command “sudo -s”
      Thanks !

      Reply
  • December 31, 2011 at 11:17 am

    This really helps me. But, I did not get the correct way of doing it. I can’t connect to the repository using Tortoise. No dialogue box will open. I hope someone will help me.

    Reply
  • July 2, 2012 at 11:33 pm

    Not sure if you specified, but for x64 bit architecture, you have some extra steps apparently.

    For those that are getting a compiler error at step 3

    http://joemaller.com/881/how-to-install-subversion-on-a-shared-host/

    Reply

Leave a Reply

*
= 4 + 4