operat0r

apache limit max connections per IP and friends ..

1 post in this topic

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.com/search?q=RewriteCond...+WebPictures%22 )

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
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now