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

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

From
Dan McGee <dpmcgee@gmail.com>
Date
Jun 30, 2010, 02:45 UTC
Message-ID
<1277865900-25044-3-git-send-email-dpmcgee@gmail.com>
In-Reply-To
<1277865900-25044-1-git-send-email-dpmcgee@gmail.com>

On Arch Linux, we keep the original 'httpd' name for the exectuable and don't rename it or the path to the modules. Remove some of these assumptions and add the httpd name in where it may be required.

Signed-off-by: Dan McGee <dpmcgee@gmail.com>
---
 git-instaweb.sh |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/git-instaweb.sh b/git-instaweb.sh
index 1d349b8..d0091f2 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,10 @@ 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"
@@ -563,7 +567,7 @@ case "$httpd" in
 *lighttpd*)
 	lighttpd_conf
 	;;
-*apache2*)
+*apache2*|*httpd*)
 	apache2_conf
 	;;
 webrick)
-- 
1.7.1
Previous: Dan McGeeNext: Eric Wong
Message 3 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.