summaryrefslogtreecommitdiff
path: root/templates/apache-gitweb.conf.erb
blob: 5a11424d7e59fc79e349e21f366cdd772e529065 (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
26
27
28
29
30
31
32
33
34
NameVirtualHost  *:<%= port %>
<VirtualHost *:<%= port %>>
    ServerName <%= name %>
    DocumentRoot <%= docroot %>
    SuexecUserGroup git git

    RewriteEngine on
    RewriteRule ^/$  /index.cgi [L]

<% if ssl == true -%>
    SSLEngine on
    SSLCertificateFile /etc/ssl/certs/gitweb.cert
    SSLCertificateKeyFile /etc/ssl/private/gitweb.key
<% end -%>

    <Directory <%= docroot %>>
        Options ExecCGI +FollowSymLinks +SymLinksIfOwnerMatch
        AllowOverride All
        order allow,deny
        Allow from all
        AddHandler cgi-script cgi
        DirectoryIndex gitweb.cgi
        AuthType Basic
        AuthName "Gitweb"
        AuthUserFile /home/git/.htpasswd
        Require valid-user
    </Directory>

    ErrorLog /var/log/apache2/<%= name %>_error.log
    LogLevel warn
    CustomLog /var/log/apache2/<%= name %>_access.log combined
    ServerSignature Off
</VirtualHost>