2 # Copyright (C) 2016 Ian Kelling
3 # This program is under GPL v. 3 or later, see <http://www.gnu.org/licenses/>
16 # debian has the package gitweb, which seems to mainly
17 # have some example apache config, and a minimal gitweb config.
18 # I'll just use the config as example and not use the package.
19 # It's example apache config seems to say we can use cgi or cgid,
20 # and googling cgid it seems a newer faster alternative.
23 s
dd of
=/etc
/gitweb.conf
<<EOF
24 \$projectroot = "$gitroot";
25 # not documented at https://git-scm.com/docs/gitweb.conf,
26 # but it's in the debian conf, so use it.
27 # directory to use for temp files.
32 git_root
=/a
/bin
/githtml
35 apache-site
- $domain <<EOF
36 # to run python script on my site:
37 <Directory /var/www/$domain/html>
38 # to run python scripts with cgi
40 AddHandler cgi-script .py
44 # All below is for gitweb + git-http-web.
45 # A simple builtin way to have a read only git website.
46 # I didn't find any significantly better alternatives out there.
47 SetEnv GIT_PROJECT_ROOT $gitroot
48 SetEnv GIT_HTTP_EXPORT_ALL
50 # note: cgi scripts can go anywhere into the filesystem,
51 # so there is no need to do a directory block for $gitroot
54 <Directory /usr/lib/git-core>
59 <Directory /usr/share/gitweb>
60 Options +FollowSymLinks +ExecCGI
61 AddHandler cgi-script .cgi
64 # from man-git-http-backend, so git-http-web ang gitweb can both be used.
65 # it is instead of this:
66 # #ScriptAlias / /usr/lib/git-core/git-http-backend/
68 "(?x)^/git/(.*/(HEAD | \\
70 objects/(info/[^/]+ | \\
71 [0-9a-f]{2}/[0-9a-f]{38} | \\
72 pack/pack-[0-9a-f]{40}\\.(pack|idx)) | \\
73 git-(upload|receive)-pack))\$" \\
74 /usr/lib/git-core/git-http-backend/\$1
78 # man-git-http-backend claims we should do this, but
79 # it causes no css/images to be displayed. Instead,
80 # just stick with the standard gitweb example directive
82 #ScriptAlias /git /usr/share/gitweb/gitweb.cgi/
83 Alias /git /usr/share/gitweb