SVN -and lighttpd

The name of the game here is to get apache running on port 8080, with mod_dav_svn making a SVN repository available. Then get lighttpd to use mod_proxy to proxy to that server.

A nice tutorial (that I am trying to follow) Trac Apache Subversion recipe

Take inventory

On my fedora core 6 system, I have lighttpd happily running, apache turned off but waiting in the wings, and mod_dav_svn available to apache, probably from an earlier involvement with this back when I was running apache.

A look in /etc/init.d and /etc/rc5.d shows me that the lighttpd service is up and running, and I could launch apache via the "httpd" service.

Config files for apache and lighttpd on my system are in the following places:

/etc/sysconfig/httpd
/etc/sysconfig/lighttpd
/etc/lighttpd/lighttpd.conf
/etc/httpd/conf/httpd.conf
/etc/httpd/conf.d/subversion.conf
The first two are not of much interest, the last three are where the action is at.

Set up apache

This is kind of a rinse-lather-repeat process wherein you hack away on the config files and then do service httpd restart over and over until things become cool.

First hack on httpd.conf. I change just two lines:

Listen 8080  (instead of Listen 80)

DocumentRoot "/home/svn/www"
I do a service httpd restart and http://server.org:8080 is showing me the new server document root.

I set up a write access password via:

htpasswd -cm /home/svn/users user

Now I hack on subversion.conf. It is already set up to load the appropriate dav modules. I just need to point it to my repository and fiddle some paths as follows:

# This works to expose /home/svn/project as http://server:8080/svn/project

   DAV svn
   SVNParentPath /home/svn

   # Limit write permission to list of valid users.
   
      # Require SSL connection for password protection.
      # SSLRequireSSL

      AuthType Basic
      AuthName "Authorization Realm"
      AuthUserFile /home/svn/users
      Require valid-user
   

Set up lighttpd

This is quite easy. I edit the server.modules line to add (actually uncomment) mod_proxy. Then I add the following lines:
proxy.server = (
	"/svn" => (("host" => "127.0.0.1", "port" => 8080))
)
And voila! The URL http://server/svn/project now works and shows the SVN repository.