Quick Recipe – Setting up a Subversion Server to be Accessed via HTTP in Ubuntu

If you are having enough background, this article is a shortcut for you to set up a subversion server.  You could always refer to this article for more details.

Assumed you are given:

  1. An installation of Ubuntu Linux with access to APT repositories via network.
  2. Installed Apache2 web server.

To install subversion, follow this recipe:

  1. sudo apt-get install subversion
  2. sudo adduser svn
  3. sudo adduser www-data svn
  4. sudo mkdir /var/svn
  5. sudo svnadmin create /var/svn/repos
  6. sudo chown -R www-data:svn /var/svn/repos
  7. sudo chmod g+rws /var/svn/repos
  8. sudo apt-get install libapache2-svn
  9. Add a <Location> to /etc/apache2/mods-available/dav_svn.conf (details)
  10. (Optional) cd /etc/apache2/mods-enabled; sudo ln -s ../mods-available/dav_svn.load; sudo ln -s ../mods-available/dav_svn.conf
  11. sudo /etc/init.d/apache2 restart
  12. sudo htpasswd -c /etc/htpasswd.svn <1st user>
  13. sudo htpasswd /etc/htpasswd.svn <2nd user>

To test the installation and setup:

  1. cat /etc/htpasswd.svn
  2. svn co http://<hostname>/svn/repos mycopy –username <user>

Details here:
Add a <Location> snippet to /etc/apache2/mods-available/dav_svn.conf

<Location /svn/repos>
     DAV svn
     SVNPath /var/svn/repos
     AuthType Basic
     AuthName "SVN repository"
     AuthUserFile /etc/htpasswd.svn
     AuthzSVNAccessFile /var/svn/repos/conf/authz
     <LimitExcept GET PROPFIND OPTIONS REPORT>
        Require valid-user
     </LimitExcept>
</Location>
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Blog at WordPress.com.

Up ↑

%d bloggers like this: