Skip to content

Instantly share code, notes, and snippets.

@ichikaway
Created August 26, 2011 06:39
Show Gist options
  • Save ichikaway/1172839 to your computer and use it in GitHub Desktop.
Save ichikaway/1172839 to your computer and use it in GitHub Desktop.
protection of DOS attack

Reference: http://mail-archives.apache.org/mod_mbox/httpd-announce/201108.mbox/raw/%3C20110824161640.122D387DD@minotaur.apache.org%3E/

cd apache_source_code/modules/metadata

apxs -c mod_headers.c

apxs -ian headers mod_headers.la

vi /usr/local/apache/conf/extra/httpd-security.conf

SetEnvIf Range (,.*?){5,} bad-range=1
RequestHeader unset Range env=bad-range
SetEnvIf Request-Range (,.*?){5,} bad-range=1
RequestHeader unset Request-Range env=bad-range 

vi /usr/local/apache/conf/httpd.conf

Include conf/extra/httpd-security.conf

/etc/rc.d/init.d/httpd restart

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment