Blame SOURCES/0001-Switch-git-instaweb-default-to-apache.patch

4db972
From fa378a40d41cbffed64b8b85394cb76c6303ef64 Mon Sep 17 00:00:00 2001
4db972
From: Sebastian Kisela <skisela@redhat.com>
4db972
Date: Tue, 26 Jun 2018 23:39:37 +0200
4db972
Subject: [PATCH] Switch git instaweb default to apache
4db972
4db972
On Fedora-derived systems, the apache httpd package installs modules
4db972
under /usr/lib{,64}/httpd/modules, depending on whether the system is
4db972
32- or 64-bit.  A symlink from /etc/httpd/modules is created which
4db972
points to the proper module path.  Use it to support apache on Fedora,
4db972
CentOS, and Red Hat systems.
4db972
4db972
References upstream commit: 1976311aa285549599e5a451d7ad72b55a2b60e2
4db972
---
4db972
 git-instaweb.sh | 32 +++++++++++++++++++++++---------
4db972
 1 file changed, 23 insertions(+), 9 deletions(-)
4db972
4db972
diff --git a/git-instaweb.sh b/git-instaweb.sh
4db972
index 01a1b05..06380b6 100755
4db972
--- a/git-instaweb.sh
4db972
+++ b/git-instaweb.sh
4db972
@@ -34,7 +34,7 @@ conf="$GIT_DIR/gitweb/httpd.conf"
4db972
 # Defaults:
4db972
 
4db972
 # if installed, it doesn't need further configuration (module_path)
4db972
-test -z "$httpd" && httpd='lighttpd -f'
4db972
+test -z "$httpd" && httpd='httpd -f'
4db972
 
4db972
 # Default is @@GITWEBDIR@@
4db972
 test -z "$root" && root='@@GITWEBDIR@@'
4db972
@@ -324,13 +324,17 @@ EOF
4db972
 }
4db972
 
4db972
 apache2_conf () {
4db972
-	if test -z "$module_path"
4db972
-	then
4db972
-		test -d "/usr/lib/httpd/modules" &&
4db972
-			module_path="/usr/lib/httpd/modules"
4db972
-		test -d "/usr/lib/apache2/modules" &&
4db972
-			module_path="/usr/lib/apache2/modules"
4db972
-	fi
4db972
+	for candidate in \
4db972
+		/etc/httpd \
4db972
+		/usr/lib/apache2 \
4db972
+		/usr/lib/httpd ;
4db972
+	do
4db972
+		if test -d "$candidate/modules"
4db972
+		then
4db972
+			module_path="$candidate/modules"
4db972
+			break
4db972
+		fi
4db972
+	done
4db972
 	bind=
4db972
 	test x"$local" = xtrue && bind='127.0.0.1:'
4db972
 	echo 'text/css css' > "$fqgitdir/mime.types"
4db972
@@ -344,7 +348,17 @@ PidFile "$fqgitdir/pid"
4db972
 Listen $bind$port
4db972
 EOF
4db972
 
4db972
-	for mod in mime dir env log_config
4db972
+	for mod in mpm_event mpm_prefork mpm_worker
4db972
+	do
4db972
+		if test -e $module_path/mod_${mod}.so
4db972
+		then
4db972
+			echo "LoadModule ${mod}_module " \
4db972
+			     "$module_path/mod_${mod}.so" >> "$conf"
4db972
+			# only one mpm module permitted
4db972
+			break
4db972
+		fi
4db972
+	done
4db972
+	for mod in mime dir env log_config authz_core unixd
4db972
 	do
4db972
 		if test -e $module_path/mod_${mod}.so
4db972
 		then
4db972
-- 
4db972
2.14.4
4db972