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/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so

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

</Location>

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.

http://www.websitename.com/svn/repos/

Post to Twitter Post to Yahoo Buzz Post to Delicious Post to Digg Post to Reddit Post to StumbleUpon

Share or Bookmark This Post With :

3 Comments
Charlie Posted On March 16th, 2009

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 Posted On March 17th, 2009

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:
http://ejohansson.se/archives/2007/11/04/selinux-subversion-and-mod_svn/

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

javatechie Posted On March 17th, 2009

Hi Charlie

You have to add double quotes around “Subversion Repository”

Leave a Reply

Subscribe to RSS Feeds Follow me on Twitter Add to Favourite
 
Sponsors
 
Tags
 
Network [+]
 
© Copyright 2009 - 2011 TechiePark.com. All Rights Reserved | Powered by WordPress
This work is licensed under a Creative Commons Attribution 3.0 Unported License
Php5 powered    Mysql powered    Apache powered   Best viewed with  Spread Firefox Affiliate Button