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!

9 Comments

  1. Preben says:

    Hi

    Just wondered why you don’t use fastcgi in stead of cgi?

    Preben

  2. adam says:

    did you have no issue with doing python cgi in lighttpd? thats where im stuck

  3. Magnus says:

    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.

  4. Magnus says:

    Adam,

    No issue at all for me. The configuration provided with lighttp on Debian works like a charm.

  5. Magnus says:

    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.

  6. Preben says:

    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

  7. Magnus says:

    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.

  8. Preben says:

    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.

  9. Johan says:

    For really thick people like me:

    After you’re done: sudo /etc/init.d/lighttpd force-reload

    Point your web browser to: http://www.yourdomain.com/cgi-bin/darcsweb.cgi

Leave a Reply

Please use markdown to make your comment beautiful.