instaweb: support mod_cgid for apache2
Some people have mod_cgid instead of mod_cgi, most likely as a result of choosing a threaded MPM. In cases where the user has both modules, mod_cgi will be preferred in order to maintain a simpler setup. This patch also causes instaweb to print a message and die in cases where there is no module that instaweb knows how to handle. Signed-off-by: Mark Rada <marada@uwaterloo.ca> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Mark Rada committed
Sep 26, 2009 at 14:12 UTC
10d1432aece21ac65a89fe962b1c3019ec1f46e0
1 file changed
+15
-1
git-instaweb.sh
+15
-1
@@ -317,7 +317,21 @@ EOF
317
resolve_full_httpd
318
list_mods=$(echo "$full_httpd" | sed "s/-f$/-l/")
319
$list_mods | grep 'mod_cgi\.c' >/dev/null 2>&1 || \
320
- echo "LoadModule cgi_module $module_path/mod_cgi.so" >> "$conf"
320
+ if test -f "$module_path/mod_cgi.so"
321
+ then
322
+ echo "LoadModule cgi_module $module_path/mod_cgi.so" >> "$conf"
323
+ else
324
+ $list_mods | grep 'mod_cgid\.c' >/dev/null 2>&1 || \
325
+ if test -f "$module_path/mod_cgid.so"
326
+ then
327
+ echo "LoadModule cgid_module $module_path/mod_cgid.so" \
328
+ >> "$conf"
329
+ else
330
+ echo "You have no CGI support!"
331
+ exit 2
332
+ fi
333
+ echo "ScriptSock logs/gitweb.sock" >> "$conf"
334
+ fi
335
cat >> "$conf" <<EOF
336
AddHandler cgi-script .cgi
337
<Location /gitweb.cgi>