Subversion 1.4.0 from source via Apache 2.2 on Ubuntu Dapper

This howto assumes you’ve already followed my Building Apache 2.2 from source article.

Now we’re going to install Subversion 1.4.0 from source so that it can be access via Apache with authentication.

Installing Subversion

As we’ve built Apache from source, we’ll need to do the same for Subversion in order to get the Apache 2 modules mod_dav_svn and mod_authz_svn.

wget http://subversion.tigris.org/downloads/subversion-1.4.0.tar.gz
tar xvfz subversion-1.4.0.tar.gz
cd subversion-1.4.0/
./configure --prefix=/usr/local --with-apxs=/usr/local/apache2/bin/apxs
make
sudo make install

This will also add the relevant LoadModule directives into your Apache 2 configuration for you.

Creating your repository

Now, create your Subversion repository:

svnadmin create /home/yourusername/subversion/repos

We have to make that repository owned by Apache so that it can be accessed via the web:

sudo chown -R apache /home/yourusername/subversion/repos

Authentication File

Now create a user/password file for authentication:

htpasswd -cm /home/yourusername/subversion/dav_svn.passwd davidwinter

When prompted, enter your password.

Configuring Apache

Edit your /usr/local/apache2/conf/httpd.conf file with the following placed at the end:

<Location /svn>
  DAV svn
  SVNPath /home/yourusername/subversion/repos

  AuthType Basic
  AuthName "Subversion Repository"
  AuthUserFile /home/yourusername/subversion/dav_svn.passwd
  Require valid-user
</Location>

If you want access control based on different users, add the following line after the Require valid-user line:

AuthzSVNAccessFile /home/yourusername/subversion/svn_access_control

Save the file. Start Apache. To find out what you need to put in the svn_access_control file, read my previous Subversion authentication article here. for params.

  • Ken Estes

    When I run:

    ./configure –prefix=/usr/local –with-apxs=/usr/local/apache2/bin/apxs

    I get the following:

    configure: WARNING: we have configured without BDB filesystem support

    You don’t seem to have Berkeley DB version 4.0.14 or newer installed and linked to APR-UTIL. We have created Makefiles which will build without the Berkeley DB back-end; your repositories will use FSFS as the default back-end. You can find the latest version of Berkeley DB here: http://www.sleepycat.com/download/index.shtml

    And I have db4.4 install and added the path when compiling the Apache before this pointing to /usr/bin. My LDLIBRARYPATH is blank, which is suppose to point to the right DB. I have a fresh install of Ubuntu server 6.06 so I am only at a command line. Since it said it could run without the DB and use FSFS as the default back end I tried to do a make and get:

    libtool: link: warning: library /usr/local/lib/libaprutil-0.la' was moved. libtool: link: warning: library/usr/local/lib/libapr-0.la’ was moved. libtool: link: warning: library /usr/local/lib/libaprutil-0.la' was moved. libtool: link: warning: library/usr/local/lib/libapr-0.la’ was moved. /usr/local/lib/libaprutil-0.so: undefined reference to db_create' /usr/local/lib/libaprutil-0.so: undefined reference todb_strerror’ collect2: ld returned 1 exit status make: *** [subversion/svn/svn] Error 1

    and therefore can’t sudo make install.

    Any help would be great!

  • Ken Estes

    After formating the drive and starting fresh. I was able to get the svn to install correctly. It just appears that your not using the Berkeley back end. It works so I am happy. Thanks for the information. Now I just need to work on SSL.

    Ken

  • http://davidwinter.me.uk David

    Yeah, I’m not using the Berkley database. The FSFS one is what I use and that works fine.

  • tam

    I did what was intructed, but subversion does not generate modauthzsvn, only moddavsvn. Please help.

  • http://www.stoneageblog.com/articles/2007/01/10/debian-on-rails-apache-2-2-mysql-ruby-rails-php-mongrel-mongrel_cluster-subversion-trac-capistrano Debian On Rails : Apache 2.2 + MySQL + Ruby + Rails + PHP + Mongrel + Mongrel_cluster + Subversion + Trac + Capistrano

    [...] Subversion 1.4.0 from source via Apache 2.2 on Ubuntu Dapper [...]

  • http://stoneage.crystalonrails.com/articles/2007/01/04/debian-on-rails-apache-2-2-mysql-ruby-rails-php-mongrel-mongrel_cluster-subversion-trac-capistrano/ Stoneageblog.com » Archive du blog » Debian On Rails : Apache 2.2 + MySQL + Ruby + Rails + PHP + Mongrel + Mongrel_cluster + Subversion + Trac + Capistrano

    [...] Subversion 1.4.0 from source via Apache 2.2 on Ubuntu Dapper [...]

  • http://ivanov.wordpress.com/2007/05/28/instaling-ubuntu-606-lts-server-dapper-drake/ Instaling Ubuntu 6.06 LTS Server (Dapper Drake) « Todor Ivanov’s Weblog

    [...] David Winter [...]

  • http://www.pspcorp.net Paul

    Following your instractions and at the point when I need to excxecute the following command: svnadmin create /home/netadmin/subversion/repos

    Received the folowing error:

    -bash: svnadmin: command not found

    Sorry, I’m new to this

  • Daan

    Any idea how to get webdav working ?

blog comments powered by Disqus