HOW TO Subversion+Apache on Fedora

HOW TO Subversion+Apache on Fedora

To learn or use Subversion, please read the book.

To install subversion run below commands:

# yum install subversion
# yum install mod_dav_svn

Then you need to setup at least one repository to test it.

Here create the folders..

# mkdir /svn
# mkdir /svn/repos
# mkdir /svn/users
# mkdir /svn/permissions

repos – will contain all the projects

users – will contain all the user configs

permissions – will contain all the user permissions

We need to give these folders the proper permissions apache user permissions so that apache can write files on repos.

# chown -R apache.apache /svn

Then you can create repository using subversion cmd svnadmin.

# svnadmin create /svn/repos/project1

You can create multiple project repos under repos folder.

To setup apache server.

You may already have this subversion config file installed in conf.d folder otherwise you can create a new apache include file that will hold all configurations.

# vi /etc/httpd/conf.d/subversion.conf

This file need to contain something like this to serve the repository through apache:

LoadModule dav_svn_module modules/
LoadModule authz_svn_module modules/

 DAV svn
 SVNPath /svn/repos
 AuthType Basic
 AuthName “Subversion Repository”
 AuthUserFile /svn/users/passwords
 Require valid-user
 AuthzSVNAccessFile /svn/permissions/svnauthz.conf

We need to create some files so that this config will work properly. The first is htpasswd file which will contain all the usernames nad passwords which i named “/svn/users/passwords”.

# htpasswd -cb /svn/users/passwords username password

Next you need to create the svnauth file.

# vi /svn/permissions/svnauthz.conf

Inside place a list of users who have access to files:

username = rw

The “rw” states that this user has read/write access to the root repository /.

Restart your web server and you should be done.

service httpd restart

Now you should access subversion repos as below.

Related Posts:

3 Responses

Charlie January 29, 2009 at 5:30 am

Your example /etc/httpd/conf.d/subversion.conf seems to contain the wrong kind of double-quotes (open and closing as opposed to asymmetrical) so cutting and pasting doesn’t work and requires me to use my head.

Charlie January 29, 2009 at 5:30 am

Also, there seem to be some SELinux hangups for this to work in FC 10. I found the following solution:

chcon -R -h -t httpd_sys_script_rw_t /path/to/repository

In the comments to this posting:

No idea if that’s the proper labeling for these files, but that worked for me.

javatechie January 29, 2009 at 5:30 am

Hi Charlie

You have to add double quotes around “Subversion Repository”

Comments are closed.