Svn via https

From Andreida
Revision as of 11:42, 16 February 2016 by Andreas (talk | contribs) (Created page with "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 ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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

Example:

<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
</Location>

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
[repository1:/]
harry = rw
sally = r

[repository1:/path/somewhere]
sally = rw

[repository2:/]
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