git-instaweb: fix lighttpd configuration on cygwin
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Tested-by: Pascal Obry <pascal@obry.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ramsay Jones committed
Mar 9, 2009 at 18:31 UTC
e47eec8fc6efb5ad0574b4862fd8e8e82b6a62fa
1 file changed
+66
-3
git-instaweb.sh
+66
-3
@@ -49,7 +49,7 @@ resolve_full_httpd () {
49
esac
50
51
httpd_only="$(echo $httpd | cut -f1 -d' ')"
52
- if case "$httpd_only" in /*) : ;; *) which $httpd_only >/dev/null;; esac
52
+ if case "$httpd_only" in /*) : ;; *) which $httpd_only >/dev/null 2>&1;; esac
53
then
54
full_httpd=$httpd
55
else
@@ -179,11 +179,74 @@ lighttpd_conf () {
179
cat > "$conf" <<EOF
180
server.document-root = "$fqgitdir/gitweb"
181
server.port = $port
182
-server.modules = ( "mod_cgi" )
182
+server.modules = ( "mod_setenv", "mod_cgi" )
183
server.indexfiles = ( "gitweb.cgi" )
184
server.pid-file = "$fqgitdir/pid"
185
+server.errorlog = "$fqgitdir/gitweb/error.log"
186
+
187
+# to enable, add "mod_access", "mod_accesslog" to server.modules
188
+# variable above and uncomment this
189
+#accesslog.filename = "$fqgitdir/gitweb/access.log"
190
+
191
+setenv.add-environment = ( "PATH" => "/usr/local/bin:/usr/bin:/bin" )
192
+
193
cgi.assign = ( ".cgi" => "" )
186
-mimetype.assign = ( ".css" => "text/css" )
194
+
195
+# mimetype mapping
196
+mimetype.assign = (
197
+ ".pdf" => "application/pdf",
198
+ ".sig" => "application/pgp-signature",
199
+ ".spl" => "application/futuresplash",
200
+ ".class" => "application/octet-stream",
201
+ ".ps" => "application/postscript",
202
+ ".torrent" => "application/x-bittorrent",
203
+ ".dvi" => "application/x-dvi",
204
+ ".gz" => "application/x-gzip",
205
+ ".pac" => "application/x-ns-proxy-autoconfig",
206
+ ".swf" => "application/x-shockwave-flash",
207
+ ".tar.gz" => "application/x-tgz",
208
+ ".tgz" => "application/x-tgz",
209
+ ".tar" => "application/x-tar",
210
+ ".zip" => "application/zip",
211
+ ".mp3" => "audio/mpeg",
212
+ ".m3u" => "audio/x-mpegurl",
213
+ ".wma" => "audio/x-ms-wma",
214
+ ".wax" => "audio/x-ms-wax",
215
+ ".ogg" => "application/ogg",
216
+ ".wav" => "audio/x-wav",
217
+ ".gif" => "image/gif",
218
+ ".jpg" => "image/jpeg",
219
+ ".jpeg" => "image/jpeg",
220
+ ".png" => "image/png",
221
+ ".xbm" => "image/x-xbitmap",
222
+ ".xpm" => "image/x-xpixmap",
223
+ ".xwd" => "image/x-xwindowdump",
224
+ ".css" => "text/css",
225
+ ".html" => "text/html",
226
+ ".htm" => "text/html",
227
+ ".js" => "text/javascript",
228
+ ".asc" => "text/plain",
229
+ ".c" => "text/plain",
230
+ ".cpp" => "text/plain",
231
+ ".log" => "text/plain",
232
+ ".conf" => "text/plain",
233
+ ".text" => "text/plain",
234
+ ".txt" => "text/plain",
235
+ ".dtd" => "text/xml",
236
+ ".xml" => "text/xml",
237
+ ".mpeg" => "video/mpeg",
238
+ ".mpg" => "video/mpeg",
239
+ ".mov" => "video/quicktime",
240
+ ".qt" => "video/quicktime",
241
+ ".avi" => "video/x-msvideo",
242
+ ".asf" => "video/x-ms-asf",
243
+ ".asx" => "video/x-ms-asf",
244
+ ".wmv" => "video/x-ms-wmv",
245
+ ".bz2" => "application/x-bzip",
246
+ ".tbz" => "application/x-bzip-compressed-tar",
247
+ ".tar.bz2" => "application/x-bzip-compressed-tar",
248
+ "" => "text/plain"
249
+ )
250
EOF
251
test x"$local" = xtrue && echo 'server.bind = "127.0.0.1"' >> "$conf"
252
}