Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Since DynDNS no longer resolves subdomains for free I have to use gitweb on a subdir of the apache2. Usual suspects such as Pro Git suggest something like

<VirtualHost *:80>
    ServerName gitserver
    DocumentRoot /srv/gitosis/repositories/
    <Directory /srv/gitosis/repositories/>
        Options ExecCGI +FollowSymLinks +SymLinksIfOwnerMatch
        AllowOverride All
        order allow,deny
        Allow from all
        AddHandler cgi-script cgi
        DirectoryIndex gitweb.cgi

I tried various variations using Location and Directory tags with different attribute combinations without any notable success.

My first Idea was close to the following

Alias /gitweb /srv/gitosis/repositories
<Location /gitweb>
    AuthType Basic
    AuthName "gitweb Repository view"
    AuthUserFile /etc/apache2/gitweb.passwd
    Require valid-user
    SetEnv GITWEB_CONFIG /etc/gitweb.conf
    AddHandler cgi-script cgi
    DirectoryIndex /usr/lib/cgi-bin/gitweb.cgi

Apache is in the gitosis group, the repositories are readable and executable for that group.

So, what is the indended way to get websvn run on Ubuntu 10?

EDIT: using "git instaweb --httpd=apache2" in a repo as user gitosis works fine

share|improve this question
What exactly is the problem you encounter? Error message when requesting gitweb? Something in the apache2 error logs? – Adrian Heine Mar 12 '11 at 8:24
Using the upper configuration I connect to server/gitweb but after logging in I only get the standard directory tree view. That may be ok for the repositories dir, but when diving into the repos the view should change. – mbx Mar 12 '11 at 9:57
Not really a solution, but DirectoryIndex will definitely not work since it’s a relative URL, not a file system path – Adrian Heine Mar 12 '11 at 10:27
up vote 0 down vote accepted

Finally I got some solution, or at least a workaround as it doesn't seem to be very elegant. I use the existing ssl vhost with the following config:

Alias /gitweb /usr/lib/cgi-bin
Alias /gitweb.css /usr/share/gitweb/gitweb.css
Alias /git-favicon.png /usr/share/gitweb/git-favicon.png
Alias /git-logo.png /usr/share/gitweb/git-logo.png
<Directory /usr/lib/cgi-bin>
    AuthType Basic
    AuthName "Gitweb Repository View"
    AuthUserFile /etc/apache2/gitweb.passwd
    Require valid-user
    Options +Indexes +ExecCGI +FollowSymLinks +MultiViews
    AddHandler cgi-script .cgi
    DirectoryIndex gitweb.cgi
    Order allow,deny
    Allow from all

I don't like those aliases, but at least it works without touching the cgi.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.