SHIFT

--- Sjoerd Hooft's InFormation Technology ---

User Tools

Site Tools


subversion
Differences

This shows you the differences between two versions of the page.

Link to this comparison view

subversion [2013/05/01 10:52] (current)
sjoerd created
Line 1: Line 1:
 += Subversion =
 +When you've created a subversion server as described [[http://​en.opensuse.org/​Setting_up_a_Subversion_server_using_Apache2|here at opensuse]] you really should add a repository, LDAP authentication and provide a backup:
  
 += How to Add a Subversion Repository to the Server =
 +
 +A separate IP address is needed for every repository if you want to use SSL to connect. The newly selected IP address should be added to the subversion server as an additional address. Next is to configure the Subversion repository (in this case the repository "​it"​).
 +
 +== Set Up a Project Repository ==
 +<​code>​
 +svnadmin create /srv/svn/it
 +chown -R wwwrun:www /​srv/​svn/​it/​
 +</​code>​
 +
 +== Create SSL Certificate ==
 +<​code>​
 +openssl genrsa -des3 -out /​etc/​apache2/​vhosts.ssl/​it.svn.company.local.key 1024
 +openssl req -new -key /​etc/​apache2/​vhosts.ssl/​it.svn.company.local.key -out /​etc/​apache2/​vhosts.ssl/​it.svn.company.local.csr
 +
 +cp /​etc/​apache2/​vhosts.ssl/​it.svn.company.local.key /​etc/​apache2/​vhosts.ssl/​it.svn.company.local.key.org
 +
 +openssl rsa -in /​etc/​apache2/​vhosts.ssl/​it.svn.company.local.key.org -out /​etc/​apache2/​vhosts.ssl/​it.svn.company.local.key
 +openssl x509 -req -days 3650 -in /​etc/​apache2/​vhosts.ssl/​it.svn.company.local.csr -signkey /​etc/​apache2/​vhosts.ssl/​it.svn.company.local.key -out /​etc/​apache2/​vhosts.ssl/​it.svn.company.local.crt
 +</​code>​
 +
 +== Create Log Directory ==
 +<​code>​
 +mkdir /​var/​log/​apache2/​it.svn.company.local
 +</​code>​
 +
 +== Create Apache Configuration ==
 +  vi /​etc/​apache2/​vhosts.d/​it.svn.company.local.conf
 +<​code>​
 +<​VirtualHost 10.10.10.100:​443>​
 +        ServerName it.svn.company.local
 +
 +        ServerSignature on
 +        DocumentRoot /​srv/​svn/​it/​
 +        DirectoryIndex index.php index.html index.htm index.shtml
 +        LogLevel error
 +        HostNameLookups off
 +
 +        ErrorLog /​var/​log/​apache2/​it.svn.company.local/​error_log
 +        CustomLog /​var/​log/​apache2/​it.svn.company.local/​access_log combined
 +
 +        SSLEngine on
 +
 +        #   ​Server Certificate:​
 +        SSLCertificateFile /​etc/​apache2/​vhosts.ssl/​it.svn.company.local.crt
 +
 +        #   ​Server Private Key:
 +        SSLCertificateKeyFile /​etc/​apache2/​vhosts.ssl/​it.svn.company.local.key
 +
 +        #   ​Server Certificate Chain:
 +        SSLCertificateChainFile /​etc/​apache2/​vhosts.ssl/​svn.company.local-ca.crt
 +
 +        #   ​Certificate Authority (CA):
 +        SSLCACertificateFile /​etc/​apache2/​vhosts.ssl/​svn.ompany.local-ca.crt
 +
 +        #​SSLPassPhraseDialog exec:/​etc/​apache2/​vhosts.ssl/​svn-passphrase.sh
 +
 +        # I have different locations for different repositories
 +
 +<​Location />
 +  AllowOverride None
 +  Options None
 +  Order allow,deny
 +  Allow from all
 +
 +  DAV svn
 +  SVNPath /​srv/​svn/​it/​
 +
 +  AuthBasicProvider ldap
 +  AuthType Basic
 +  AuthName "​SubVersion"​
 +  AuthLDAPURL ldap://​ldap.company.local:​389/​OU=services,​O=company?​uid?​sub
 +  Require ldap-group CN=AccessSubversion,​OU=SecurityGroups,​OU=services,​O=company
 +
 +</​Location>​
 +</​VirtualHost>​
 +</​code>​
 +
 +== Restart Apache ==
 +<​code>​
 +rcapache2 restart
 +</​code>​
 +
 +== Configure Backup ==
 +Create a directory in /​srv/​svn/​backup,​ in this case:
 +<​code>​
 +/​srv/​svn/​backup/​full.it
 +</​code>​
 +
 +Edit the crontab file and add the following line (and edit it for the just created repository),​ increase the first number with 5 from the previous line.
 +<​code>​
 +10 20 * * * root perl /​srv/​svn/​fullbackup.sh -v -i 500 --out-dir /​srv/​svn/​backup/​full.it /srv/svn/it --compress
 +</​code>​
 +
 +{{tag>​linux ldap}}
subversion.txt ยท Last modified: 2013/05/01 10:52 by sjoerd