[packages/apache-mod_limitipconn] - initial for apache 2.x

arekm arekm at pld-linux.org
Fri Jul 18 09:23:59 CEST 2014


commit 600bb7f157d002911d933c629b35a7ffb3cb9485
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Fri Jul 18 09:23:48 2014 +0200

    - initial for apache 2.x

 apache-mod_limitipconn.spec | 55 +++++++++++++++++++++++++++++++++++++++++++++
 apache.conf                 | 24 ++++++++++++++++++++
 2 files changed, 79 insertions(+)
---
diff --git a/apache-mod_limitipconn.spec b/apache-mod_limitipconn.spec
new file mode 100644
index 0000000..a01156d
--- /dev/null
+++ b/apache-mod_limitipconn.spec
@@ -0,0 +1,55 @@
+%define		mod_name	limitipconn
+%define 	apxs		%{_sbindir}/apxs
+Summary:	Apache module: Limit simultaneous connections by an IP address
+Name:		apache-mod_%{mod_name}
+Version:	0.24
+Release:	1
+License:	Apache
+Group:		Networking/Daemons
+Source0:	http://dominia.org/djao/limit/mod_limitipconn-%{version}.tar.bz2
+# Source0-md5:	5cf6ddc6743931afef26c03de851279b
+Source1:	apache.conf
+URL:		http://dominia.org/djao/limitipconn2.html
+BuildRequires:	apache-devel
+BuildRequires:	rpmbuild(macros) >= 1.228
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%define		_pkglibdir	%(%{apxs} -q LIBEXECDIR 2>/dev/null)
+%define		_sysconfdir	%(%{apxs} -q SYSCONFDIR 2>/dev/null)
+
+%description
+The mod_limitipconn module lets you enforce limits on the number of
+simultaneous downloads allowed from a single IP address. You can also
+control which MIME types are affected by the limits.
+
+This module will not function unless mod_status is loaded and the
+"ExtendedStatus On" directive is set.
+
+%prep
+%setup -q -n mod_%{mod_name}-%{version}
+
+%build
+%{apxs} -c mod_%{mod_name}.c
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}/conf.d}
+install -p .libs/mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
+cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/90_mod_%{mod_name}.conf
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post
+%service apache restart
+
+%postun
+if [ "$1" = "0" ]; then
+	%service -q apache restart
+fi
+
+%files
+%defattr(644,root,root,755)
+%doc ChangeLog README
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/*_mod_%{mod_name}.conf
+%attr(755,root,root) %{_pkglibdir}/*
diff --git a/apache.conf b/apache.conf
new file mode 100644
index 0000000..6913484
--- /dev/null
+++ b/apache.conf
@@ -0,0 +1,24 @@
+LoadModule limitipconn_module	modules/mod_limitipconn.so
+
+# This module will not function unless mod_status is loaded and the "ExtendedStatus On" directive is set.
+#ExtendedStatus On
+
+<IfModule mod_limitipconn.c>
+# Global limit
+# MaxConnPerIP 100
+#
+#	<Location /somewhere>
+#		MaxConnPerIP 3
+#		# exempting images from the connection limit is often a good
+#		# idea if your web page has lots of inline images, since these
+#		# pages often generate a flurry of concurrent image requests
+#		NoIPLimit image/*
+#	</Location>
+#
+#	<Location /mp3>
+#		MaxConnPerIP 1
+#		# In this case, all MIME types other than audio/mpeg and video*
+#		# are exempt from the limit check
+#		OnlyIPLimit audio/mpeg video
+#	</Location>
+</IfModule>
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/apache-mod_limitipconn.git/commitdiff/600bb7f157d002911d933c629b35a7ffb3cb9485



More information about the pld-cvs-commit mailing list