How to install and configure Subversion for use in professional development environments. This subversion will run as a module in Apache2 and will use it's own database of users. Installation and configuration of Subversion clients on Windows are also discussed.
Set the USE flags properly and emerge subversion. The output below shows the USE flags on the example server and some of the dependencies. Swig is the Simplified Wrapper and Interface Generator and neon is a DAV client.
root@carbon # emerge -pv subversion These are the packages that I would merge, in order: Calculating dependencies ...done! [ebuild N ] dev-lang/swig-1.3.21 -X -guile -java +perl +php -python -ruby -tcltk 1,975 kB [ebuild N ] app-shells/bash-completion-config-0.8-r2 106 kB [ebuild N ] net-misc/neon-0.24.7 -expat +ssl +zlib 589 kB [ebuild N ] dev-util/subversion-1.2.3 +apache2 +bash-completion -berkdb -emacs -java +nls -nowebdav +perl -python +zlib 7,068 kB
To run Subversion server one must first create the repository then configure the server type. Subversion can run with its own daemon (svnserve) with or without xinetd, via ssh or over http in Apache2. The example server is setup to use Apache2 and pointers are provided for use with https.
To create the repository use the svnadmin command or use the built in ebuild piece.
The ebuild will create the repository as /var/svn and set the owner properly.
root@carbon # ebuild /var/db/pkg/dev-util/subversion-1.2.3/subversion-1.2.3.ebuild config
To get Apache2 to host the Subversion stuffs it must be told to load the proper modules.
Update the Apache2 start command to enable DAV and SVN.
Ensure that the auth_module is loaded in apache2.conf, the SVN module needs it.
Specific configuration parameters are located in /etc/apache2/conf/modules.d/47_mod_dav_svn.conf.
root@carbon # grep APACHE2_OPTS /etc/conf.d/apache2 APACHE2_OPTS="-D DAV -D SVN" root@carbon # grep auth_module /etc/apache2/conf/apache2.conf LoadModule auth_module modules/mod_auth.so
Create the user database for access to the repository. It seems possible to plug this into a different auth database by editing apache2 and 47_mod_dav_svn.conf accordingly. The example server simply uses an htpasswd file in the default location which is set in 47_mod_dav_svn.conf
# First User root@carbon # htpasswd2 -b -c -m /var/svn/conf/svnusers user1 pass1 # Subsequent Users root@carbon # htpasswd2 -b -m /var/svn/conf/svnusers userN passN
The the repository is now available on the server at path /svn/repos.
This location name is set in 47_mod_dav_svn.conf and can be altered, specifically a dedicated source server could be placed at the root by setting <Location />.
There are many Subversion clients available for many systems. The Subversion project directly provides a CLI that will run on Windows, TortiseSVN is a Windows shell extension that looks pretty and has lots of features. Get it from their respective home pages (link below) and go crazy.