gitweb apache config

After hs in config hell this:

    Alias /git /srv/www/htdocs/git
 <Directory /srv/www/htdocs/git>
     Options ExecCGI  Indexes  +FollowSymLinks
     AddHandler cgi-script cgi
     DirectoryIndex gitweb.cgi
     RewriteEngine On
     RewriteCond %{REQUEST_FILENAME} !-f
     RewriteCond %{REQUEST_FILENAME} !-d
     RewriteRule ^.* /git/gitweb.cgi/$0 [L,PT]

works for me placed in a gitweb.conf below


Do so if you want to provide git (bare) repos over apache …

Don’t forget to

 touch git-daemon-export-ok

otherwise you will get a 404 No- projects found. Also execute

git update-server-info

and enable the sample post-update hook

13 notes