You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Paul Querna <ch...@cyan.com> on 2003/02/11 22:52:22 UTC

mod_authn_mysql

It is a simple hack based off of mod_authn_dbm, and mod_digest_mysql using the
new Auth*Providers in Apache 2.1/2.2

It hasn't had much testing except for internaly so far, So I wouldn't be
surprised if there are some bugs.

You can download it from:
http://open.cyanworlds.com/

With the new Auth*Providers, I would like to see mod_authn_mysql added to the
Apache HTTPD source tree.  Many people use MySQL databases for all kinds of
things, and I think including a module that can easily integrate with a common
enviroment is a good idea.

-chip



Re: mod_authn_mysql

Posted by David Shane Holden <dp...@yahoo.com>.
Justin Erenkrantz wrote:
> --On Friday, February 14, 2003 4:26 PM -0700 David Shane Holden 
> <dp...@yahoo.com> wrote:
> 
>> My problem isn't managing a pool of connections... it's if process
>> A creates the connection, process B can use it with no problem, but
>> if process C tries to use it, it barfs and spikes in a function in
>> libpq, i think it was pgbytes.
> 
> 
> You can't really share connections across processes.  Across threads, 
> perhaps.  But, sharing them across processes is asking for trouble. 
> You'd usually be relying upon shmem which is tricky and not really meant 
> for sharing shm-able data structures.  (Some custom OS techniques might 
> be available, but they wouldn't be portable.)  -- justin
> 

It's starting to look that way, but I'm not done with it yet.  I can 
share a connection across threads in the worker mpm with no problem, 
I've had ab thrash the hell out of it without any problems.  But, as you 
say, the cross process shm stuff is tricky and extremely frustrating.

Shane


Re: mod_authn_mysql

Posted by Justin Erenkrantz <ju...@erenkrantz.com>.
--On Friday, February 14, 2003 4:26 PM -0700 David Shane Holden 
<dp...@yahoo.com> wrote:

> My problem isn't managing a pool of connections... it's if process
> A creates the connection, process B can use it with no problem, but
> if process C tries to use it, it barfs and spikes in a function in
> libpq, i think it was pgbytes.

You can't really share connections across processes.  Across threads, 
perhaps.  But, sharing them across processes is asking for trouble. 
You'd usually be relying upon shmem which is tricky and not really 
meant for sharing shm-able data structures.  (Some custom OS 
techniques might be available, but they wouldn't be portable.)  -- 
justin

Re: mod_authn_mysql

Posted by David Shane Holden <dp...@yahoo.com>.
Paul Querna wrote:
> On Fri, 14 Feb 2003 14:52:07 -0700, David Shane Holden wrote
> 
>>Since there seems to be some interest in including a mysql auth 
>>module into the tree, here's a postgres module which I've coded and 
>>have been using for the past month or so.  As for a connection 
>>pool... I haven't figured out a way to have postres use a connection 
>>opened by another process... it likes spiking the cpu and sitting in 
>>some pqbytes function or some shit like that when doing a query on it.
>>
>>https://dpejesh.dnsalias.net/repos/mod_auth_pgsql/trunk/
>>
>>Shane
> 
> 
> 
> I am using apr_reslist to implment pooling of Database connections.
> 
> 

My problem isn't managing a pool of connections... it's if process A 
creates the connection, process B can use it with no problem, but if 
process C tries to use it, it barfs and spikes in a function in libpq, i 
think it was pgbytes.

Shane


Re: mod_authn_mysql

Posted by Paul Querna <ch...@cyan.com>.
On Fri, 14 Feb 2003 14:52:07 -0700, David Shane Holden wrote
> Since there seems to be some interest in including a mysql auth 
> module into the tree, here's a postgres module which I've coded and 
> have been using for the past month or so.  As for a connection 
> pool... I haven't figured out a way to have postres use a connection 
> opened by another process... it likes spiking the cpu and sitting in 
> some pqbytes function or some shit like that when doing a query on it.
> 
> https://dpejesh.dnsalias.net/repos/mod_auth_pgsql/trunk/
> 
> Shane


I am using apr_reslist to implment pooling of Database connections.



Re: mod_authn_mysql

Posted by David Shane Holden <dp...@yahoo.com>.
Since there seems to be some interest in including a mysql auth module 
into the tree, here's a postgres module which I've coded and have been 
using for the past month or so.  As for a connection pool... I haven't 
figured out a way to have postres use a connection opened by another 
process... it likes spiking the cpu and sitting in some pqbytes function 
or some shit like that when doing a query on it.

https://dpejesh.dnsalias.net/repos/mod_auth_pgsql/trunk/

Shane


Fw: Re: libmysqlclient && Re: mod_authn_mysql

Posted by Paul Querna <ch...@cyan.com>.
---------- Forwarded Message -----------
From: David Axmark <da...@mysql.com>
To: Paul Querna <ch...@cyan.com>
Sent: 20 Feb 2003 01:01:03 +0100
Subject: Re: libmysqlclient && Re: mod_authn_mysql

Sorry about the late answer. Got a cold and a bad email back log :-(

We are willing to state in our license that we allow distributing with
the apache license (or basically any OSI compatible license).

I just need to find the right wording.

We are going to do the same for the IBM Eclipse project that also have
a GPL incompatible license. But we are trying to come up with a wording
there to.

/David
------- End of Forwarded Message -------


I think this will basicly resolve the licensing question of including
mod_authn_mysql.

-chip




Re: mod_authn_mysql

Posted by Jim Winstead <ji...@apache.org>.
On Wed, Feb 12, 2003 at 10:23:48PM -0800, Paul Querna wrote:
> > 4. I'm unsure about what the consequences of including a GPL header is.
> >     you pointed out in IRC that there is a Public domain version of
> > libmysql available (which is what PHP includes) does your module work
> > with that?
> 
> to clarify libmysqclient is LGPL, not GPL.

in 4.0, the client code is also gpl.

> This page explains what is required of programs using LGPL code:
> http://www.cs.utah.edu/~gk/teem/lgpl.html  (replace "teem" with "libmysqlclient")
> 
> My understanding is that dynamicaly linking is not a very big deal.
> 
> If linking to LGPL code is too much, I will investigate the public domain PHP
> library further, but at this time I have not tested it.

just drop a note to davida@mysql.com, and he will sort things out for
you, just as they've been sorted out for the php project.

jim (wearing my apache.org hat, but a mysql employee)

Re: mod_authn_mysql

Posted by Dirk-Willem van Gulik <di...@webweaving.org>.
Looking at existing 1,3 modules for sybase, postgress, msql and mysql I
see that we essentially just use:

-	connect
-	disconnect
-	select/query "SQL string"
	<- get back a table
-	escape a SQL string (i.e. \" etc, protect against illegal entry)
-	decode an error

Would it be worth our while to do something so that we can deal with
all 4 or 5 with a simple lib_sql_* behind a generic mod_authn_sql. (Note -
I do not want to re-invent ODBC :-).

Dw


Re: mod_authn_mysql

Posted by Paul Querna <ch...@cyan.com>.
> 1. using signal is not good, or portable, or threadsafe ;( Is there a
> way to write a mysql sql connection without using signals at all?
> 
> 2. connection pools would be a good thing IMHO

#1 is already done, and I am working on #2
 
> 3. instead of specifying the userfield/passwordfield/table as directives
> maybe specify a SQL string with token placement
> eg. "select count(*) from usertabels where user=%U and realm=%R and
> password=crypt(%P)"

If anything I will maybe add both.  There are advantages and disadvantages to
both, so the best option is to let the end user decide. However, I want to
have connection pools working first, so this is a secondary priority.

> 4. I'm unsure about what the consequences of including a GPL header is.
>     you pointed out in IRC that there is a Public domain version of
> libmysql available (which is what PHP includes) does your module work
> with that?

to clarify libmysqclient is LGPL, not GPL.
This page explains what is required of programs using LGPL code:
http://www.cs.utah.edu/~gk/teem/lgpl.html  (replace "teem" with "libmysqlclient")

My understanding is that dynamicaly linking is not a very big deal.

If linking to LGPL code is too much, I will investigate the public domain PHP
library further, but at this time I have not tested it.

> otherwise i'm +1 on it

thanks

 
> have you recieved any other comments about it?

nope

-chip

Re: mod_authn_mysql

Posted by Ian Holsman <li...@holsman.net>.
Hi Paul.
some quick comments about your code.

1. using signal is not good, or portable, or threadsafe ;( Is there a 
way to write a mysql sql connection without using signals at all?

2. connection pools would be a good thing IMHO

3. instead of specifying the userfield/passwordfield/table as directives 
maybe specify a SQL string with token placement
eg. "select count(*) from usertabels where user=%U and realm=%R and 
password=crypt(%P)"

4. I'm unsure about what the consequences of including a GPL header is.
    you pointed out in IRC that there is a Public domain version of 
libmysql available (which is what PHP includes) does your module work 
with that?

otherwise i'm +1 on it

have you recieved any other comments about it?

Paul Querna wrote:
> It is a simple hack based off of mod_authn_dbm, and mod_digest_mysql using the
> new Auth*Providers in Apache 2.1/2.2
> 
> It hasn't had much testing except for internaly so far, So I wouldn't be
> surprised if there are some bugs.
> 
> You can download it from:
> http://open.cyanworlds.com/
> 
> With the new Auth*Providers, I would like to see mod_authn_mysql added to the
> Apache HTTPD source tree.  Many people use MySQL databases for all kinds of
> things, and I think including a module that can easily integrate with a common
> enviroment is a good idea.
> 
> -chip
> 
>