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

[PATCH 4/5] git-instaweb: Fall back to Apache when LigHTTP was not found

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jul 26, 2006, 14:34 UTC
Message-ID
<Pine.LNX.4.63.0607261633560.29667@wbgn013.biozentrum.uni-wuerzburg.de>
Apache is more likely to be installed...
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
---
 git-instaweb.sh |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/git-instaweb.sh b/git-instaweb.sh
index 1d3ea73..242b55e 100755
--- a/git-instaweb.sh
+++ b/git-instaweb.sh
@@ -25,9 +25,6 @@ conf=$GIT_DIR/gitweb/httpd.conf
 
 # Defaults:
 
-# if installed, it doesn't need further configuration (module_path)
-test -z "$httpd" && httpd='lighttpd -f'
-
 # probably the most popular browser among gitweb users
 test -z "$browser" && browser='firefox'
 
@@ -135,6 +132,15 @@ do
 	shift
 done
 
+# if installed, it doesn't need further configuration (module_path)
+if [ -z "$httpd" ]; then
+	httpd='lighttpd -f'
+	which "$httpd" >/dev/null 2>&1 || httpd='apache2 -f'
+	which "$httpd" >/dev/null 2>&1 || httpd='apache -f'
+	which "$httpd" >/dev/null 2>&1 || httpd='httpd -f'
+	which "$httpd" >/dev/null || exit 1
+fi
+
 mkdir -p "$GIT_DIR/gitweb/tmp"
 GIT_EXEC_PATH="`git --exec-path`"
 GIT_DIR="$fqgitdir"
-- 
1.4.2.rc2.g6a4e
Next: Junio C Hamano
Message 1 of 4 in “git-instaweb: Fall back to Apache when LigHTTP was not found”
  1. 4/5 git-instaweb: Fall back to Apache when LigHTTP was not foundJohannes Schindelin, Jul 26, 2006
  2. Junio C HamanoJul 26, 2006
  3. Johannes SchindelinJul 26, 2006
  4. instaweb: Be more clear if httpd or the browser failJohannes Schindelin, Jul 26, 2006

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.