Difference between revisions of "Svn via https"

From Andreida
Jump to: navigation, search
(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 ...")
 
 
Line 1: Line 1:
 
Install apache, https-svn package and subversion itself:
 
Install apache, https-svn package and subversion itself:
 
  apt-get install apache2 libapache2-svn subversion
 
  apt-get install apache2 libapache2-svn subversion
 +
 +
OR (if libapache2-svn is not available)
 +
apt-get install apache2 libapache2-mod-svn subversion
  
 
Enable the ssl mod:
 
Enable the ssl mod:
Line 65: Line 68:
 
  chown -R  www-data:www-data /var/reps
 
  chown -R  www-data:www-data /var/reps
 
  chmod -R  770  /var/reps
 
  chmod -R  770  /var/reps
 +
 +
Now check your firewall rules for 443/https and do a
 +
/etc/init.d/apache2 restart
 +
 +
svn list --username myuser https://www.yourDomain.com/svn/demo-1

Latest revision as of 22:23, 2 December 2019

Install apache, https-svn package and subversion itself:

apt-get install apache2 libapache2-svn subversion

OR (if libapache2-svn is not available)

apt-get install apache2 libapache2-mod-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

Now check your firewall rules for 443/https and do a

/etc/init.d/apache2 restart
svn list --username myuser https://www.yourDomain.com/svn/demo-1