darcsweb+lighttpd on Debian

I couldn’t find any information on how to set up darcsweb on lighttpd in general. I was a little disappointed to see that the darcsweb package on Debian only comes with apache and apache2 configurations, nothing for lighttpd. Since Debian is a little special sometimes when it comes to web servers—they like to add convenient configuration “frameworks”—I was afraid that using a “non-supported web server” might be a lot of work. How wrong I was :-)

First enable the CGI module for lighttpd:

# cd /etc/lightttpd/conf-enabled
# ln -s ../conf-evailable/10-cgi.conf

Then create a very short configuration file to enable darcsweb to find its images:

# cd 
# echo 'alias.url += ( "/darcsweb/" => "/usr/share/darcsweb/" )' > \
/etc/lighttpd/conf-available/50-darcsweb.conf

Then enable that “module” as well:

# cd /etc/lightttpd/conf-enabled
# ln -s ../conf-evailable/50-darcsweb.conf

Create your darcs repositories in /var/www/darcs/. I created a repo I called test.

The Debian default configuration of darcsweb will expose all repositories in /var/www/darcs/. This is quite probably not what I wanted so I commented out the auto class and added the following:

class test:
    reponame = 'test'
    repodesc = 'Silly little test repo'
    repodir = '/var/www/darcs/test'
    repourl = 'http://denobula/darcs/test/'
    repoencoding = 'latin1'

That’s it!

Share

9 Comments

  1. Preben,

    AFAIU fastcgi requires support by darcsweb, right? At the moment it’s written as a regular CGI script so cgi seems to be the only option.

  2. Preben,

    Another comment on the issue of using FastCGI. AFAIU FastCGI offers most of its speed-up by removing the need to create a new process everytime a page is accessed. This pays off very quickly when using interpreted languages to implement your dynamic site.

    Darcsweb is written in Python, but it relies heavily on darcs itself to deal with your repo. That means the potenital for speed-up is rather reduced.

  3. Hi again

    I’m trying to setup my lighttpd like you have done above, but I cannot manage to get the style.css and logos loaded. The darcsweb looks just boring old text.

    Any ideas what is the problem?

    Thanks in advance

    Preben

  4. Preben, my guess is that your configuration doesn’t have /darcsweb/ pointing to the place where the images and CSS are. The recipe above worked on a Debian system when I wrote it. It’s likely that locations of files differ between distributions. They might even have changed on Debian, I wouldn’t know since I no longer run a system with darcsweb+lighttpd on it.

  5. Got it :-)

    I had to write:

    $HTTP["remoteip"] == "127.0.0.1" {
      alias.url += ("/darcsweb/" =>
        "/usr/share/darcsweb/")
      $HTTP["url"] =~ "^/darcsweb/" {
        dir-listing.activate = "disable"
      }
    }
    

    to get the alias to work. It didn’t work with only the alias.url line. I guess you can skip the $HTTP["url"] line though.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>