Installing subversion on SuSE 9.1
11.03.2004
--------------------------------------------------------------------------------
To run a subversion server, you need to configure apache2 to load three apache2
modules: mod_dav, mod_dav_svn, and mod_authz_svn. (mod_dav is needed by
mod_dav_svn and mod_authz_svn is need for authentication, it is installed
together with apache2.)
This is done by editing the apache2 configuration (/etc/sysconfig/apache2) and
adding Òdav dav_svn authz_svnÓ to the APACHE_MODULES setting, and restarting
the server.
A default/example configuration of the dav_svn module can be found in
/etc/apache2/conf.d/subversion.conf. With more recent apache
packages, this configuration is *not* loaded automatically by
the apache server, since many people configure virtual hosts
and it is unlikely that the repositories shall be available
from any virtual host. To load the configuration for a certain
virtual host, add
Include /etc/apache2/conf.d/subversion.conf
or
Include /path/to/your_subversion_configuration
in the respective virtual host configuration. This *may* be done in the default
virtual host (/etc/apache2/default-server.conf).
Minihowto:
--------------------------------------------------------------------------------
The plan:
host multiple source projects with subversion
all must have limited read/write access for users
they are accessed only via HTTP, not (!) locally
they will be reachable via:
http://hostname/repos/project1
http://hostname/repos/project2
...
The Process:
--------------------------------------------------------------------------------
install needed packages
(check for update packages on
ftp://ftp.suse.com/pub/projects/apache/ )
rpm -Uvh
apache2
apache2-doc
apache2-prefork
libapr0
neon
subversion
subversion-server
Update /etc/sysconfig/apache2
add Ôdav dav_svn authz_svnÕ to $APACHE_MODULES
create a few directories:
mkdir -p /srv/svn/repos
mkdir -p /srv/svn/user_access
mkdir -p /srv/svn/html
Add the http repository data to
/etc/apache2/conf.d/subversion.conf:
#ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
##
## project related HTML files
##
Alias /repos /srv/svn/html
Options Indexes +Multiviews -FollowSymLinks
IndexOptions FancyIndexing \
ScanHTMLTitles \
NameWidth=* \
DescriptionWidth=* \
SuppressLastModified \
SuppressSize
order allow,deny
allow from all
DAV svn
SVNParentPath /srv/svn/repos
# our access control policy
AuthzSVNAccessFile /srv/svn/user_access/access-policy
# only authenticated users may access the repository
Require valid-user
# how to authenticate a user
AuthType Basic
AuthName "Subversion Repositories"
AuthUserFile /srv/svn/user_access/auth-file
#ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ
create the repositories (as a sample use 'testing'):
cd /srv/svn/repos
svnadmin create testing
chown -R wwwrun:www testing/{dav,db,locks}
The webserver must be configured and started:
SuSEconfig Ðmodule apache2
rcapache2 restart
Now create the user access files:
touch /srv/svn/user_access/auth-file
/srv/svn/user_access/access-policy
chown root:www /srv/svn/user_access/auth-file
/srv/svn/user_access/access-policy
chmod 640 /srv/svn/user_access/auth-file
/srv/svn/user_access/access-policy
Add the User to the Authentication File:
htpasswd2 /srv/svn/user_access/auth-file
Add the User to the Access Policy File:
Edit the file /srv/svn/user_access/access-policy
Add a new group if needed. For example
testing = alice, bob
Then assign access to this repository
[testing:/]
@testing = rw
You should be able to connect to the server:
http://localhost/repos/testing
Now import the data, e.g.
svn import /path/to/files http://localhost/repos/testing