Skip to content

Commit 10d1432

Browse files
ferrous26spearce
authored andcommitted
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 <[email protected]> Signed-off-by: Shawn O. Pearce <[email protected]>
1 parent 1be224b commit 10d1432

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

git-instaweb.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,21 @@ EOF
317317
resolve_full_httpd
318318
list_mods=$(echo "$full_httpd" | sed "s/-f$/-l/")
319319
$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
321335
cat >> "$conf" <<EOF
322336
AddHandler cgi-script .cgi
323337
<Location /gitweb.cgi>

0 commit comments

Comments
 (0)