To get gitweb working with lighttpd on Debian 6 Squeeze, create a file in /etc/lighttpd/conf-available named 99-gitweb.conf with the following content:
server.modules += ( "mod_cgi", "mod_setenv", ) # configuration for gitweb, ignore this url in 10-simple-vhost.conf $HTTP["url"] =~ "^/gitweb/" { server.document-root = "/usr/share/" server.indexfiles = ("index.cgi") cgi.assign = ( ".cgi" => "/usr/bin/perl" ) setenv.add-environment = ( "GITWEB_CONFIG" => "/etc/gitweb.conf", ) } |
This maps /usr/share/gitweb/ (this holds all relevant files for gitweb on Debian) to http://example.com/gitweb/.
Now enable the new configuration file with
lighttpd-enable-mod gitweb |
and reload lighttpd with
/etc/init.d/lighttpd force-reload |