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.
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.
su
adduser
We now need to create a direcory to house all our repositories.
mkdir -p /home/svn/repositories
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/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
Note: For reference in slackware the apache modules folder is located at "/usr/lib/httpd/modules".
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.
--snip--
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.
Order deny,allow
Deny from all
--snip--
chown -R apache.apache /home/svn
chmod -R 777 /home/svn/repositories/*
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]
Now restart apache to load our changes.
/etc/rc.d/rc.httpd restart
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.