You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Chris Cohen <ki...@gmx.de> on 2008/06/03 09:46:03 UTC

[users@httpd] mod_auth_mysql questions

Hello,

thanks to Eric Covener I got apache's reverse proxy working with basic 
htpasswd authentication. But now that it's working, I want to 
authenticate Apache against a mysql database with about 15 users.
(I think I could write a script that syncs the database to the htpasswd 
file, but that is only my backup option).

What I tried is:
        <Location />
                AuthType Basic
                AuthName "Internal Proxy"
#                AuthUserFile /etc/apache2/htpasswd
               AuthMySQL               on
               AuthMySQL_Authoritative on
               AuthMySQL_Host          bender.unixhosts.org
               AuthMySQL_User          www-ext
               AuthMySQL_Password     password
               AuthMySQL_DB            network
               AuthMySQL_Group_Table   users
               AuthMySQL_Empty_Passwords off
               AuthMySQL_Encryption_Types MySQL
                Require valid-user
                ProxyPass               http://int.unixhosts.org:8080/
                ProxyPassReverse        http://int.unixhosts.org:8080/
        </Location>

But it just doesn't work. Nothing in the logs.

I am still pretty new to all this apache stuff, so please gimme a 
hint :)

-- 
Thank you
Chris

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_auth_mysql questions

Posted by Res <re...@ausics.net>.
On Thu, 5 Jun 2008, Chris Cohen wrote:

> Thanks for your help Res. I'm going to build apache from source.

No problems.


-- 
Cheers
Res

I read usenet and lists in pine. But m$ outlook, thunderbird and gmail
often use html span/whatever for quotes, makes it hard to tell who said
what, so I dont try. If I ignore you, thats why! Use a compliant mailer.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_auth_mysql questions

Posted by Chris Cohen <ki...@gmx.de>.
On Wednesday 04 June 2008 01:22:19 Res wrote:
> On Tue, 3 Jun 2008, Chris Cohen wrote:
> >> ~# ldd /usr/local/apache/bin/httpd | grep libmysqlclient_r
> >>          libmysqlclient_r.so.15 =>
> >> /usr/lib/mysql/libmysqlclient_r.so.15 (0xb7d7f000)
> >
> > This command doesn't report anything. So no mysql support I think.
> > I cant even find something like dbd for apache in my repo.
> > So... its not possible with the debian/ubuntu apache?
>
> Sounds like it by the way they have apparently built the 2.2.8
> package.
>
> The first thing I'd do is backup your httpd.conf, then delete the
> apache package, then get the source and build from that.  If you need
> a rough guide on what to do check out
> http://support.ausics.net/apache.php
>
> The second thing I'd do is join the ubuntu lists and ask the
> debian/ubuntu maintainers to for once in their lives come out of the
> dark ages and use modern methods with something :)

Thanks for your help Res. I'm going to build apache from source.

-- 
Greetings
Chris

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_auth_mysql questions

Posted by Chris Cohen <ki...@gmx.de>.
On Tuesday 03 June 2008 13:11:26 Res wrote:
> On Tue, 3 Jun 2008, Chris Cohen wrote:
> > On Tuesday 03 June 2008 11:37:30 Res wrote:
> >> Which version of Apache? later versions do not use that module. so
> >> to get help you should to specifiy the version
> >
> > Sorry, forgot that.
> > apache2-mpm-prefork (2.2.8-1ubuntu0.2)
> > libapache2-mod-auth-mysql (4.3.9-4)
>
> Who knows what debian/ubuntu do, maybe your best asking over there
> since apache 2.2.(6|8) uses  mod_dbd  (compile time  --with-mysql as
> of 2.2.8, it works in 2.2.6 but is a more complicated to get it to
> work, but that all changed with an agreement between mysql and apache
> foundation folks for release 2.2.8)
>
> [configuration example]
>
>
> To see if you have mysql recognised try:
>
> ldd /path/to/httpd | grep libmysqlclient_r
>
> You should get something like...
>
> ~# ldd /usr/local/apache/bin/httpd | grep libmysqlclient_r
>          libmysqlclient_r.so.15 =>
> /usr/lib/mysql/libmysqlclient_r.so.15 (0xb7d7f000)

This command doesn't report anything. So no mysql support I think.
I cant even find something like dbd for apache in my repo.
So... its not possible with the debian/ubuntu apache?

-- 
Thanks
Chris

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_auth_mysql questions

Posted by Res <re...@ausics.net>.
On Tue, 3 Jun 2008, Chris Cohen wrote:

>> ~# ldd /usr/local/apache/bin/httpd | grep libmysqlclient_r
>>          libmysqlclient_r.so.15 =>
>> /usr/lib/mysql/libmysqlclient_r.so.15 (0xb7d7f000)
>
> This command doesn't report anything. So no mysql support I think.
> I cant even find something like dbd for apache in my repo.
> So... its not possible with the debian/ubuntu apache?

Sounds like it by the way they have apparently built the 2.2.8 package.

The first thing I'd do is backup your httpd.conf, then delete the apache 
package, then get the source and build from that.  If you need a rough
guide on what to do check out http://support.ausics.net/apache.php

The second thing I'd do is join the ubuntu lists and ask the debian/ubuntu 
maintainers to for once in their lives come out of the dark ages and use 
modern methods with something :)


-- 
Cheers
Res

I read usenet and lists in pine. But m$ outlook, thunderbird and gmail
often use html span/whatever for quotes, makes it hard to tell who said
what, so I dont try. If I ignore you, thats why! Use a compliant mailer.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_auth_mysql questions

Posted by Res <re...@ausics.net>.
On Tue, 3 Jun 2008, Chris Cohen wrote:

> On Tuesday 03 June 2008 11:37:30 Res wrote:
>> Which version of Apache? later versions do not use that module. so to
>> get help you should to specifiy the version
>
> Sorry, forgot that.
> apache2-mpm-prefork (2.2.8-1ubuntu0.2)
> libapache2-mod-auth-mysql (4.3.9-4)

Who knows what debian/ubuntu do, maybe your best asking over there
since apache 2.2.(6|8) uses  mod_dbd  (compile time  --with-mysql as of 
2.2.8, it works in 2.2.6 but is a more complicated to get it to work, but 
that all changed with an agreement between mysql and apache foundation 
folks for release 2.2.8)


ie - in global:

DBDriver mysql
DBDParams "host=dbhost.name dbname=dbname user=dbuser pass=foobar"

...and inside a directory statement:
     AuthType Basic
     AuthName "Web Stats"
     AuthBasicProvider dbd
     AuthDBDUserPWQuery "SELECT pass FROM user WHERE user = %s"
     Require valid-user


To see if you have mysql recognised try:

ldd /path/to/httpd | grep libmysqlclient_r

You should get something like...

~# ldd /usr/local/apache/bin/httpd | grep libmysqlclient_r
         libmysqlclient_r.so.15 => /usr/lib/mysql/libmysqlclient_r.so.15 
(0xb7d7f000)



-- 
Cheers
Res

I read usenet and lists in pine. But m$ outlook, thunderbird and gmail
often use html span/whatever for quotes, makes it hard to tell who said
what, so I dont try. If I ignore you, thats why! Use a compliant mailer.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_auth_mysql questions

Posted by Chris Cohen <ki...@gmx.de>.
On Tuesday 03 June 2008 11:37:30 Res wrote:
> Which version of Apache? later versions do not use that module. so to
> get help you should to specifiy the version

Sorry, forgot that.
apache2-mpm-prefork (2.2.8-1ubuntu0.2)
libapache2-mod-auth-mysql (4.3.9-4)

-- 
Thanks
Chris

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_auth_mysql questions

Posted by Res <re...@ausics.net>.
Which version of Apache? later versions do not use that module. so to get 
help you should to specifiy the version

On Tue, 3 Jun 2008, Chris Cohen wrote:

> Hello,
>
> thanks to Eric Covener I got apache's reverse proxy working with basic
> htpasswd authentication. But now that it's working, I want to
> authenticate Apache against a mysql database with about 15 users.
> (I think I could write a script that syncs the database to the htpasswd
> file, but that is only my backup option).
>
> What I tried is:
>        <Location />
>                AuthType Basic
>                AuthName "Internal Proxy"
> #                AuthUserFile /etc/apache2/htpasswd
>               AuthMySQL               on
>               AuthMySQL_Authoritative on
>               AuthMySQL_Host          bender.unixhosts.org
>               AuthMySQL_User          www-ext
>               AuthMySQL_Password     password
>               AuthMySQL_DB            network
>               AuthMySQL_Group_Table   users
>               AuthMySQL_Empty_Passwords off
>               AuthMySQL_Encryption_Types MySQL
>                Require valid-user
>                ProxyPass               http://int.unixhosts.org:8080/
>                ProxyPassReverse        http://int.unixhosts.org:8080/
>        </Location>
>
> But it just doesn't work. Nothing in the logs.
>
> I am still pretty new to all this apache stuff, so please gimme a
> hint :)
>
>

-- 
Cheers
Res

I read usenet and lists in pine. But m$ outlook, thunderbird and gmail
often use html span/whatever for quotes, makes it hard to tell who said
what, so I dont try. If I ignore you, thats why! Use a compliant mailer.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org