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

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