Skip to Content.
Sympa Menu

shibboleth-dev - Apache version detection

Subject: Shibboleth Developers

List archive

Apache version detection


Chronological Thread 
  • From: Jim Fox <>
  • To:
  • Subject: Apache version detection
  • Date: Wed, 28 Mar 2007 11:16:37 -0700 (PDT)


On Tue, 27 Mar 2007, Scott Cantor wrote:

I would welcome an autoconf patch that autodetects the Apache version if
none is provided, but it would have to be tested on probably 3-4 different
Linuxes.


The easiest way that ought to work everywhere is
to ask the daemon. Like this:

# Find out which apache we're working for
# by asking the server
# (assuming APXS is the apxs program. and SED is sed)

AC_MSG_CHECKING([Apache version])
APACHE_VERSION=
httpd="`$APXS -q SBINDIR`/`$APXS -q TARGET`"
if test "x$httpd" != "x"; then
v=`$httpd -v|$SED -n -e 's/.*Apache\/\.*//p'`
case $v in
1.3.*) APACHE_VERSION="1_3"
;;
2.*) APACHE_VERSION="$v"
;;
esac
fi
AC_MSG_RESULT([$APACHE_VERSION])


If that fails then you have to do test compiles to
examine the include files.

Jim





Archive powered by MHonArc 2.6.16.

Top of Page