]>
Commit | Line | Data |
---|---|---|
99bd6926 PG |
1 | %define mod_name extract_forwarded |
2 | %define apxs /usr/sbin/apxs | |
3 | Summary: Apache module: Extract X-Forwarded-For header | |
4 | Name: apache-mod_%{mod_name} | |
5 | Version: 2.0.2 | |
d42633d8 | 6 | Release: 2 |
99bd6926 PG |
7 | License: Apache |
8 | Group: Networking/Daemons/HTTP | |
9 | Source0: http://www.openinfo.co.uk/apache/%{mod_name}-%{version}.tar.gz | |
10 | # Source0-md5: d7aeb59fa81cbe74c485c33873ea1c65 | |
11 | Source1: %{name}.conf | |
12 | URL: http://www.openinfo.co.uk/apache/index.html | |
13 | BuildRequires: %{apxs} | |
14 | BuildRequires: apache-devel >= 2.0.40 | |
15 | BuildRequires: rpmbuild(macros) >= 1.268 | |
16 | Requires: apache(modules-api) = %apache_modules_api | |
ce17d2ac ER |
17 | Requires: apache-mod_proxy |
18 | Conflicts: apache-mod_rpaf | |
99bd6926 PG |
19 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
20 | ||
21 | %define _pkglibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null) | |
ce17d2ac | 22 | %define _sysconfdir %(%{apxs} -q SYSCONFDIR 2>/dev/null)/conf.d |
99bd6926 PG |
23 | |
24 | %description | |
ce17d2ac ER |
25 | mod_extract_forwarded is designed to transparently (to other Apache |
26 | modules) modify the information about the connection over which an | |
27 | HTTP request is received when that connection is not directly from a | |
28 | requesting client to the Apache server but is instead via one or more | |
29 | intervening proxy servers. | |
99bd6926 | 30 | |
ce17d2ac ER |
31 | Operation relies on the X-Forwarded-For header, inserted by proxy |
32 | servers. This is a non-RFC-standard request header which was | |
33 | introduced by the Squid caching proxy server's developers and which is | |
34 | now also supported, for reverse proxy server operation, by Apache 2. | |
35 | If the intervening proxy servers doesn't add such headers, we can't do | |
36 | anything about it. It is worth noting that a normally configured Squid | |
37 | proxy server will add to the X-Forwarded-For. However, when used as a | |
38 | proxy server, Apache prior to version 2 does not add X-Forwarded-For | |
39 | headers unless the third party mod_proxy_add_forward module has been | |
40 | added to it. This can leave potentially important gaps in the | |
41 | information recorded in X-Forwarded-For header. | |
99bd6926 PG |
42 | |
43 | %prep | |
44 | %setup -q -n %{mod_name} | |
45 | ||
46 | %build | |
47 | %{apxs} -c mod_%{mod_name}.c -o mod_%{mod_name}.la | |
48 | ||
49 | %install | |
50 | rm -rf $RPM_BUILD_ROOT | |
ce17d2ac ER |
51 | install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}} |
52 | cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/90_mod_%{mod_name}.conf | |
53 | install -p .libs/mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir} | |
99bd6926 PG |
54 | |
55 | %clean | |
56 | rm -rf $RPM_BUILD_ROOT | |
57 | ||
58 | %post | |
59 | %service -q httpd restart | |
60 | ||
61 | %postun | |
62 | if [ "$1" = "0" ]; then | |
63 | %service -q httpd restart | |
64 | fi | |
65 | ||
66 | %files | |
67 | %defattr(644,root,root,755) | |
68 | %doc README INSTALL | |
ce17d2ac | 69 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*_mod_%{mod_name}.conf |
99bd6926 | 70 | %attr(755,root,root) %{_pkglibdir}/*.so |