Mon.
28
December
2009
Bad Behavior 2.1 development releases on Flatpress
- Posted by David at 15:35:02
- Open Source, Flatpress, Bad Behavior
Current mood: 
Bad behavior (also known as BB2) which is a great anti-spam-robot plugin has a new branch in development.
I’ve finally had some time to poke into the code and it’s actually easier to get working with flatpress now![]()
But the installation is quite a bit different this time so read the instructions below carefully!
Note: This post will be updated if needed until the 2.1 development branch is going stable.
Installation instructions:
Last rev.: 2009-12-28, for BB2 version 2.1.1
- First get the original development package from Bad Behaviors download page
- Go register at the Project Honeypot site to get your key for the http:BL IP-checking if you haven’t done that. Believe me, it’s useful!
- Then get the extra Flatpress related plugin files.
- Make sure that you have done step 1-3 correctly before continuing
- Backup the contents of the old “bad-behavior” directory in the fp-plugins directory on the server if you have been using the earlier version.
- Log in to your flatpress admin area and deactivate the plugin. (Only needed if upgrading of course.) Then remove the old plugin from the server so you don’t mix up the versions.
- On your server, still inside the directory fp-plugins: Make a new directory named “bad-behavior” (Without quotes, and mind the spelling! if you don’t have one from before. (Or if you rather like, do the next step in the plugin directory keeping the packed directory, it’s the same result.)
- Unpack the previously downloaded original package contents in this new directory. You will get some other plugin files and a directory with core files now. (The core files should be in the plugin directory, just like for any other plugin.)
- You don’t need the files for lifetype, mediawiki, mysql and wordpress (named with these names) so delete them and keep the generic file.
- Edit the bad-behavior-generic.php file and change the following two parts:
// Bad Behavior callback functions.
Change to:// Bad Behavior callback functions. require_once("bad-behavior-flatfile.php");And of course also your own contact info!// Return emergency contact email address.
Just change the returning mail address to your own. - Now unpack the Flatpress related files into the same directory.
- plugin.bad-behavior.php (The actual FP-hook.)
- bad-behavior-flatfile.php (Does the flat file writing for logging.)
- settings.ini (Contains the personal settings, see more further down.)
- Personalise the settings in the “settings.ini” file to suit your needs. Or at least have a look to be familiar with them, ok?
Note that this file isn’t exactly the same as the one available through Bad Behaviors homepage as the log_file = “/bb2.log” part has been added for flat file logging purposes.
Here’s a quick walkthrough on the settings:
- display_stats = false Using display stats is completely meaningless unless there’s a mysql database in bottom, so I suggest keeping it “false”
- strict = true Turning strict on (true) will catch more spiders that doesn’t follow standards. Beware that some legit spiders might get caught as well, so if you’re not totally paranoid you can set it to “false”. (For more info on the setting see f.ex. this page on Bad Behaviors site.)
- verbose = false Turns verbose logging on if set to true. Beware that can quickly fill up the logfile if you have a bit of traffic
- logging = true Turns logging on or off. This release of the Flatpress plugin supports using a flat file for logging, but you will likely have to create an empty file yourself first, and remember to give the server rights to write to it.
- httpbl_key = “” This is where you put your own Http:BL key if you have one.
- httpbl_threat = 25 The threat triggering level for Http:BL
- httpbl_maxage = 30 The max age in days for Http:BL data.
- offsite_forms = false This is a switch that allows POST data from offsite forms, like when using OpenID logins and such. It opens a bit more exposure though. (For more info on the setting see f.ex. this page on Bad Behaviors site.)
- log_file = “/bb2.log” And this is where you put the flat file that will be the log for Bad Bahavior. Path is relative to server root.
- Create an empty log file, make sure it’s named exactly as in the settings (bb2.log as default) and placed on the right place (web server root as default) and that the server has write access to it.
- A very good advice is to have both the logfile as well as the non-public directories protected by a .htaccess file, you should consider that approach for enhanced safety if you haven’t done so already.
- Log in to your flatpress admin area and activate the plugin.
- Sit back and enjoy the fact that many spammers and malicious morons now are blocked at your site, and do check back on the log file once in a while if you use one.
- Remember that Bad Behavior needs updates once in a while. Check Bad Behaviors download page from time to time, or get on the mailing list or RSS feed there so you stay up to date!
- Please donate something to the original author as described on the Bad Behavior donation page if you find Bad Behaviour useful.