reverted: --- libapache-mod-evasive-1.10.1/debian/mod-evasive.load +++ libapache-mod-evasive-1.10.1.orig/debian/mod-evasive.load @@ -1 +0,0 @@ -LoadModule evasive20_module /usr/lib/apache2/modules/mod_evasive20.so diff -u libapache-mod-evasive-1.10.1/debian/control libapache-mod-evasive-1.10.1/debian/control --- libapache-mod-evasive-1.10.1/debian/control +++ libapache-mod-evasive-1.10.1/debian/control @@ -2,12 +2,12 @@ Section: web Priority: optional Maintainer: Alberto Gonzalez Iniesta -Build-Depends: debhelper (>> 4.0.0), apache2-threaded-dev +Build-Depends: debhelper (>> 4.0.0), apache2-dev Standards-Version: 3.7.2.2 Package: libapache2-mod-evasive Architecture: any -Depends: apache2.2-common, ${shlibs:Depends} +Depends: apache2-data, ${shlibs:Depends} Description: evasive module to minimize HTTP DoS or brute force attacks mod_evasive is an evasive maneuvers module for Apache to provide some protection in the event of an HTTP DoS or DDoS attack or brute force attack. diff -u libapache-mod-evasive-1.10.1/debian/libapache2-mod-evasive.postinst libapache-mod-evasive-1.10.1/debian/libapache2-mod-evasive.postinst --- libapache-mod-evasive-1.10.1/debian/libapache2-mod-evasive.postinst +++ libapache-mod-evasive-1.10.1/debian/libapache2-mod-evasive.postinst @@ -11,7 +11,7 @@ if [ -n "$2" ]; then # we're upgrading. test if we're enabled, and if so, restart to reload the module. - if [ -e /etc/apache2/mods-enabled/mod-evasive.load ]; then + if [ -e /etc/apache2/mods-enabled/evasive.load ]; then reload_apache fi exit 0 @@ -20,7 +20,7 @@ if [ -e /etc/apache2/apache2.conf ]; then # Enable the module, but hide a2enmod's misleading message about apachectl # and force-reload the thing ourselves. - a2enmod mod-evasive >/dev/null || true + a2enmod evasive >/dev/null || true reload_apache fi diff -u libapache-mod-evasive-1.10.1/debian/libapache2-mod-evasive.prerm libapache-mod-evasive-1.10.1/debian/libapache2-mod-evasive.prerm --- libapache-mod-evasive-1.10.1/debian/libapache2-mod-evasive.prerm +++ libapache-mod-evasive-1.10.1/debian/libapache2-mod-evasive.prerm @@ -6,7 +6,7 @@ fi if [ -e /etc/apache2/apache2.conf ]; then - a2dismod mod-evasive || true + a2dismod evasive || true fi exit 0 diff -u libapache-mod-evasive-1.10.1/debian/changelog libapache-mod-evasive-1.10.1/debian/changelog --- libapache-mod-evasive-1.10.1/debian/changelog +++ libapache-mod-evasive-1.10.1/debian/changelog @@ -1,3 +1,12 @@ +libapache-mod-evasive (1.10.1-1ubuntu1) precise; urgency=low + + * Recompile for Apache 2.4 + - Updated mod_evasive20.c for Apache 2.4 API calls + - Changed mod path name to just "evasive" to match rest of Apache mods + - Updated dependencies + + -- Derek Morton Sun, 24 Feb 2013 03:39:49 -0600 + libapache-mod-evasive (1.10.1-1) unstable; urgency=low * New upstream version. Changed package name. s/dos// diff -u libapache-mod-evasive-1.10.1/debian/libapache2-mod-evasive.install libapache-mod-evasive-1.10.1/debian/libapache2-mod-evasive.install --- libapache-mod-evasive-1.10.1/debian/libapache2-mod-evasive.install +++ libapache-mod-evasive-1.10.1/debian/libapache2-mod-evasive.install @@ -2 +2 @@ -debian/mod-evasive.load etc/apache2/mods-available +debian/evasive.load etc/apache2/mods-available only in patch2: unchanged: --- libapache-mod-evasive-1.10.1.orig/mod_evasive20.c +++ libapache-mod-evasive-1.10.1/mod_evasive20.c @@ -139,11 +139,11 @@ time_t t = time(NULL); /* Check whitelist */ - if (is_whitelisted(r->connection->remote_ip)) + if (is_whitelisted(r->useragent_ip)) return OK; /* First see if the IP itself is on "hold" */ - n = ntt_find(hit_list, r->connection->remote_ip); + n = ntt_find(hit_list, r->useragent_ip); if (n != NULL && t-n->timestampconnection->remote_ip, r->uri); + snprintf(hash_key, 2048, "%s_%s", r->useragent_ip, r->uri); n = ntt_find(hit_list, hash_key); if (n != NULL) { /* If URI is being hit too much, add to "hold" list and 403 */ if (t-n->timestampcount>=page_count) { ret = HTTP_FORBIDDEN; - ntt_insert(hit_list, r->connection->remote_ip, time(NULL)); + ntt_insert(hit_list, r->useragent_ip, time(NULL)); } else { /* Reset our hit count list as necessary */ @@ -177,14 +177,14 @@ } /* Has site been hit too much? */ - snprintf(hash_key, 2048, "%s_SITE", r->connection->remote_ip); + snprintf(hash_key, 2048, "%s_SITE", r->useragent_ip); n = ntt_find(hit_list, hash_key); if (n != NULL) { /* If site is being hit too much, add to "hold" list and 403 */ if (t-n->timestampcount>=site_count) { ret = HTTP_FORBIDDEN; - ntt_insert(hit_list, r->connection->remote_ip, time(NULL)); + ntt_insert(hit_list, r->useragent_ip, time(NULL)); } else { /* Reset our hit count list as necessary */ @@ -205,27 +205,27 @@ struct stat s; FILE *file; - 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->useragent_ip); if (stat(filename, &s)) { file = fopen(filename, "w"); if (file != NULL) { fprintf(file, "%ld\n", getpid()); fclose(file); - LOG(LOG_ALERT, "Blacklisting address %s: possible DoS attack.", r->connection->remote_ip); + LOG(LOG_ALERT, "Blacklisting address %s: possible DoS attack.", r->useragent_ip); if (email_notify != NULL) { snprintf(filename, sizeof(filename), MAILER, email_notify); file = popen(filename, "w"); if (file != NULL) { fprintf(file, "To: %s\n", email_notify); - fprintf(file, "Subject: HTTP BLACKLIST %s\n\n", r->connection->remote_ip); - fprintf(file, "mod_evasive HTTP Blacklisted %s\n", r->connection->remote_ip); + fprintf(file, "Subject: HTTP BLACKLIST %s\n\n", r->useragent_ip); + fprintf(file, "mod_evasive HTTP Blacklisted %s\n", r->useragent_ip); pclose(file); } } if (system_command != NULL) { - snprintf(filename, sizeof(filename), system_command, r->connection->remote_ip); + snprintf(filename, sizeof(filename), system_command, r->useragent_ip); system(filename); } only in patch2: unchanged: --- libapache-mod-evasive-1.10.1.orig/debian/evasive.load +++ libapache-mod-evasive-1.10.1/debian/evasive.load @@ -0,0 +1 @@ +LoadModule evasive20_module /usr/lib/apache2/modules/mod_evasive20.so