aboutsummaryrefslogtreecommitdiff
path: root/templates/apache/vhosts/git.erb
blob: 5f767e0b4fde70a98179d2dc8cbd1363c275489d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# begin vhost for git
<VirtualHost *:80>
    # Recipe based on http://josephspiros.com/2009/07/26/configuring-gitweb-for-apache-on-debian

    ServerName git.<%= domain %>
    ServerAlias gitweb.<%= domain %>
    SetEnv GITWEB_CONFIG /etc/gitweb.conf
    HeaderName HEADER
    DocumentRoot /var/git/repositories
    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

    ScriptAlias /gitweb /usr/lib/cgi-bin/gitweb.cgi
    RewriteEngine on

    # Rewrite all other paths that aren't git repo internals to gitweb
    RewriteRule ^/$ /gitweb [PT]
    RewriteRule ^/(.*\.git/(?!/?(HEAD|info|objects|refs)).*)?$ /gitweb%{REQUEST_URI} [L,PT]

   <IfModule mpm_itk_module>
     AssignUserId www-data git
   </IfModule>
</VirtualHost>
# end vhost for git