http-backend: add example for gitweb on same URL
In the git-http-backend documentation, add an example of how to set up gitweb and git-http-backend on the same URL by using a series of mod_alias commands. Signed-off-by: Mark Lodato <lodatom@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Mark Lodato committed
Oct 30, 2009 at 17:47 UTC
8127f778a0f6495a0b8484a21b5591e56d873de8
1 file changed
+33
Documentation/git-http-backend.txt
+33
@@ -88,6 +88,23 @@ directive around the repository, or one of its parent directories:
88
...
89
</Location>
90
----------------------------------------------------------------
91
++
92
+To serve gitweb at the same url, use a ScriptAliasMatch to only
93
+those URLs that 'git-http-backend' can handle, and forward the
94
+rest to gitweb:
95
++
96
+----------------------------------------------------------------
97
+ScriptAliasMatch \
98
+ "(?x)^/git/(.*/(HEAD | \
99
+ info/refs | \
100
+ objects/(info/[^/]+ | \
101
+ [0-9a-f]{2}/[0-9a-f]{38} | \
102
+ pack/pack-[0-9a-f]{40}\.(pack|idx)) | \
103
+ git-(upload|receive)-pack))$" \
104
+ /usr/libexec/git-core/git-http-backend/$1
105
+
106
+ScriptAlias /git/ /var/www/cgi-bin/gitweb.cgi/
107
+----------------------------------------------------------------
108
109
Accelerated static Apache 2.x::
110
Similar to the above, but Apache can be used to return static
@@ -102,6 +119,22 @@ AliasMatch ^/git/(.*/objects/[0-9a-f]{2}/[0-9a-f]{38})$ /var/www/git/$1
119
AliasMatch ^/git/(.*/objects/pack/pack-[0-9a-f]{40}.(pack|idx))$ /var/www/git/$1
120
ScriptAlias /git/ /usr/libexec/git-core/git-http-backend/
121
----------------------------------------------------------------
122
++
123
+This can be combined with the gitweb configuration:
124
++
125
+----------------------------------------------------------------
126
+SetEnv GIT_PROJECT_ROOT /var/www/git
127
+
128
+AliasMatch ^/git/(.*/objects/[0-9a-f]{2}/[0-9a-f]{38})$ /var/www/git/$1
129
+AliasMatch ^/git/(.*/objects/pack/pack-[0-9a-f]{40}.(pack|idx))$ /var/www/git/$1
130
+ScriptAliasMatch \
131
+ "(?x)^/git/(.*/(HEAD | \
132
+ info/refs | \
133
+ objects/info/[^/]+ | \
134
+ git-(upload|receive)-pack))$" \
135
+ /usr/libexec/git-core/git-http-backend/$1
136
+ScriptAlias /git/ /var/www/cgi-bin/gitweb.cgi/
137
+----------------------------------------------------------------
138
139
140
ENVIRONMENT