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 mod_dav_svn.so and mod_authz_svn.so files to /etc/httpd/modules. It also added /etc/httpd/conf.d/subversion.conf, which included these directives:

LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so

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
</location>
This was taken directly from the "Installing Subversion" HowTo guide listed on the subversion documentation site. Here is the link:
http://svn.collab.net/repos/svn/trunk/INSTALL

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 http://hostname.com/svn/reponame 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
</location>
Before using SVNParentPath, I would get the following error using "svn co":

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

Now when I execute the following:

svn co http://hostname.com/svn/reponame 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:

Post a Comment