This article demonstrates how to configure Subversion (also known as SVN). This involves setting up repositories on the server, and configuring clients to access them.
- About Subversion
- Creating a repository
- Selecting an authentication method
- Configuring an SVN client
- Microsoft Windows
- Mac OS X and Linux
- More Information
- Related Articles
Subversion, also known as SVN, is a replacement for the Concurrent Versions System (CVS). Like all version control systems, Subversion enables you to track multiple revisions of files and directories. It is installed on all MucaHost Hosting shared servers.
This article only discusses configuring Subversion on an MucaHost Hosting account. It does not explain all of the features or how to use Subversion. See the More Information section below for links about how to use Subversion.
Creating a repository
To create an SVN repository, all you have to do is log in to your MucaHost Hosting account using SSH, and then type the following command:
svnadmin create /home/USERNAME/REPOSITORY
Replace USERNAME with your MucaHost Hosting account username, and replace REPOSITORY with the name of the directory where you want to create the repository (if the directory does not already exist, the svnadmin create command creates it).
Selecting an authentication method
To access SVN repositories on an MucaHost Hosting server from another computer, you must use an SVN client that supports SSH (Secure Shell). HTTP and HTTPS connections are not supported.
SSH supports several authentication methods, including passwords and public-key authentication. Every time an SVN client connects to a repository, it must authenticate using SSH. To avoid the hassle of typing a password over and over, you can:
- Use a SSH password caching tool, such as ssh-agent on a Unix-like system, or Pageant on a Microsoft Windows system.
- Generate a key pair and use public-key authentication.
This article assumes that you will use public-key authentication with SSH and SVN.
Configuring an SVN client
You know how to create an SVN repository, but right now you can only check out and import files directly on the server. Clearly, you will want to set up an SVN client so you can work with repositories from another computer.
Configuring an SVN client to work with repositories is a three-step process:
- Generate a key pair for SSH public-key authentication, and then deploy the public key to the MucaHost Hosting server.
- Configure the SSH client to connect to the MucaHost Hosting server using the private key.
- Configure the SVN client.
The exact steps to do this depend on the client computer's operating system. Follow the appropriate procedures below for your computer's operating system.
Follow these procedures to set up an SVN client if the computer is running a Microsoft Windows operating system.
Steps 1 and 2: Generating a key pair and configuring the SSH client to connect to the MucaHost Hosting server
To complete steps 1 and 2, follow the step-by-step procedures described in this article. After you complete these procedures, you will have a fully-functioning SSH client installation that authenticates to the MucaHost Hosting server using keys. You do not have to type a password to access your account on the server.
- These procedures instruct you to install PuTTY, a popular SSH client for the Microsoft Windows operating system. PuTTY is the default SSH handler used by the popular TortoiseSVN client.
- When you generate a key pair, we recommend that you do not specify a passphrase. The TortoiseSVN client connects to the server many times during a session. If you have a passphrase-protected key pair, you must retype the password every time the client connects to the server.
Step 3: Configuring the SVN client
TortoiseSVN is a popular client for managing SVN projects. The following procedure describes how to set up TortoiseSVN to access repositories on an MucaHost Hosting server.
To set up the TortoiseSVN client, follow these steps:
- Download and install the TortoiseSVN client. You can download TortoiseSVN at http://tortoisesvn.net/downloads.html.
- Start the TortoiseSVN Repository Browser. To do this, right-click on the desktop or on a folder, click URL dialog appears. , and then click . The
- In the URL text box, type the URL to your repository. The URL should be in the following format:
Replace PROFILE with the name of the session profile that you saved in PuTTY when you set up the keys, replace USERNAME with your MucaHost Hosting account username, and replace REPOSITORY with the path to your SVN repository on the server.
- Click . If the connection succeeds, after a few seconds the Repository Browser displays the repository files. You can expand folders to view their contents, and browse different revisions as well. To view a complete list of options, right-click a repository folder in the Repository Browser.
Mac OS X and Linux
Follow these procedures to set up an SVN client if the computer is running Mac OS X or a Linux-based operating system.
Steps 1 and 2: Generating a key pair and configuring the SSH client to connect to the Mucahost Hosting server
To complete steps 1 and 2, follow the step-by-step procedures described in this article. After you complete these procedures, you will have a fully-functioning SSH client installation that authenticates to the Mucahost Hosting server using keys. You do not have to type a password to access your account on the server.
Step 3: Configuring the SVN client
The svn command line client is often the quickest and easiest way to interact with SVN, although there are GUI-based clients as well. In either case, however, clients use SSH to access SVN. For security reasons, Mucahost Hosting uses custom port 7822 for SSH connections instead of the default port 22. Therefore, whichever Subversion client you use, you must configure it to use port 7822 for SSH.
The easiest way to do this is to create a custom protocol for Subversion that is only used for MucaHost Hosting servers. This allows you to still use the regular svn+ssh protocol for other servers that use standard port 22 for SSH.
To create a custom SSH protocol for Subversion, follow these steps:
- On the client computer, open the ~/.subversion/config file in a text editor.
- Locate the [tunnels]section, and then add the following line of text:
mucahost = ssh -p 7822 -q
- Save the changes and exit the text editor.
You can now use the custom protocol svn+mucahost:// to access a SVN repository over SSH. For example, the following command demonstrates how to check out files from a repository on an MucaHost Hosting server to your client computer. Replace both instances of USERNAME with your MucaHost Hosting account username, example.com with your domain name, and REPOSITORY with the path to the repository:
svn co svn+mucahost://USERNAME@example.com/home/USERNAME/REPOSITORY
- For more information about Subversion, please visit http://subversion.apache.org.
- To view an online book about Subversion, please visit http://svnbook.red-bean.com. This book includes a quick start guide that explains how to create a repository, import files, and check out files.