Bad Behavior on MediaWiki
This page contains the installation guide and usage notes for Bad Behavior on MediaWiki.
Upgrading from pre-2.0
If you are upgrading from any version prior to the 2.0 release of Bad Behavior, you need to perform the following steps before installation:
First, remove all copies of Bad Behavior 1.x and any pre-release copies of Bad Behavior 2. Then, use phpMyAdmin, the MySQL command line, or another tool to remove any *bad_behavior or *bad_behavior_log tables in your database.
Now you are ready to install Bad Behavior version 2.
Installation
Bad Behavior is a MediaWiki extension. It works on MediaWiki 1.5 or later versions.
Before uploading, edit the bad-behavior/bad-behavior-mediawiki.php file and customize the configuration variables there:
Logging: Turning on verbose mode causes all HTTP requests to be logged. When verbose mode is off, only blocked requests and a few suspicious (but permitted) requests are blocked. Verbose mode is off by default. Using verbose mode is not recommended as it can significantly slow down your site; it exists to capture data from live spammers which are not being blocked. You can also disable logging entirely, but this is not recommended since it will cause additional spam to get through.
Strict: Bad Behavior operates in two blocking modes: normal and strict. In normal mode, some checks which could stop spam, but also block certain types of corporate and government users, are disabled. When strict mode is enabled, spam from these sources is blocked, but those users may be blocked as well. It is up to you whether you want to have the government reading your blog, or keep away the spammers.
Offsite Forms: Bad Behavior normally prevents your site from receiving data posted from forms on other web sites. This prevents spammers from, e.g., using a Google cached version of your web site to send you spam. However, some web applications such as OpenID require that your site be able to receive form data in this way. If you are running OpenID, enable this option.
(Other options are present, but not currently used in the MediaWiki port.)
Upload both the folder and its contents to your MediaWiki extensions directory, taking care to use ASCII mode. You should end up with a bad-behavior folder in your extensions folder, which contains the Bad Behavior files. Once on the server, edit your LocalSettings.php file, and add these two lines at the end of the file.
include_once( 'includes/DatabaseFunctions.php' );
include( './extensions/bad-behavior/bad-behavior-mediawiki.php' );
If you are upgrading from a version prior to 1.1, you may have this line or a similar line in your index.php file instead. This is because prior versions were not full-fledged MediaWiki extensions. Remove it from index.php and place it in LocalSettings.php.
Usage
After installation you don’t need to do anything! Bad Behavior protects your entire MediaWiki automatically.
To view the Bad Behavior log, you will need a copy of phpMyAdmin installed, or some other way to view the database. Most Web hosts include phpMyAdmin as part of the control panel. Bad Behavior stores its log in the bad_behavior table in your MediaWiki database. Browse or search through it with phpMyAdmin, the MySQL command line, or another tool. At this time Bad Behavior does not come with a built-in log viewer, though this feature is planned.
Whitelisting
On rare occasions you may wish to whitelist a specific user agent or IP address range. To do so, edit the bad-behavior-whitelist.php file, and insert the exact user agent or IP address range desired. Bad Behavior accepts single IP addresses or CIDR format address ranges. If you find something is blocked that should not be, however, please contact me so that I can look into it as well.
Notes
Bad Behavior may be unable to protect cached pages in MediaWiki.

9 Responses to “Bad Behavior on MediaWiki”
Bad Behavior / Bad Behaviour: Bad Behavior 2.0.21
Pingback on Aug 5th, 2008 at 8:02 am
Bad Behavior / Bad Behaviour: Bad Behavior 2.0.22
Pingback on Aug 6th, 2008 at 7:50 am
Bad Behavior / Bad Behaviour: Bad Behavior 2.0.23
Pingback on Aug 24th, 2008 at 1:25 am
Bad Behavior / Bad Behaviour: Bad Behavior 2.0.25
Pingback on Nov 20th, 2008 at 12:38 am
Bad Behavior / Bad Behaviour: Bad Behavior 2.0.26
Pingback on Mar 17th, 2009 at 7:12 pm
Bad Behavior / Bad Behaviour: Bad Behavior 2.0.29
Pingback on Sep 23rd, 2009 at 3:12 pm
Bad Behavior / Bad Behaviour: Bad Behavior 2.0.30
Pingback on Oct 18th, 2009 at 12:39 am
Bad Behavior / Bad Behaviour: Bad Behavior 2.0.31
Pingback on Oct 18th, 2009 at 12:40 am
So happy with its performance on our Wor… « µblog
Pingback on Jan 7th, 2010 at 5:35 pm