git-instaweb: support Fedora/Red Hat apache module path

On Fedora-derived systems, the apache httpd package installs modules under /usr/lib{,64}/httpd/modules, depending on whether the system is 32- or 64-bit. A symlink from /etc/httpd/modules is created which points to the proper module path. Use it to support apache on Fedora, CentOS, and Red Hat systems. Written with assistance of Todd Zullinger <tmz@pobox.com> and Junio C Hamano <gitster@pobox.com>. Signed-off-by: Sebastian Kisela <skisela@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Sebastian Kisela committed Aug 8, 2018 at 10:49 UTC 1976311aa285549599e5a451d7ad72b55a2b60e2
1 file changed +11 -7
git-instaweb.sh
+11 -7
@@ -326,13 +326,17 @@ EOF
326 }
327
328 apache2_conf () {
329 - if test -z "$module_path"
330 - then
331 - test -d "/usr/lib/httpd/modules" &&
332 - module_path="/usr/lib/httpd/modules"
333 - test -d "/usr/lib/apache2/modules" &&
334 - module_path="/usr/lib/apache2/modules"
335 - fi
329 + for candidate in \
330 + /etc/httpd \
331 + /usr/lib/apache2 \
332 + /usr/lib/httpd ;
333 + do
334 + if test -d "$candidate/modules"
335 + then
336 + module_path="$candidate/modules"
337 + break
338 + fi
339 + done
340 bind=
341 test x"$local" = xtrue && bind='127.0.0.1:'
342 echo 'text/css css' > "$fqgitdir/mime.types"