Gitolite, Lighttpd, and GitPHP

I had some trouble setting up GitPHP running under Lighttpd when using Gitolite. GitPHP is a PHP clone of gitweb, which allows web-browser-based repository viewing, and Gitolite is a very nice Git permissions manager. I needed the webserver to have read access to the repos, so I set the group to www-data, but as Gitolite was managing them, each commit would reset the permissions. I couldn’t get it working by adding www-data to the git group as suggested and would make sense, which I think is a lighttpd issue. The group sticky bit solved this problem by stopping the group owner from changing. I didn’t want the GitoliteĀ configuration repos displayed on GitPHP too, so I pointed GitPHP at a different directory than the one the repos were actually in, and filled that with symbolic links to the repos it should display.

1 comment

  1. Also edit /home/git/.gitolite.rc and change the $REPO_UMASK value to 0027. If you don’t do this, new dirs (e.g. when you push a new branch) inherit the group, but not the read/execute perms.

    Thanks for the idea about symlinks to the actual repos!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.