ไปอ่านเจอมาจาก
http://permalink.gmane.org/gmane.linux.redhat.fedora.extras.cvs/754632
แค่แก้ code นิดเดียวแล้ว compile ใช้กับ apache 2.4 ได้ง่ายๆเลยครับ
ทดสอบกับ mod_evasive และ mod_rpaf เป็นที่เรียบร้อย แค่เปลี่ยน
connection->remote_ip ไปเป็น connection->client_ip กับ
connection->remote_addr แก้เป็น connection->client_addr (mod_evasive ไม่มี)
ตัวอย่าง diff หลังจากแก้ไขไฟล์
# diff mod_evasive20.c mod_evasive24.c
2c2
< mod_evasive for Apache 2
---
> mod_evasive for Apache 2.4
41c41
< module AP_MODULE_DECLARE_DATA evasive20_module;
---
> module AP_MODULE_DECLARE_DATA evasive24_module;
142c142
< if (is_whitelisted(r->connection->remote_ip))
---
> if (is_whitelisted(r->connection->client_ip))
146c146
< n = ntt_find(hit_list, r->connection->remote_ip);
---
> n = ntt_find(hit_list, r->connection->client_ip);
158c158
< snprintf(hash_key, 2048, "%s_%s", r->connection->remote_ip, r->uri);
---
> snprintf(hash_key, 2048, "%s_%s", r->connection->client_ip, r->uri);
165c165
< ntt_insert(hit_list, r->connection->remote_ip, time(NULL));
---
> ntt_insert(hit_list, r->connection->client_ip, time(NULL));
180c180
< snprintf(hash_key, 2048, "%s_SITE", r->connection->remote_ip);
---
> snprintf(hash_key, 2048, "%s_SITE", r->connection->client_ip);
187c187
< ntt_insert(hit_list, r->connection->remote_ip, time(NULL));
---
> ntt_insert(hit_list, r->connection->client_ip, time(NULL));
208c208
< snprintf(filename, sizeof(filename), "%s/dos-%s", log_dir != NULL ? log_dir : DEFAULT_LOG_DIR, r->connection->remote_ip);
---
> snprintf(filename, sizeof(filename), "%s/dos-%s", log_dir != NULL ? log_dir : DEFAULT_LOG_DIR, r->connection->client_ip);
215c215
< LOG(LOG_ALERT, "Blacklisting address %s: possible DoS attack.", r->connection->remote_ip);
---
> LOG(LOG_ALERT, "Blacklisting address %s: possible DoS attack.", r->connection->client_ip);
221,222c221,222
< fprintf(file, "Subject: HTTP BLACKLIST %s
", r->connection->remote_ip);
< fprintf(file, "mod_evasive HTTP Blacklisted %s
", r->connection->remote_ip);
---
> fprintf(file, "Subject: HTTP BLACKLIST %s
", r->connection->client_ip);
> fprintf(file, "mod_evasive HTTP Blacklisted %s
", r->connection->client_ip);
228c228
< snprintf(filename, sizeof(filename), system_command, r->connection->remote_ip);
---
> snprintf(filename, sizeof(filename), system_command, r->connection->client_ip);
689c689
< module AP_MODULE_DECLARE_DATA evasive20_module =
---
> module AP_MODULE_DECLARE_DATA evasive24_module =