git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 3/3] git-instaweb: Don't assume Apache executable is named apache2

From
EWEric Wong <normalperson@yhbt.net>
Date
Jul 23, 2010, 18:22 UTC
Message-ID
<20100723182209.GA19333@dcvr.yhbt.net>
In-Reply-To
<AANLkTimfy0F7x-WZpfJ0J45jUWjb9lrJt99jY0fO6ZzC@mail.gmail.com>
Dan McGee <dpmcgee@gmail.com> wrote:
Show 11 quoted lines
> On Wed, Jun 30, 2010 at 11:03 AM, Junio C Hamano <gitster@pobox.com> wrote:
> > Dan McGee <dpmcgee@gmail.com> writes:
> >
> >> On Arch Linux, we keep the original 'httpd' name for the exectuable and
> >> don't rename it or the path to the modules.
> >
> > Sorry, but I cannot parse the last 6 words here.
> 
> On Arch Linux, the executable for the Apache HTTP server keeps the
> 'httpd' name and is not named 'apache2'. The path to the server
> modules also contains 'httpd' rather than 'apache2'.
(I missed this message the first time around since I wasn't Cc-ed).
Thanks Dan,

I've pushed your series of patches up to my "instaweb" branch on git://git.bogomips.org/git-svn and reworked the commit message of 3/3 below:

>From 4bdf85995b5d21fdb085a480d529c8da0314189e Mon Sep 17 00:00:00 2001
From: Dan McGee <dpmcgee@gmail.com>
Date: Wed, 30 Jun 2010 07:29:08 -0500
Subject: [PATCH] git-instaweb: Don't assume Apache executable is named apache2

On Arch Linux, the executable for the Apache HTTP server keeps the 'httpd' name and is not named 'apache2'. The path to the server modules also contains 'httpd' rather than 'apache2'. Remove some of these assumptions and add the httpd name in where it may be required. Finally, make some slight style adjustments to the code we are touching to make it fit the style of the rest of the script.

Signed-off-by: Dan McGee <dpmcgee@gmail.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
---
 git-instaweb.sh |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/git-instaweb.sh b/git-instaweb.sh
index 1d349b8..b7342e2 100755
--- a/git-instaweb.sh
+++ b/git-instaweb.sh
@@ -43,7 +43,8 @@ test -z "$port" && port=1234
 
 resolve_full_httpd () {
 	case "$httpd" in
-	*apache2*|*lighttpd*)
+	*apache2*|*lighttpd*|*httpd*)
+		# yes, *httpd* covers *lighttpd* above, but it is there for clarity
 		# ensure that the apache2/lighttpd command ends with "-f"
 		if ! echo "$httpd" | sane_grep -- '-f *$' >/dev/null 2>&1
 		then
@@ -300,7 +301,13 @@ EOF
 }
 
 apache2_conf () {
-	test -z "$module_path" && module_path=/usr/lib/apache2/modules
+	if test -z "$module_path"
+	then
+		test -d "/usr/lib/httpd/modules" &&
+			module_path="/usr/lib/httpd/modules"
+		test -d "/usr/lib/apache2/modules" &&
+			module_path="/usr/lib/apache2/modules"
+	fi
 	bind=
 	test x"$local" = xtrue && bind='127.0.0.1:'
 	echo 'text/css css' > "$fqgitdir/mime.types"
@@ -314,8 +321,10 @@ PidFile "$fqgitdir/pid"
 Listen $bind$port
 EOF
 
-	for mod in mime dir env log_config; do
-		if test -e $module_path/mod_${mod}.so; then
+	for mod in mime dir env log_config
+	do
+		if test -e $module_path/mod_${mod}.so
+		then
 			echo "LoadModule ${mod}_module " \
 			     "$module_path/mod_${mod}.so" >> "$conf"
 		fi
@@ -563,7 +572,7 @@ case "$httpd" in
 *lighttpd*)
 	lighttpd_conf
 	;;
-*apache2*)
+*apache2*|*httpd*)
 	apache2_conf
 	;;
 webrick)
-- 
Eric Wong
Previous: Dan McGee
Message 12 of 12 in “git-instaweb: Fix custom apache log placement”
  1. 1/3 git-instaweb: Fix custom apache log placementDan McGee, Jun 30, 2010
  2. 2/3 git-instaweb: Fix Apache environment variable passingDan McGee, Jun 30, 2010
  3. 3/3 git-instaweb: Don't assume Apache executable is named apache2Dan McGee, Jun 30, 2010
  4. Eric WongJun 30, 2010
  5. 3/3 git-instaweb: Don't assume Apache executable is named apache2Dan McGee, Jun 30, 2010
  6. Junio C HamanoJun 30, 2010
  7. Dan McGeeJul 22, 2010
  8. Eric WongJul 22, 2010
  9. Dan McGeeJul 23, 2010
  10. Junio C HamanoJul 23, 2010
  11. Dan McGeeJun 30, 2010
  12. Eric WongJul 23, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.