How to install Subversion under SUSE 9.3 and Apache 2
Submitted by nicholas on 27 November, 2005 - 20:37. Apache 2 | Installation | Subversion | SUSE 9.3You can install Subversion from YAST. If you are unsure of how to do this then there are many good site on the net to explain how to use this great tool.
Create Subversion Repositories
Subversion repositories are created via the command line. Open a session and switch your user to root.
Create a directory where you wish to store all your repositories. For example:
# mkdir /repos
To create a repository, you use the command line tool svnadmin. Type:
# svnadmin create /repos/<your-repository-name>
Create a Users File and Adding Users
In order to restrict access to repositories to certain users, you need to create a user file that contains usernames and encrypted passwords. Apache provides a simple command line tool for doing this. The tool is used to:
- create/modify/delete users, and
- create/maintain the users file.
The first time you add a user you'll need to create the file. I suggest that for simplicity you store the users file in your repository directory. Create the file as follows:
# htpasswd2 -cm /repos/user.list <your-first-username>
You will be prompted to set a password for the user. To add more users, simply type:
# htpasswd2 -m /repos/user.list <new-username>
The Repository Permissions File
You need to create a file which dictates which users have access to which repositories. You may want to grant all users read-only access to one or more repositories and certain users read/write access to appropriate repositories. You can also explicitly grant or deny certain users or groups of users access to specific repositories or files/locations within a respository. This is all done via the access file.
A good name for this file would be access.conf. Place this file wil the user list file.
The following is a sample of a repository permission file.
# This is a comment. I will use comments to explain each of the sections.
# The groups allow you to keep like people together. Each of these people will have to be created
# in the user.list file for access to subversion
[groups]
everyone = harry, jane, tom
admins = harry
developers = jane, harry
documentor = jane, tom
# notice that when you use groups you preceed them with an @
# the following statement will restrict everybody to readonly access as standard across the repositories
[/]
@erveryone = r
# RepositoryName is the name of the repository you created earlier
# Users that have nothing set after the brackets have no access to this branch of the repository
[RepositoryName:/]
@admins = rw
jane = rw
harry =
# You can even go down to the file access level within this file
[RepositoryName:/doc/user_documentation.doc]
tom = rw
Linking Subversion to Apache
In order to communicate with your repositories, a communication layer needs to exist that handles requests for repository information and submission of data to update the repository. The popular open source web server Apache is used for this purpose. Communication is done via the HTTP protocol. Subversion is linked to Apache via a modular extension model that Apache provided.
Navigate to /etc/apache2/.
Make sure that the following lines are contained in your configuration file
LoadModule dav_module modules/mod_dav.so
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
Now add the following to your httpd.conf
# Source is the path you will use to access the repository
<Location /source>
DAV svn
# The base path for the repository we will use /repos in this example
SVNParentPath /repos
# The path to the access.conf that we created
AuthzSVNAccessfile /repos/access.conf
Require valid-user
AuthType Basic
AuthName "<The name of your repository>"
AuthUserFile /repos/user.list
</Location>
Restart Apache and there you go, one simple repository setup.

