Jump to content


Photo
- - - - -

apache limit max connections per IP and friends ..


  • Please log in to reply
No replies to this topic

#1 operat0r

operat0r

    Dangerous free thinker

  • Members
  • 793 posts
  • Location:ops

Posted 16 November 2007 - 11:25 AM

Here are some mods I have loaded in apache and some examples etc...

* mod_limitipconn ( limit max connections per IP)
LoadModule limitipconn_module libexec/apache22/mod_limitipconn.so

ExtendedStatus On

<IfModule mod_limitipconn.c>
	<Location />
 MaxConnPerIP 2
	</Location>


</IfModule>

* mod_bw ( limit bandwidth )

LoadModule bw_module		  libexec/apache22/mod_bw.so


BandWidthModule On
ForceBandWidthModule On
LargeFileLimit  * 5000 10000


* mod_sec ( open source web application firewall www.gotroot.com this one can be tricky for novice webmins )
LoadModule security2_module   libexec/apache22/mod_security2.so


<IfModule mod_security2.c>
Include /usr/local/etc/apache22/Includes/mod_security2/apache2-rules.conf
Include /usr/local/etc/apache22/Includes/mod_security2/blacklist.conf
Include /usr/local/etc/apache22/Includes/mod_security2/blacklist2.conf
Include /usr/local/etc/apache22/Includes/mod_security2/exclude.conf
Include /usr/local/etc/apache22/Includes/mod_security2/jitp.conf
Include /usr/local/etc/apache22/Includes/mod_security2/recons.conf
Include /usr/local/etc/apache22/Includes/mod_security2/rootkits.conf
Include /usr/local/etc/apache22/Includes/mod_security2/rules.conf
</IfModule>

* mod_rewrite ( for hotlink prevention block bot etc ... http://www.google.co..... WebPictures" )

my htaccess http://rmccurdy.com/scripts/htaccess


RewriteEngine On
RewriteCond %{REQUEST_URI} !public_images/.*$ [NC]
RewriteCond %{REQUEST_URI} !sig/.*$ [NC]
RewriteCond %{REQUEST_URI} !swf.*$ [NC]
RewriteCond %{REQUEST_URI} !exe.*$ [NC]

RewriteCond %{HTTP_REFERER} .
RewriteCond %{HTTP_REFERER} !^htt(p|ps)://(rmccurdy\.)?no-ip\.(net|com) [NC]
RewriteCond %{HTTP_REFERER} !^htt(p|ps)://(www\.)?rmccurdy\.(net|com) [NC]
RewriteCond %{HTTP_REFERER} !^htt(p|ps)://rmccurdy\.(net|com) [NC]

RewriteRule \.(zip|JPG|jpg|GIF|rar|exe|gif|jpe?g)$ /public_images/gank.gif [NC,L]




RewriteCond %{HTTP_USER_AGENT} ^.*oogle [OR]
RewriteCond %{HTTP_USER_AGENT} ^.*Jeeves* [OR]
RewriteCond %{HTTP_USER_AGENT} ^.*Yahoo* [OR]
RewriteCond %{HTTP_USER_AGENT} ^.*earch.ms* [OR]
RewriteCond %{HTTP_USER_AGENT} ^.*arbin_* [OR]
RewriteCond %{HTTP_USER_AGENT} ^.*attac* [OR]
RewriteCond %{HTTP_USER_AGENT} ^.WAP* [OR]

Edited by operat0r, 02 April 2008 - 02:02 PM.





BinRev is hosted by the great people at Lunarpages!