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

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