SVN over HTTP on (mt) DV 3.0

In five steps, you can set up an Apache-served, Subversion repository on a MediaTemple (mt) Dedicated Virtual Server.

Prerequisites

  • (mt) DV 3.0 account provisioned with Apache 2.0 and Subversion 1.1.4 or higher
  • root access via SSH and Plesk
  • basic understanding of UNIX permissions
  • prior experience configuring Apache and Subversion to work together

1. Create a subdomain

  1. Via the browser, log in to Plesk and navigate to General » Subdomains
  2. Select a domain and opt to add a new subdomain
  3. Name the subdomain (e.g., 'svn-test') and click Save
  4. Log out of Plesk

2. Create a repository

  1. Via SSH, log in to the domain (e.g., 'mydomain.com') of the subdomain created in Step 1
  2. Create a new repository (e.g., 'repos') in the directory of the subdoman like so:
    svnadmin create /var/www/vhosts/mydomain.com/subdomains/svn-test/repos
    
  3. Set ownership:
    chown svn:psaserv /var/www/vhosts/mydomain.com/subdomains/svn-test/repos
    

3. Configure Virtual Hosting

  1. Create a vhost.conf file for the subdomain containing something like:
    <Location>
    DAV svn
    SVNPath /var/www/vhosts/mydomain.com/subdomains/svn-test/repos
    AuthType Basic
    AuthName "Subversion Repository"
    AuthUserFile /etc/svn-auth-file
    Require valid-user
    </Location>
    
  2. Save the file as
    /var/www/vhosts/mydomain.com/subdomains/svn-test/vhost.conf
  3. Update the Apache configuration with the subdomain configuration like so:
    /usr/local/psa/admin/sbin/websrvmng --vhost-name=svn-test.mydomain.com
    
  4. Restart Apache
    /usr/local/psa/admin/sbin/websrvmng --restart
    

4. Check in code

  1. Import your code. For example, on my local file system, I have a tmp/ directory containing code in the conventional trunk/, branches, tags/ layout. I'll import it like so:
    import tmp/ http://svn-test.mydomain.com --username=hank
    

5. Verify

  1. Browse to it: http://svn-test.mydomain.com
Posted at 22PM on 01/15/08 | 0 comments | Filed Under: Technology | read on

About

How to do one thing at a time.