Svn via https

From Andreida
Jump to: navigation, search

Install apache, https-svn package and subversion itself:

apt-get install apache2 libapache2-svn subversion

Enable the ssl mod:

a2enmod ssl

Check the listen ports: (443 is normal ssl)

vi /etc/apache2/ports.conf

Copy the default site to your new site

cd /etc/apache2/sites-available
cp default-ssl.conf svn-ssl.conf

Enable the site

cd /etc/apache2/sites-enabled
ln -s ../sites-available/svn-ssl.conf

Enable dav: (just follow the instructions)

vi /etc/apache2/mods-available/dav_svn.conf


<Location /svn>
  DAV svn
  SVNParentPath /var/reps
  AuthType Basic
  AuthName "Subversion Repository"
  AuthUserFile /etc/apache2/dav_svn.passwd
  AuthzSVNAccessFile /etc/apache2/dav_svn.authz
  Require valid-user

Enable the security:

a2enmod authn_file
a2enmod auth_basic

Create user and password

htpasswd -c /etc/apache2/dav_svn.passwd myuser

Add user and password

 htpasswd /etc/apache2/dav_svn.passwd myuser2

Edit the per directory permissions:

vi /etc/apache2/dav_svn.authz
harry = rw
sally = r

sally = rw

sally = rw

Create the repositories:

cd /var/reps
svnadmin create demo-1
svnadmin create demo-2
svnadmin create demo-3

Allow the webserver to read and write the svn files:

chown -R  www-data:www-data /var/reps
chmod -R  770  /var/reps