threads / patch / 4989

patch, 5 partsgit-instaweb: some Apache have mod_cgi builtin

Subject: [PATCH 2/5] git-instaweb: some Apache have mod_cgi builtin

## tl;dr

One message between Jul 26, 2006 and Jul 26, 2006. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Johannes Schindelin· Jul 26, 2006, 14:33 UTC · lore
So test for it, and do not always try to load mod_cgi.o.
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
---
 git-instaweb.sh |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
Show changes to git-instaweb.sh +3 −1
diff --git a/git-instaweb.sh b/git-instaweb.sh
index 63b18b9..9829c59 100755
--- a/git-instaweb.sh
+++ b/git-instaweb.sh
@@ -183,8 +183,10 @@ PerlPassEnv GIT_EXEC_DIR
 EOF
 	else
 		# plain-old CGI
+		list_mods=`echo "$httpd" | sed "s/-f$/-l/"`
+		$list_mods | grep 'mod_cgi\.c' >/dev/null || \
+		echo "LoadModule cgi_module $module_path/mod_cgi.so" >> "$conf"
 		cat >> "$conf" <<EOF
-LoadModule cgi_module $module_path/mod_cgi.so
 AddHandler cgi-script .cgi
 <Location /gitweb.cgi>
 	Options +ExecCGI
-- 
1.4.2.rc2.g6a4e

← back to recent threads