Saturday, 16 Feb 2008

Ubuntu: Getting Apache And SubVersion Module Working Together

I tried the simple stuff:

apt-get install subversion

It got me somewhere, but I wasn’t able to find the module for apache2. Maybe it is hidden somewhere within the Ubuntu installation. Who knows. I also tried the procedure described on the Ubuntu Forum to no avail. It requires

So I decided to go the old, traditional route: lots of compiling.

First install neon. You know the drill: gunzip <file>; tar -xvf <file>; ./configure ; make ; make install

Then, downloaded subversion from its website. Know the same drill again.

When doing the make install, it complained on my system. It is because Ubuntu handles modules differently than most other systems. In Ubuntu, modules are not loaded on httpd.conf, but in a directory called mods-enabled.

I had to manually edit the /etc/apache2/httpd.conf file (empty by default) to contain a LoadModule entry (a dummy one). I re-ran the make install and found the two module entries that I had to copy. Just for safety, I moved them inside a new file I created called /etc/apache2/mods-enabled/dav_svn.load . After I restarted server, it came back normally.

sudo /etc/init.d/apache2 restart

Now the configuration part. On the same /etc/apache2/mods-enabled/dav_svn.load file I copied the text below. It matches the fact I configured my repositories on … lets say /usr/local/svn . I had to restart the server after this change (just like the command above).

<Location /svn>

  DAV svn

  # any "/svn/foo" URL will map to a repository /usr/local/svn/foo

  SVNParentPath /usr/local/svn

</Location>

A fairly common situation that I found was that I wanted my web to be able to access these files, but my ssh users (developers) to access the source controlled files as well.  Subversion supports web, file, and ssh access — and as you might have guessed, I wanted it all.  I had to make these files owned by my web user (same as apache httpd) and with a group the same as my developers (had to edit the /etc/group and /etc/passwd files).

chown -R web-user:developers-group /usr/local/svn

So far so good.  Now the next step was getting Trac (my bug tracking system) and Subversion tied together.  Trac supplies most of the support out of the box, but I still had to download and compile the subversion source and the SWIG tool.  Check some hints by Oliver Nash.


2 Responses to “Ubuntu: Getting Apache And SubVersion Module Working Together”

  1. Антон Павлович Says:

    Who knows. I also tried the procedure described on the Ubuntu Forum to no avail. It requires
    So I decided to go the […….

    как скачать помогите…

  2. Kylie Batt Says:

    Я думаю, что Вы допускаете ошибку. Могу это доказать. Пишите мне в PM, пообщаемся….

    Менеджер по работе с клиентами, менеджер по продажам. I tried the simple stuff:
    apt-get install subversion
    It got me somewhere, but I wasn’t able to find the module for apache2…..

Leave a Reply