summaryrefslogtreecommitdiff
path: root/git-instaweb.sh
diff options
context:
space:
mode:
authorMark Rada <marada@uwaterloo.ca>2009-09-26 18:12:32 (GMT)
committerShawn O. Pearce <spearce@spearce.org>2009-09-29 17:06:52 (GMT)
commit10d1432aece21ac65a89fe962b1c3019ec1f46e0 (patch)
tree156321568c428883bbcc6c13a0f46342e7252c1b /git-instaweb.sh
parent1be224ba6e99f0ab34c998d7fa8023b76a15c8b6 (diff)
downloadgit-10d1432aece21ac65a89fe962b1c3019ec1f46e0.zip
git-10d1432aece21ac65a89fe962b1c3019ec1f46e0.tar.gz
git-10d1432aece21ac65a89fe962b1c3019ec1f46e0.tar.bz2
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>
Diffstat (limited to 'git-instaweb.sh')
-rwxr-xr-xgit-instaweb.sh16
1 files changed, 15 insertions, 1 deletions
diff --git a/git-instaweb.sh b/git-instaweb.sh
index d96eddb..622a5f0 100755
--- a/git-instaweb.sh
+++ b/git-instaweb.sh
@@ -317,7 +317,21 @@ EOF
resolve_full_httpd
list_mods=$(echo "$full_httpd" | sed "s/-f$/-l/")
$list_mods | grep 'mod_cgi\.c' >/dev/null 2>&1 || \
- echo "LoadModule cgi_module $module_path/mod_cgi.so" >> "$conf"
+ if test -f "$module_path/mod_cgi.so"
+ then
+ echo "LoadModule cgi_module $module_path/mod_cgi.so" >> "$conf"
+ else
+ $list_mods | grep 'mod_cgid\.c' >/dev/null 2>&1 || \
+ if test -f "$module_path/mod_cgid.so"
+ then
+ echo "LoadModule cgid_module $module_path/mod_cgid.so" \
+ >> "$conf"
+ else
+ echo "You have no CGI support!"
+ exit 2
+ fi
+ echo "ScriptSock logs/gitweb.sock" >> "$conf"
+ fi
cat >> "$conf" <<EOF
AddHandler cgi-script .cgi
<Location /gitweb.cgi>