Thursday, May 29, 2008

Fedora 8 / SVN / Apache

This is my second time setting up SVN with apache on Fedora so I figured I'd record my experience.

1. get svn and the apache plugin
# yum -y install subversion mod_dav_svn

2. make a root directory for the svn repos
# mkdir /svn

3. give ownership to apache user
# chown -fhR apache:apache /svn

4. create a skeleton repo
# mkdir -p /root/repo/branches
# mkdir /root/repo/tags
# mkdir /root/repo/trunk

5. make a test repo (just make sure everything is all good, you can use 'rm -rf /svn/test' to remove it later)
# svnadmin create /svn/test
# svn import --message 'Initial set up' /root/repo file:///svn/test
# cd /svn/test
# chown apache:apache . -R
# chmod 700 * -R
# chmod +s db

6. configure /etc/httpd/conf.d/subversion.conf, it should look something like this:

<location repos="">
DAV svn
SVNParentPath /svn

<limitexcept get="" profind="" options="" report="">
AuthType Basic
AuthName "Authorization Realm"
AuthUserFile /etc/svn.passwd
Require valid-user
</limitexcept>
</location>

7. create the /etc/svn.passwd file and the 1st user (don't use '-c' after this unless you want to truncate the file)
# htpasswd -c /etc/svn.passwd

8. restart apache for changes to take effect
# service httpd restart


That should work, might need to be tweaked for security, but you should be able take your favorite web browser to http://localhost/repos/test and see the test repo

No comments: