Note: This is the second time I’m writing this entry since RZ somehow managed to lose my first post. So these steps are from memory and might not be 100% correct.
If you want to install subversion, you will need to have apache. Easiest way to install this is via yum (or whatever package manager you need to use).
yum install subversion mod_dav_svn httpd
Once complete, you should have a directory in /etc/httpd/conf.d/subversion.conf
.
We will create the repos in /home/subversion. I’ll also make a user ‘subversion’ who can manage these files without root. As root, run the following commands:
- useradd subversion
- cd /home/subversion
To create a new repo:
- Create the directory for the new repo. eg: 'repo'
- run 'svnadmin create repo'
To create the initial import of the trunk:
- mkdir /tmp/trunk
- svn import /tmp/trunk file:///home/subversion/repo/trunk -m "Initial Import"
You may want to add users to access this repo. Suppose you want to add user:
- cd /home/subversion/repo/conf
- htpasswd -cm svn-auth first_user
- htpasswd -m svn-auth second_user
Note: do not use the -c
argument after adding the first user, otherwise it will overwrite the existing password file.
You will then need to add an entry to /etc/httpd/conf.d/subversion.conf
with the following:
DAV svn
SVNPath /home/subversion/repo
AuthType Basic
AuthName "Subversion Repo for MyRepoName"
AuthUserFile /home/subversion/repo/conf/svn-auth
Require valid-user
Ensure the files in /home/subversion/ are owned by apache, but still is group owned by subversion.
You should now be able to access your new repo by going to /svn/repo after using the username/password combination given to htpasswd above.