Fedora 19 gitweb in action

Setting up gitweb on Fedora 19+ to publish git repositories using the Apache web server, once I reverse engineered how the rpm set things up. The Git book, sadly, couldn;t address the specifics of Red Hat’s distinctive implementation.

The Fedora version of the gitweb rpm deploys these files:

/etc/gitweb.conf
/etc/httpd/conf.d/git.conf
/usr/share/doc/gitweb-1.8.3.1
/usr/share/doc/gitweb-1.8.3.1/INSTALL
/usr/share/doc/gitweb-1.8.3.1/README
/var/www/git
/var/www/git/gitweb.cgi
/var/www/git/static
/var/www/git/static/git-favicon.png
/var/www/git/static/git-logo.png
/var/www/git/static/gitweb.css
/var/www/git/static/gitweb.js

The engine that drives everything in that package is gitweb.cgi, a perl script that serves the same purpose that hgweb.cgi does for Mercurial repositories. The script itself comes with preconfigured defaults, but these are overridden by global entries in the /etc/gitweb.conf config file.

To publish my repos all I had to do was edit /etc/gitweb.conf. By default the global variable $project_root is commented out. The gitweb.cgi script itself maps this variable to /var/lib/git. Since the shared “bare” copies of my git repositories were being stored at /data/share/git all I had to do was edit gitweb.conf, uncomment $project_root and then change the path, thusly:

our $project_root = "/data/share/git";

Once these changes were made I simply restarted Apache and pointed my browser at http://localhost/git.

There are alternatives to gitweb, like GitList, for which there is this very good Fedora-centric installation tutorial.

References:

How to: Install and Configure GitWeb

This entry was posted in Development, System Administration on by .

About phil

My name is Phil Lembo. In my day job I’m an enterprise IT architect for a leading distribution and services company. The rest of my time I try to maintain a semi-normal family life in the suburbs of Raleigh, NC. E-mail me at philipATlembobrothersDOTcom. The opinions expressed here are entirely my own and not those of my employers, past, present or future (except where I quote others, who will need to accept responsibility for their own rants).