1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151
|
# $Id: /svn/trunk/debian/dists/libapache2-mod-rpaf/debian/packages 2442 2007-10-30T14:19:40.297193Z dexter $
# If the debian/rules or debian/control file is missing, rebuild the file:
#
# $ yada rebuild control
# $ yada rebuild rules
%define apache2_version %`dpkg -s apache2-threaded-dev | grep ^Version | sed 's/^Version: //'`
Source: libapache2-mod-rpaf
Section: web
Priority: extra
Maintainer: Sergey B Kirpichev <skirpichev@gmail.com>
Standards-Version: 3.7.2
Upstream-Source: http://stderr.net/apache/rpaf/download/
%if %`dpkg --compare-versions %{YADA_VERSION} ge 0.54 && echo 1`
Homepage: http://stderr.net/apache/rpaf/
Vcs-Browser: http://svn.debian.org/wsvn/cvsdebuild/trunk/debian/dists/libapache2-mod-rpaf/
Vcs-Svn: svn://svn.debian.org/cvsdebuild/trunk/debian/dists/libapache2-mod-rpaf
%endif
Description: module for Apache which takes the last IP from the 'X-Forwarded-For' header
Copyright: .
====================================================================
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
.
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
.
3. All advertising materials mentioning features or use of this
software must display the following acknowledgment:
"This product includes software developed by the Apache Group
for use in the Apache HTTP server project (http://www.apache.org/)."
.
4. The names "Apache Server" and "Apache Group" must not be used to
endorse or promote products derived from this software without
prior written permission.
.
5. Redistributions of any form whatsoever must retain the following
acknowledgment:
"This product includes software developed by the Apache Group
for use in the Apache HTTP server project (http://www.apache.org/)."
.
THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY
EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE GROUP OR
IT'S CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
OF THE POSSIBILITY OF SUCH DAMAGE.
====================================================================
.
This software consists of voluntary contributions made by many
individuals on behalf of the Apache Group and was originally based
on public domain software written at the National Center for
Supercomputing Applications, University of Illinois, Urbana-Champaign.
For more information on the Apache Group and the Apache HTTP server
project, please see <http://www.apache.org/>.
.
Author: Thomas Eibner, <thomas@stderr.net>
Patches: patches/*.patch
Major-Changes:
%`cd debian/patches; ls *.patch | sed -e 's/^/ /'`
Build-Depends: apache2-threaded-dev (>= 2.0.50-10)
Build: bash
APXS2=${APXS2:-apxs2}
CFLAGS=${CFLAGS:--Wall -g}
if [ "${DEB_BUILD_OPTIONS#*noopt}" != "$DEB_BUILD_OPTIONS" ]; then
CFLAGS="$CFLAGS -O0"
else
CFLAGS="$CFLAGS -O2"
fi
.
if [ -d apache2-build ]; then
rm -rf apache2-build
fi
mkdir apache2-build
pushd apache2-build
cp -a ../mod_rpaf-2.0.c mod_rpaf.c
$APXS2 -c -S CFLAGS="`$APXS2 -q CFLAGS` `apr-1-config --cppflags` $CFLAGS" mod_rpaf.c
popd
Clean: sh
rm -rf *-build || true
Package: libapache2-mod-rpaf
Architecture: any
Depends: apache2.2-common (>= %{apache2_version}), []
Description: module for Apache2 which takes the last IP from the 'X-Forwarded-For' header
rpaf is short for reverse proxy add forward.
.
rpaf is for backend Apache servers what mod_proxy_add_forward is for
frontend Apache servers. It does exactly the opposite of
mod_proxy_add_forward written by Ask Bjorn Hansen.
.
It changes the remote address of the client visible to other Apache modules
when two conditions are satisfied. First condition is that the remote client
is actually a proxy that is defined in httpd.conf. Secondly if there is an
incoming X-Forwarded-For header and the proxy is in its list of known
proxies it takes the last IP from the incoming X-Forwarded-For header and
changes the remote address of the client in the request structure.
Install: sh
APXS2=${APXS2:-apxs2}
LIBEXECDIR=$($APXS2 -q LIBEXECDIR)
yada install -dir $LIBEXECDIR
$APXS2 -i -S LIBEXECDIR="$ROOT$LIBEXECDIR" apache2-build/mod_rpaf.la
yada install -conf -into /etc/apache2/mods-available debian/conf/*.conf
yada install -conf -into /etc/apache2/mods-available debian/conf/*.load
yada install -doc debian/doc/README.Debian
Postinst: sh
reload_apache()
{
if apache2ctl configtest 2>/dev/null; then
invoke-rc.d apache2 force-reload || true
else
echo "Your apache2 configuration is broken, so we're not restarting it for you."
fi
}
.
if [ -n "$2" ]; then
# we're upgrading. test if we're enabled, and if so, restart to reload the module.
if [ -e /etc/apache2/mods-enabled/rpaf.load ]; then
reload_apache
fi
exit 0
elif [ -e /etc/apache2/apache2.conf ]; then
a2enmod rpaf >/dev/null || true
reload_apache
fi
Prerm: sh
if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then
if [ -e /etc/apache2/apache2.conf ]; then
a2dismod rpaf || true
fi
fi
# Debug:
# with_debian_etch=%{with_debian_etch}
# apache2_version=%{apache2_version}
|