Configure Subversion with Apache on Slackware 13

Author: Steven Neiland

Warning: This blog entry was written two or more years ago. Therefore, it may contain broken links, out-dated or misleading content, or information that is just plain wrong. Please read on with caution.

Source control is something every developer should use. Fortunately Slackware 13 comes with it pre-installed. All we have to do is configure it.

Note: This guide assumes that subversion and apache are installed, but that apache is not configured for subversion support.

Step 1: Create a SVN User

While not strictly necessary I prefer to have a separate 'svn' user. Login as root and use the adduser command to create the new user.


Step 2: Create the Repositories Directory

We now need to create a direcory to house all our repositories.

mkdir -p /home/svn/repositories

Step 3: Enable SVN Support in Apache

To enable apache to support subversion we need to make a few changes to the apache config files. First open the httpd.conf file for editing and add the following to the modules section to load the svn modules. On a default install this is located at '/etc/httpd/httpd.conf'.

LoadModule dav_svn_module modules/
LoadModule authz_svn_module modules/

Note: For reference in slackware the apache modules folder is located at "/usr/lib/httpd/modules".

Step 4: Edit the VHost reference for the Host Site

As you can have have multiple websites on the same server you should put the 'Location' directive for dealing with the subversion repositories in a specific vhost. Further it is a good idea to put it in the ssl definition for the site so that your files are sent encrypted.

<VirtualHost mysiteaddress:443>
<Location /svn>
DAV svn
SVNListParentPath on
SVNParentPath /home/svn/repositories
AuthName "SVN Repository"
AuthType Basic
AuthUserFile /home/svn/.svn-auth-file
Require valid-user

# Disallow browsing of svn working copy admin dirs.
<DirectoryMatch "^/.*/\.svn/">
Order deny,allow
Deny from all

Step 5: Give Apache Ownership of the SVN Directory

chown -R apache.apache /home/svn
chmod -R 777 /home/svn/repositories/*

Step 6: Create the Authentication File

This step applies if you wish to use "Basic" authentication. To create the Authentication file run the htpasswd script that comes with apache.

// create the password file with the first username
htpasswd -cs /home/svn/.svn-auth-file [username]

// add a second username
htpasswd -s /home/svn/.svn-auth-file [uesrname]

Step 7: Restart Apache

Now restart apache to load our changes.

/etc/rc.d/rc.httpd restart

Step 8: Create a Repository and Test

In order to test we need to create a repository and it’s directory structure.

svnadmin create /home/svn/repositories/[repository_name]

At this stage all that is left to do is to test if we can access our repository. First open a browser and navigate to https://[yoursite]/svn/[repository name]. If this works your next step should be to connect your IDE to the repository and ensure you can create folders and files.

So there you have it, subversion running with apache on slackware.

Related Blog Postings

Reader Comments

  • Please keep comments on-topic.
  • Please do not post unrelated questions or large chunks of code.
  • Please do not engage in flaming/abusive behaviour.
  • Comments that contain advertisments or appear to be created for the purpose of link building, will not be published.

Archives Blog Listing