Gitweb configuration, the easy way

Ok if you have juste one git repository, git instaweb is for you. This command automatically generate the config to connect with a webserver installed on your server. I recommand you to try, it’s impressive as it’s simple. For me the best config is :

git instaweb -d webrick

Now if you have several git projects as I am, you want to use gitweb. In fact instaweb uses the gitweb script but configured for one specific repository. The script is in .git/gitweb/gitweb.cgi .

On Ubuntu, install the script with the command:

apt-get install gitweb

I’m going to assume you have apache2 and mod_perl installed. So in the config file


add this config at the end of the VirtualHost block:

ScriptAlias /git “/usr/lib/cgi-bin/gitweb.cgi”
<Directory “/home/git/”>
Options Indexes FollowSymLinks ExecCGI
Order allow,deny
Allow from all

Now you just have to configure gitweb by setting the directory containing your git projects in the file:


Finally, restart apache and you should be able to browse your projects on this url: