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 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221
|
# $Id: /trunk/debian/dists/libapache-mod-rpaf/debian/packages 45 2005-03-16T10:19:55.256069Z dexter $
# If the debian/rules or debian/control file is missing, rebuild the file:
#
# $ yada rebuild control
# $ yada rebuild rules
%define apache_version %`dpkg -s apache-dev | grep ^Version | sed 's/^Version: //'`
%define apache2_version %`dpkg -s apache2-threaded-dev | grep ^Version | sed 's/^Version: //'`
# Other macros:
# apache_version=%{apache_version}
# apache2_version=%{apache2_version}
Source: libapache-mod-rpaf
Section: web
Priority: extra
Maintainer: Piotr Roszatycki <dexter@debian.org>
Standards-Version: 3.6.1
Upstream-Source: <URL:http://stderr.net/apache/rpaf/download/mod_rpaf-(.*)\.tar.gz>
Home-Page: <URL:http://stderr.net/apache/rpaf/>
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>
Build-Depends: apache-dev (>= 1.3.23)
Build-Depends: apache2-threaded-dev (>= 2.0.50-10)
Build: bash
APXS=${APXS:-apxs}
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 apache-build ]; then
rm -rf apache-build
fi
mkdir apache-build
pushd apache-build
cp -a ../mod_rpaf.c mod_rpaf.c
$APXS -c -S CFLAGS="`$APXS -q CFLAGS` $CFLAGS" mod_rpaf.c
popd
.
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` $CFLAGS" mod_rpaf.c
popd
Clean: sh
rm -rf *-build || true
Package: libapache-mod-rpaf
Architecture: any
Depends: apache-common (>= %{apache_version}), []
Description: module for Apache 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: bash
APXS=${APXS:-apxs}
LIBEXECDIR=$($APXS -q LIBEXECDIR)
yada install -dir $LIBEXECDIR
$APXS -i -S LIBEXECDIR="$ROOT$LIBEXECDIR" apache-build/mod_rpaf.so
chmod -x "$ROOT$LIBEXECDIR"/*.so
yada install -data -into /usr/lib/apache/1.3 debian/data/*.info
for webserver in apache apache-perl apache-ssl; do
yada install -conf -into /etc/$webserver/conf.d debian/conf/rpaf.conf
done
yada install -doc debian/doc/README.Debian
Postinst: sh
reload_apache()
{
webserver=$1
if ${webserver}ctl configtest 2>/dev/null; then
invoke-rc.d $webserver force-reload || true
else
echo "Your $webserver configuration is broken, so we're not restarting it for you."
fi
}
.
if [ "$1" = "configure" ]; then
if [ -x /usr/sbin/apache-modconf ]; then
for webserver in apache apache-ssl apache-perl; do
if [ -x /usr/sbin/$webserver ]; then
if [ -n "$2" ]; then
# we're upgrading. test if we're enabled, and if so, restart to reload the module.
if [ "$(apache-modconf $webserver query mod_rpaf)" = "mod_rpaf" ]; then
reload_apache $webserver
fi
else
# fresh
apache-modconf $webserver enable mod_rpaf
fi
fi
done
fi
fi
Prerm: sh
if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then
if [ -x /usr/sbin/apache-modconf ]; then
for webserver in apache apache-ssl apache-perl; do
if [ -x /usr/sbin/$webserver ]; then
apache-modconf $webserver disable mod_rpaf quiet
fi
done
fi
fi
Package: libapache2-mod-rpaf
Architecture: any
Depends: apache2-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
|