Accessing a repository through the web via apache
Create the following configuration files
/etc/apache2/conf.d/subversion.conf
/etc/apache2/conf.d/subversion.conf contents:
DAV svn
SVNPath /srv/svn/myproject/repos
AuthType Basic
AuthName "Subversion Login"
AuthUserFile /etc/apache2/conf.d/subversion-users
#Read only unless authenticated.
Require valid-user
LoadModule dav_module /usr/lib/apache2/mod_dav.so
LoadModule dav_fs_module /usr/lib/apache2/mod_dav_fs.so
LoadModule dav_svn_module /usr/lib/apache2/mod_dav_svn.so
LoadModule authz_svn_module /usr/lib/apache2/mod_authz_svn.so
We could have a seperate //Location// for each svn repository with a seperate //AuthUserFile//
The /etc/apache2/sysconfig.d/include.conf file needs simply to be present. So issue:
touch /etc/apache2/sysconfig.d/include.conf
Issue the idconfig command.
ldconfig
Start Apache
apache2ctl restart
We need to setting up a users file now, simply issue the command below.
htpasswd2 -c /etc/apache2/conf.d/subversion-users //username//
After issuing the command, you will be prompted to enter the password for the user you are trying to add
NOTE: If you issue the above command with the switch -c it will create a new file and wipe out any existing users in that file. If you want to append a user to an already existing file see below.
Next, we need to add a user. Use the command htpasswd2 as below
htpasswd2 /etc/apache2/conf.d/subversion-users //username//
After issuing the command, you will be prompted to enter the password for the user you are trying to add