- Ensure you have Apache installed on your system.
- Ensure you have mod_dav_svn installed:
> yum -y update mod_dav_svn
- Install ssl support to enable https:
> yum install mod_ssl
- Edit /etc/httpd/conf.d/subversion.conf and append the following lines to the end of your config file:
<Location /svn>
DAV svn
SVNParentPath /var/svn
AuthType Basic
AuthName "Subversion repository"
AuthUserFile /etc/svn-auth-file
AuthzSVNAccessFile /etc/svn-serve.conf
Require valid-user
</Location> - Create a file called /etc/svn-auth-file
Assign permission:
> chown root.root /etc/svn-auth-file
> chmod 644 /etc/svn-auth-file - Add users to /etc/svn-auth-file (one per line) in the form:
tom:$apr1$hDMIx…$abctozvZbC9J6/heHBBe481You can use htpasswd to do this automatically:
> ### First time: use -cm to create the file
> ### Use -m to use MD5 encryption of the password, which is more secure
> htpasswd -m /etc/svn-auth-file harry
New password: *****
Re-type new password: *****
Adding password for user harry
> htpasswd /etc/svn-auth-file -m sally
New password: *******
Re-type new password: *******
Adding password for user sally
> - Create a file called /etc/svn-serve.conf
Fill it with:
[/]
*=
svnUser=rw
The user svnUser is being granted read and write access to all projects, while all other users (*) are being denied access. - Assign permissions:
> chown root.apache /etc/svnserve.conf
> chmod 640 /etc/svnserve.conf - Create /var/svn.
> mkdir -p /var/svn
> chmod 755 /var/svn - If you are running SELinux, run:
> chcon -R -h -t httpd_sys_content_rw_t /var/svn
> setsebool -P httpd_unified=1 - You are now ready to being adding Subversion repositories!