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-18.104.22.168 /usr/share/doc/gitweb-22.214.171.124/INSTALL /usr/share/doc/gitweb-126.96.36.199/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.