Monday, October 30, 2006

Configuring subversion on FC5

Well, I just spent hours trying to figure out why I couldn't get subversion to work. I followed all of the instructions to the letter, etc. Well, it turns out that the instructions I was following had a typo. I was using the SVNPath apache directive instead of the SVNParentPath directive.

Anyway, my FC5 installation already had apache2, mod_dav, and subversion installed, but it didn't have mod_dav_svn. So I installed it:

yum install mod_dav_svn

This automatically added the and files to /etc/httpd/modules. It also added /etc/httpd/conf.d/subversion.conf, which included these directives:

LoadModule dav_svn_module modules/
LoadModule authz_svn_module modules/

Had I just used the sample from that file, it probably would have just worked since it had SVNParentPath in it. But instead, I added the following to my virtualhost:
      <location /svn>
DAV svn
SVNPath /absolute/path/to/repository
This was taken directly from the "Installing Subversion" HowTo guide listed on the subversion documentation site. Here is the link:

I created the repository:

su - username
cd /home/username
mkdir svn
cd svn
svnadmin create reponame
chown -R apache.apache reponame

Now, testing things out by going to caused the following error:

This XML file does not appear to have any style information associated with it. The document tree is shown below.

<d:error> </d:error>
<c:error> </c:error>
<m:human-readable errcode="2"> </m:human-readable>
Could not open the requested SVN filesystem

Once I changed the directives to the following, it worked:
      <location /svn>
DAV svn
SVNParentPath /absolute/path/to/repository
Before using SVNParentPath, I would get the following error using "svn co":

svn: PROPFIND request failed on '/svn'
Could not open the requested SVN filesystem

Now when I execute the following:

svn co test

It responds that it checkout revision 0. Yay!

I think that I could have got SVNPath to work too, but I would have had to run the svnadmin create on that directory, not a subdirectory. Maybe I just needed to follow the directions better. Regardless, the SVNParentPath is the command that I really want since I want multiple repositories in that directory without having to configure multiple Location directives in Apache.

No comments: