How to set up a Subversion (SVN) server on GNU/Linux - Ubuntu -


i have laptop running ubuntu act subversion server. both myself commit locally, , others remotely. steps required working? please include steps to:

  • get , configure apache, , necessary modules (i know there other ways create svn server, apache-specific)
  • configure secure way of accessing server (ssh/https)
  • configure set of authorised users (as in, must authorised commit, free browse)
  • validate setup initial commit (a "hello world" of sorts)

these steps can involve mixture of command line or gui application instructions. if can, please note instructions specific particular distribution or version, , users' choice of particular tool can used instead (say, nano instead of vi).

steps i've taken make laptop subversion server. credit must go alephzarro directions here. have working svn server (which has been tested locally).

specific setup: kubuntu 8.04 hardy heron

requirements follow guide:

  • apt-get package manager program
  • text editor (i use kate)
  • sudo access rights

1: install apache http server , required modules:

sudo apt-get install libapache2-svn apache2 

the following packages installed:

apache2-mpm-worker apache2-utils apache2.2-common 

2: enable ssl

sudo a2enmod ssl sudo kate /etc/apache2/ports.conf 

add or check following in file:

<ifmodule mod_ssl.c>     listen 443 </ifmodule> 

3: generate ssl certificate:

sudo apt-get install ssl-cert sudo mkdir /etc/apache2/ssl sudo /usr/sbin/make-ssl-cert /usr/share/ssl-cert/ssleay.cnf /etc/apache2/ssl/apache.pem 

4: create virtual host

sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/svnserver sudo kate /etc/apache2/sites-available/svnserver 

change (in ports.conf):

"namevirtualhost *" "namevirtualhost *:443" 

and (in svnserver)

<virtualhost *> <virtualhost *:443> 

add, under serveradmin (also in file svnserver):

sslengine on sslcertificatefile /etc/apache2/ssl/apache.pem sslprotocol sslciphersuite high:medium 

5: enable site:

sudo a2ensite svnserver sudo /etc/init.d/apache2 restart 

to overcome warnings:

sudo kate /etc/apache2/apache2.conf 

add:

"servername $your_server_name" 

6: adding repository(ies): following setup assumes want host multiple repositories. run creating first repository:

sudo mkdir /var/svn  repos=myfirstrepo sudo svnadmin create /var/svn/$repos sudo chown -r www-data:www-data /var/svn/$repos sudo chmod -r g+ws /var/svn/$repos 

6.a. more repositories: step 6 again (changing value of repos), skipping step mkdir /var/svn

7: add authenticated user

sudo htpasswd -c -m /etc/apache2/dav_svn.passwd $user_name 

8: enable , configure webdav , svn:

sudo kate /etc/apache2/mods-available/dav_svn.conf 

add or uncomment:

<location /svn> dav svn  # multiple repositories - see comments in file svnparentpath /var/svn  authtype basic authname "subversion repository" authuserfile /etc/apache2/dav_svn.passwd require valid-user sslrequiressl </location> 

9: restart apache server:

sudo /etc/init.d/apache2 restart 

10: validation:

fired browser:

http://localhost/svn/$repos https://localhost/svn/$repos 

both required username , password. think uncommenting:

<limitexcept propfind options report>  </limitexcept> 

in /etc/apache2/mods-available/dav_svn.conf, allow anonymous browsing.

the browser shows "revision 0: /"

commit something:

svn import --username $user_name anyfile.txt https://localhost/svn/$repos/anyfile.txt -m “testing” 

accept certificate , enter password. check out you've committed:

svn co --username $user_name https://localhost/svn/$repos 

following these steps (assuming haven't made error copy/pasting), had working svn repository on laptop.


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -