summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Haerry <mh@scrit.ch>2012-08-16 22:25:00 +0200
committerMarcel Haerry <mh@scrit.ch>2012-08-16 22:25:00 +0200
commitbc3a913aa8414bbb028c6611f401492e89000410 (patch)
tree16297db241e2ba78916b362e3164b7b393d5cbcd
init release
-rw-r--r--SOURCES/libapache-mod-removeip_1.0b.tar.gzbin0 -> 2602 bytes
-rw-r--r--SOURCES/mod_removeip.conf7
-rw-r--r--SOURCES/mod_removeip.patch21
-rw-r--r--SPECS/mod_removeip.spec57
4 files changed, 85 insertions, 0 deletions
diff --git a/SOURCES/libapache-mod-removeip_1.0b.tar.gz b/SOURCES/libapache-mod-removeip_1.0b.tar.gz
new file mode 100644
index 0000000..3631a64
--- /dev/null
+++ b/SOURCES/libapache-mod-removeip_1.0b.tar.gz
Binary files differ
diff --git a/SOURCES/mod_removeip.conf b/SOURCES/mod_removeip.conf
new file mode 100644
index 0000000..0eb1502
--- /dev/null
+++ b/SOURCES/mod_removeip.conf
@@ -0,0 +1,7 @@
+LoadModule removeip_module modules/mod_removeip.so
+
+# Enable module. Nothing happens without this directive.
+<IfModule mod_removeip.c>
+REMOVEIPenable On
+</IfModule>
+
diff --git a/SOURCES/mod_removeip.patch b/SOURCES/mod_removeip.patch
new file mode 100644
index 0000000..93e1de9
--- /dev/null
+++ b/SOURCES/mod_removeip.patch
@@ -0,0 +1,21 @@
+diff -Nadur mod_removeip/libapache-mod-removeip/debian/trunk/apache2.0/mod_removeip.c mod_removeip-1.0b/apache2.0/mod_removeip.c
+--- mod_removeip/libapache-mod-removeip/debian/trunk/apache2.0/mod_removeip.c 2006-08-12 22:08:28.000000000 +0200
++++ mod_removeip-1.0b/apache2.0/mod_removeip.c 2006-08-15 23:11:51.249033896 +0200
+@@ -32,8 +32,6 @@
+ }
+
+ static int change_remote_ip(request_rec *r) {
+- const char *fwdvalue;
+- char *val;
+ removeip_server_cfg *cfg = (removeip_server_cfg *)ap_get_module_config(r->server->module_config,
+ &removeip_module);
+
+@@ -40,7 +40,7 @@
+ if (!cfg->enable)
+ return DECLINED;
+
+- r->connection->remote_ip = apr_pstrdup(r->connection->pool, "localhost");
++ r->connection->remote_ip = apr_pstrdup(r->connection->pool, "127.0.0.1");
+ r->connection->remote_addr->sa.sin.sin_addr.s_addr = inet_addr("127.0.0.1");
+
+ return DECLINED;
diff --git a/SPECS/mod_removeip.spec b/SPECS/mod_removeip.spec
new file mode 100644
index 0000000..b9e7dc9
--- /dev/null
+++ b/SPECS/mod_removeip.spec
@@ -0,0 +1,57 @@
+Name: mod_removeip
+Version: 1.0b
+Release: 1%{?dist}
+Summary: Module to remove IP from apache2's logs
+
+Group: System Environment/Daemons
+License: Apache Software License
+URL: http://dev.riseup.net/privacy/apache/
+Source0: libapache-mod-removeip_%{version}.tar.gz
+Source1: mod_removeip.conf
+Patch0: mod_removeip.patch
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+
+BuildRequires: httpd-devel >= 2.2.3
+Requires: httpd httpd-mmn = %([ -a %{_includedir}/httpd/.mmn ] && cat %{_includedir}/httpd/.mmn || echo missing)
+
+%description
+This package provides the removeip module for the Apache 2 webserver. This module allows for overwriting Apache's environment
+variable REMOTE_ADDR with a fixed value. This is necessary to anonymize all logs written by Apache and to prevent web applications
+from accessing the original IP address.
+
+Please be advised that activating this module may cause unexpected side effects to the behavior of your web applications.
+
+%prep
+%setup -q -n libapache-mod-removeip-%{version}
+%patch0 -p1
+
+
+%build
+cd apache2.0
+/usr/sbin/apxs -Wc,"%{optflags}" -c mod_removeip.c
+
+
+%install
+rm -rf %{buildroot}
+mkdir -p %{buildroot}%{_libdir}/httpd/modules/
+mkdir -p %{buildroot}/%{_sysconfdir}/httpd/conf.d/
+install -p apache2.0/.libs/mod_removeip.so %{buildroot}/%{_libdir}/httpd/modules/
+install -m644 %{SOURCE1} %{buildroot}/%{_sysconfdir}/httpd/conf.d/
+
+# Docs don't need to be executable
+chmod -x CHANGES README
+
+%clean
+rm -rf %{buildroot}
+
+
+%files
+%defattr(-,root,root,-)
+%doc CHANGES README
+%{_libdir}/httpd/modules/mod_removeip.so
+%config(noreplace) /etc/httpd/conf.d/mod_removeip.conf
+
+
+%changelog
+* Sat Nov 05 2011 Marcel Haerry <mh+rpms@scrit.ch> 1.0b-1
+- Initial build