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
    </Directory>
</VirtualHost>

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
    SSLRequireSSL
    SetEnv GITWEB_CONFIG /etc/gitweb.conf
    AddHandler cgi-script cgi
    DirectoryIndex /usr/lib/cgi-bin/gitweb.cgi
</Location>

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

link|improve this question
What exactly is the problem you encounter? Error message when requesting gitweb? Something in the apache2 error logs? – Adrian Lang 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 Lang Mar 12 '11 at 10:27
feedback

1 Answer

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
    SSLRequireSSL
    Options +Indexes +ExecCGI +FollowSymLinks +MultiViews
    AddHandler cgi-script .cgi
    DirectoryIndex gitweb.cgi
    Order allow,deny
    Allow from all
</Directory>

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

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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