Developers guide

Chapter 9
Copyright © 2008-2013 Inverse inc.
Performance optimization 76
Host 'host_name' is blocked because of many connection errors. Unblock with
'mysqladmin flush-hosts'
This will grind PacketFence to a halt so you want to avoid that at all cost. One way to do so is to increase
the number of maximum connections (see above), to periodically flush hosts or to allow more connection
errors. See http://dev.mysql.com/doc/refman/5.0/en/blocked-host.html for details.
Captive Portal Optimizations
Avoid captive portal overload due to non-browser
HTTP requests
By default we allow every query to be redirected and reach PacketFence for the captive portal operation.
In a lot of cases, this means that a lot of non-user initiated queries reach PacketFence and waste its
resources for nothing since they are not from browsers. (iTunes, Windows update, MSN Messenger, Google
Desktop, …).
So far, we blacklisted clients known to be misbehaving. However, a completely different approach can
be taken: whitelist only known browsers.
This has the nasty side-effect of being unfriendly with (blocking) less popular browsers and devices so
this is disabled by default.
If you want to enable this feature, edit conf/httpd.conf.d/block-unwanted.conf, and uncomment
the following lines:
RewriteCond %{HTTP_USER_AGENT} !^Mozilla
RewriteCond %{HTTP_USER_AGENT} !^Opera
RewriteCond %{HTTP_USER_AGENT} !^BlackBerry
RewriteRule ^.*$ - [L,forbidden]
This will allow the following browsers to reach the captive portal (but nothing else):
BlackBerry
Firefox
Google Chrome
Internet Explorer
Opera
Safari