[Rabbit-dev] ad blocking

Luis Soltero lsoltero at globalmarinenet.com
Tue Dec 28 12:08:19 CET 2010


Hello Robo,

thanks to your help its working now.  For the record here is the entries in rabbit.conf that makes both sql
authentication and blocking work

[data_sources]
resources=user_database,host_blocker

[Filters]
accessfilters=rabbit.filter.AccessFilter
httpinfilters=rabbit.filter.HttpBaseFilter,rabbit.filter.ProxyAuth,rabbit.filter.DontFilterFilter,rabbit.filter.SQLBlockFilter,rabbit.filter.RevalidateFilter

[rabbit.filter.SQLBlockFilter]
resource=jdbc/host_blocker
select=select 1 from banedhosts where hostname=?

[rabbit.filter.ProxyAuth]
one_ip_only=false
cachetime=5
allow_without_auth=(^http://(www.)?globalmarinenet.com/|^http://webmail([0-9])?.gmn-usa.com)
authenticator=sql
userfile=conf/allowed
resource=jdbc/user_database
select=select password from rabbit where username=?

[user_database]
bind_name=java:comp/env/jdbc/user_database
class=com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource
setUser=xauth
setPassword=xxxxxxx
setServerName=localhost
setDatabaseName=xauth

[host_blocker]
bind_name=java:comp/env/jdbc/host_blocker
class=com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource
setUser=xauth
setPassword=xxxxxxx
setServerName=localhost
setDatabaseName=xauth


So its working really well!
I will let you know if I run into any issues.

--luis


On 12/27/10 5:01 PM, Robert Olofsson wrote:
> On Mon, 27 Dec 2010 16:41:12 -0500
> Luis Soltero <lsoltero at globalmarinenet.com> wrote:
>
>> I think I have discovered the problem. The problem is that the Mysql connector does not support many of the methods you
>> have listed in the db resource sections. For example, if i define setUser then I get an exception in the error logs
>> stating that mysql... has no method setUser. The same is true for setServerName, setDatabaseName, setPassword,
>> setDataSource, url, etc..
> Ok, they are not needed, they are a way to configure the DataSource.
> I do not use mysql, but a quick google seems to give this page:
> http://dev.mysql.com/doc/refman/5.0/en/connector-j-reference-configuration-properties.html
> and it seems to say that for mysql DataSource you probably want:
> com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource 
>
> You can probably also use the com.mysql.jdbc.jdbc2.optional.MysqlDataSource
> but that is not a pooled DataSource so you probably do not want it.
>
> There seems to be a lot of properties that you can set on that one 
> (if I understand that page correctly)
>
> /robo
>


-- 


Luis Soltero, Ph.D., MCS
Director of Software Development, CTO
Global Marine Networks, LLC
StarPilot, LLC
Tel: 865-379-8723
Fax: 865-681-5017
E-Mail: lsoltero at globalmarinenet.net
Web: http://www.globalmarinenet.net
Web: http://www.starpilotllc.com






More information about the Rabbit-dev mailing list