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

[PATCH] instaweb: make it compatible with Mac OS X 10.5's apache installation.

From
nathan spindel <nathans@gmail.com>
Date
May 11, 2008, 05:26 UTC
Message-ID
<1210483565-12415-2-git-send-email-nathans@gmail.com>
In-Reply-To
<1210483565-12415-1-git-send-email-nathans@gmail.com>

When in apache2 mode if there isn't an apache2 binary on the system but there is a httpd command in /usr/sbin/ (like there is on Mac OS X) use that instead.

When in apache2 mode and there isn't a module_path specified, look for module paths in /usr/lib/apache2/modules _and_ /usr/libexec/apache2, in that order.

Added a LockFile directive to the apache2 config because the default location of /private/var/run is only root-writeable on Mac OS X.

Signed-off-by: nathan spindel <nathans@gmail.com>
---
 git-instaweb.sh |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)
diff --git a/git-instaweb.sh b/git-instaweb.sh
index b744133..1c9412c 100755
--- a/git-instaweb.sh
+++ b/git-instaweb.sh
@@ -180,7 +180,23 @@ EOF
 }
 
 apache2_conf () {
-	test -z "$module_path" && module_path=/usr/lib/apache2/modules
+	# if there isn't an apache2 command on the system but there is a httpd
+	# command in /usr/sbin/ use that instead for Mac OS X compatibility.
+	httpd_only="`echo $httpd | cut -f1 -d' '`"
+	type $httpd_only > /dev/null 2>&1;
+	test $? != 0 && test -x /usr/sbin/httpd && httpd=${httpd/apache2/httpd}
+
+	if test -z "$module_path"
+	then
+		for path in /usr/lib/apache2/modules /usr/libexec/apache2; do
+			if test -d "$path"
+			then
+				module_path="$path"
+				break
+			fi
+		done
+	fi
+
 	mkdir -p "$GIT_DIR/gitweb/logs"
 	bind=
 	test x"$local" = xtrue && bind='127.0.0.1:'
@@ -190,6 +206,7 @@ ServerName "git-instaweb"
 ServerRoot "$fqgitdir/gitweb"
 DocumentRoot "$fqgitdir/gitweb"
 PidFile "$fqgitdir/pid"
+LockFile "$fqgitdir/gitweb/logs/accept.lock"
 Listen $bind$port
 EOF
 
-- 
1.5.5.1.179.g2fe4.dirty
Previous: nathan spindelNext: nathan spindel
Message 2 of 11 in “instaweb: if no httpd is specified and lighttpd doesn't exist, fall back on apache2.”
  1. instaweb: if no httpd is specified and lighttpd doesn't exist, fall back on apache2.nathan spindel, May 11, 2008
  2. instaweb: make it compatible with Mac OS X 10.5's apache installation.nathan spindel, May 11, 2008
  3. Documentation/git-instaweb.txt: Updated defaults to match my last two git-instaweb.sh changesnathan spindel, May 11, 2008
  4. Junio C HamanoMay 11, 2008
  5. nathan spindelMay 11, 2008
  6. Junio C HamanoMay 11, 2008
  7. nathan spindelMay 11, 2008
  8. nathan spindelMay 11, 2008
  9. David SymondsMay 11, 2008
  10. nathan spindelMay 11, 2008
  11. Junio C HamanoMay 11, 2008

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.