Skip to content

Instantly share code, notes, and snippets.

@dexterbt1
Created August 3, 2010 11:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dexterbt1/506205 to your computer and use it in GitHub Desktop.
Save dexterbt1/506205 to your computer and use it in GitHub Desktop.

cgit + lighttpd on CentOS 5.x

install the rpm

http://rpm.pbone.net/index.php3/stat/4/idpl/12891638/dir//com/cgit-0.8.2.1-1.el5.kb.i386.rpm.html

static media

cd /srv/www/html/lighttpd
ln -s /usr/share/cgit git-media/

lighttpd.conf

...
$HTTP["url"] =~ "^/git/" {
    compress.filetype = ()
    alias.url = ( 
        "/git/cgit.cgi" => "/var/www/cgi-bin/cgit",
    )
    cgi.assign = ( "/var/www/cgi-bin/cgit" => "" )
    fastcgi.server = ()
    index-file.names = ( "cgit.cgi" )
}

url.rewrite-once = (
    "^/git/([^?/]+)$" => "/git/cgit.cgi?url=$1",
    "^/git/([^?/]+/[^?]*)?(?:\?(.*))?$" => "/git/cgit.cgi?url=$1&$2",
)
...

/etc/cgitrc

...
virtual-root=/git/
css=/git-media/cgit.css
logo=/git-media/cgit.png
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment