From 5f3dbc4e5a9862adbbafdfd9b5d55863e8403854 Mon Sep 17 00:00:00 2001 From: Scott Wallace Date: Tue, 25 Jun 2013 17:54:36 +0200 Subject: [PATCH] Update and rename README to README.md --- apache/README | 38 -------------------------------------- apache/README.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 38 deletions(-) delete mode 100644 apache/README create mode 100644 apache/README.md diff --git a/apache/README b/apache/README deleted file mode 100644 index 680848d..0000000 --- a/apache/README +++ /dev/null @@ -1,38 +0,0 @@ -Compilation ------------ -1. Ensure the SQLite development libraries (sqlite-devel) are installed. - -2. Either run the build_from_scratch.sh script or run the following commands: - 1. libtoolize - 2. aclocal - 3. autoconf - 4. automake -a - 5. ./configure --with-apache= - 6. make CFLAGS=-lsqlite3 - -Installation ------------- -1. Activate in Apache using: - a) (automatic) Using APXS: - apxs -i -a -n blockinator libmodblockinator.la - b) (manual) Add the following commands to the Apache configuration: - LoadModule blockinator_module modules/libmodblockinator.so - -2. Configure mod_blockinator by adding the following lines in the appropriate location(s): - 1. Define where the blocklist DB can be found: - - BlockinatorBlocklistDB /path/to/blocklist.db - - 2. Create a mod_rewrite rule to block requests, if matched: - RewriteCond %{HTTP:X-Block} 1 - RewriteRule . - [R=403,L] - -3. Create the SQLite DB: - 1. sqlite3 /path/to/blocklist.db - 2. Run the following SQL: - CREATE TABLE IF NOT EXISTS blocklist(remote_ip VARCHAR(15), forwarded_ip VARCHAR(15), useragent VARCHAR(256), cookie VARCHAR(1024), PRIMARY KEY(remote_ip)); - 3. (optional) Insert some test data: - Block requests from IP address 1.2.3.4 - e.g. INSERT INTO blocklist VALUES("1.2.3.4", "ANY", "ANY", "ANY"); - -4. Restart Apache diff --git a/apache/README.md b/apache/README.md new file mode 100644 index 0000000..bd94bc9 --- /dev/null +++ b/apache/README.md @@ -0,0 +1,43 @@ +# Compilation +1. Ensure the SQLite development libraries (sqlite-devel) are installed. +2. Either run the `build_from_scratch.sh` script or run the following commands: + 1. `libtoolize` + 2. `aclocal` + 3. `autoconf` + 4. `automake -a` + 5. `./configure --with-apache=` + 6. `make CFLAGS=-lsqlite3` + +# Installation +1. Activate in Apache using: + * (automatic) Using APXS: + ``` + apxs -i -a -n blockinator libmodblockinator.la + ``` + _*or*_ + * (manual) Add the following commands to the Apache configuration: + ``` + LoadModule blockinator_module modules/libmodblockinator.so + ``` +2. Configure mod\_blockinator by adding the following lines in the appropriate location(s): + 1. Define where the blocklist DB can be found: + ``` + + BlockinatorBlocklistDB /path/to/blocklist.db + + ``` + 2. Create a mod\_rewrite rule to block requests, if matched: + ``` + RewriteCond %{HTTP:X-Block} 1 + RewriteRule . - [R=403,L] + ``` +3. Create the SQLite DB: + 1. `sqlite3 /path/to/blocklist.db` + 2. Run the following SQL: + ``` + CREATE TABLE IF NOT EXISTS blocklist(remote_ip VARCHAR(15), forwarded_ip VARCHAR(15), useragent VARCHAR(256), cookie VARCHAR(1024), PRIMARY KEY(remote_ip)); + ``` + 3. (optional) Insert some test data: + Block requests from IP address 1.2.3.4 + e.g. ```INSERT INTO blocklist VALUES("1.2.3.4", "ANY", "ANY", "ANY");``` +4. Restart Apache