From: nathan spindel <nathans@gmail.com>
To: git@vger.kernel.org
Cc: nathan spindel <nathans@gmail.com>
Subject: [PATCH v2] instaweb: make it compatible with Mac OS X 10.5's apache installation.
Date: Sun, 11 May 2008 12:36:09 -0700 [thread overview]
Message-ID: <1210534569-48466-1-git-send-email-nathans@gmail.com> (raw)
When in apache2 mode if there isn't an apache2 command on the
system but there is a httpd command installed (like there is
on Mac OS X) use that command 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 | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 54 insertions(+), 1 deletions(-)
diff --git a/git-instaweb.sh b/git-instaweb.sh
index 6f91c8f..00e147f 100755
--- a/git-instaweb.sh
+++ b/git-instaweb.sh
@@ -172,7 +172,59 @@ 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 which looks like apache, use that instead
+ # for Mac OS X compatibility.
+ httpd_only="`echo $httpd | cut -f1 -d' '`"
+ if ! type $httpd_only > /dev/null 2>&1
+ then
+ found_apache_command=1
+ httpd_parent_paths="/usr/local/sbin /usr/sbin"
+ for i in $httpd_parent_paths; do
+ if test -x "$i/$httpd_only"
+ then
+ found_apache_command=0
+ break
+ fi
+ done
+
+ if test $found_apache_command != 0
+ then
+ alt_apache="httpd"
+ if type $alt_apache > /dev/null 2>&1
+ then
+ $alt_apache -v | grep Apache > /dev/null 2>&1
+ if test $? == 0
+ then
+ httpd=`echo "$httpd" | sed "s/apache2/httpd/"`
+ else
+ for i in $httpd_parent_paths; do
+ if test -x "$i/$alt_apache"
+ then
+ $i/$alt_apache -v | grep Apache > /dev/null 2>&1
+ if test $? == 0
+ then
+ httpd=`echo "$httpd" | sed "s/apache2/httpd/"`
+ break
+ fi
+ fi
+ done
+ fi
+ fi
+ fi
+ fi
+
+ 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:'
@@ -182,6 +234,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
next reply other threads:[~2008-05-11 19:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-11 19:36 nathan spindel [this message]
2008-05-11 19:41 ` [PATCH v2] instaweb: make it compatible with Mac OS X 10.5's apache installation nathan spindel
2008-05-12 17:52 ` Christian Couder
2008-05-12 18:42 ` Junio C Hamano
2008-05-13 2:54 ` nathan spindel
2008-05-13 12:30 ` Jakub Narebski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1210534569-48466-1-git-send-email-nathans@gmail.com \
--to=nathans@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.