Simple anti-DOS attack module in Apache

Source: Internet
Author: User
Tags install perl

Simple anti-DOS attack module

Mod_doserasive is Apache's third-party module that determines whether an IP access is too fast over a period of time if it returns 403 errors too soon

Download Module http://bbs.chinaunix.net/attachment.php?aid=Mzc4OTQ4fGVjYzA2YzJjfDEzODE3NDQyMjZ8MjkyNDk2MDR8MTY4OTcwNA%3D% 3d&fid=232

1. The installation configuration of the module is as follows

[Root@localhost Tar XF mod_evasive_1.10.1.tar\ (1\). gz

[Root@localhost ~]# CD mod_evasive

[Root@localhost mod_evasive]#/usr/local/apache/bin/apxs-i-a-c mod_evasive20.c

* Note When installing the module, do not worry about using APXS you need to install Perl because APXS uses Perl scripts. Next Pack Perl

The Apxs file must be modified after installation because his first line is still #!/replace/with/path/to/perl/interpreter-w #!/replace/with/path/to/perl/ Interpreter This file does not exist and of course it cannot be run.

This column more highlights: http://www.bianceng.cn/Servers/web/

The first line is modified to #!/usr/bin/perl-w to save the line. Remember to reboot the server, huh?

It's a good idea to install Perl and then compile and install Apache so it won't be too much trouble.

2. Modify the configuration file

[Root@localhost modules]# vim/usr/local/apache/conf/httpd.conf

Increase as a downward line

<ifmodule mod_evasive20.so>

Doshashtablesize 3097

Dospagecount 5

Dossitecount 50

Dospageinterval 1

Dossiteinterval 1

Dosblockingperiod 360

</IfModule>

Check the correctness of the configuration file's syntax

Frequent refreshes can occur when the following occurs

3. The following describes the meaning of parameters

Doshashtablesize to define the hash table size

Dospagecount is used to set the maximum concurrent connection for a client

Dossitecount used to set the interval at which clients access the same page

Dospageinterval used to set Web Access technology interval

Dossiteinterval is used to deny access time after a blacklist is added

Dosemailnotify notify administrator when IP joins

Dossystemcommand when a system command with IP join execution

Doslogdir "/tmp" locking mechanism temp directory

Doswhitelist 127.0.0.1 Guard List does not block whitelist IP

This article is from the "Linux" blog, please be sure to keep this source http://weihong.blog.51cto.com/6655355/1308862

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.