[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-developers] Re: [ FIX ] mod_auth_mysql as DSO



This document is a HOWTO get mod_auth_mysql v2.20
installed on a RaQ3.

It worked for me and I hope it will work for
everybody else with a RaQ3, possibly RaQ2 as well.
RaQ2 guys let us know on the mailing list.

Grab
http://bourbon.netvision.net.il/mod_auth_mysql/mod_auth_mysql-2.20.tar.gz
and put it on (let's say) /home/tmp

# su
# gunzip mod_auth_mysql-2.20.tar.gz
# tar xvf mod_auth_mysql-2.20.tar.gz
# cd mod_auth_mysql-2.20
# vi mod_auth_mysql.c

position the cursor at line 34
press escape
press i
and type (you can cheat and do copy&paste):
/*-------------------------------------------------------*/
/* audric changes start 2000-09-08 19:45 */
/*-------------------------------------------------------*/

#include "quad.h"

/*
 * Define the order of 32-bit words in 64-bit words.
 */
#define _QUAD_HIGHWORD 1
#define _QUAD_LOWWORD 0

/*
 * Return 0, 1, or 2 as a <, =, > b respectively.
 * Neither a nor b are considered signed.
 */
int
__ucmpdi2(a, b)
        u_quad_t a, b;
{
        union uu aa, bb;

        aa.uq = a;
        bb.uq = b;
        return (aa.ul[H] < bb.ul[H] ? 0 : aa.ul[H] > bb.ul[H] ? 2 :
            aa.ul[L] < bb.ul[L] ? 0 : aa.ul[L] > bb.ul[L] ? 2 : 1);
}

/*-------------------------------------------------------*/
/* audric changes end 2000-09-08 19:45 */
/*-------------------------------------------------------*/

press escape
type :wq and enter

# ./configure --with-mysql=/usr --with-apxs=/usr/sbin
# cp config.h auth_mysql_config.h
#
/usr/sbin/apxs -i -a -I/usr/include/mysql -L/usr/lib/mysql -lmysqlclient -c
mod_auth_mysql.c
# vi /etc/httpd/conf/httpd.conf
in the whereabouts of line 34 you have:
LoadModule auth_mysql_module  apache/mod_auth_mysql.so
add /usr/lib/ in front of apache/mod_auth_mysql.so
so you get this
LoadModule auth_mysql_module  /usr/lib/apache/mod_auth_mysql.so

a few line below add

Auth_MySQL_Info your.db.server.com yourdbadminuser yourdbadminpassword

press escape
press :wq
# /etc/rc.d/init.d/httpd restart

Now you are ready to go for a test drive.

Follow the directions you find in /home/tmp/mod_auth_mysql-2.20/USAGE

And if you have used the default names for tables and fields
you can use .htaccess modified for the Cobalt RaQ3i below

------8<----------8<-------------8<-----------

order allow,deny
allow from all
AuthPAM_Enabled off
Authtype Basic

Auth_MySQL_DB     prova

Auth_MySQL_Password_Table  mysql_auth

Auth_MySQL_Username_Field  username

Auth_MySQL_Password_Field  passwd

Auth_MySQL_Empty_Passwords  on

Auth_MySQL_Encryption_Types Plaintext

Auth_MYSQL      on

Authname "Restricted area (uh!)"

<Files ".ht*">
        deny from all
</Files>

<Limit GET POST>
   require valid-user
</Limit>

------8<----------8<-------------8<-----------


Have a nice day to you all


Audric Leperdi
CIO - Evolutiva Srl
Via Varallo, 30
10153 - Torino
Tel 011 8121617 - Fax 011 8121614


----- Original Message -----
From: "Audric Leperdi" <aleperdi@xxxxxxxxxxxxx>
To: <cobalt-developers@xxxxxxxxxxxxxxx>; <mlampkin@xxxxxxxxxx>
Sent: Friday, September 08, 2000 7:03 PM
Subject: Re: [cobalt-developers] Re: mod_auth_mysql as DSO


> Any solution for the RaQ3i ?
>
> tnx
>
> Audric
>
> ----- Original Message -----
> From: "Ben Rothe" <ben@xxxxxxxxxxxxxxx>
> To: <mlampkin@xxxxxxxxxx>; <cobalt-developers@xxxxxxxxxxxxxxx>
> Sent: Saturday, February 19, 2000 12:45 AM
> Subject: [cobalt-developers] Re: mod_auth_mysql as DSO
>
>
> > Thanks for the quick reply. I've tried your tip and I still get
> > the same error when I try to start the httpd daemon:
> >
> > undefined symbol: __ucmpdi2
> >
> > Thought I'd see you if have any other ideas?
> >
> > Thanks again for your help.
> >
> > - Ben Rothe
> > ben@xxxxxxxxxxxxxxx
> >
> >
> >
> > Michael Lampkin <mlampkin@xxxxxxxxxx> wrote:
> >
> > > Should be a simple fix.  Apxs doesn't append a leading / onto
> > > the path names of module locations when it writes the LoadModule
> > > abc/def/etc line so apache takes it onto itself to append what
> > > it thinks the root path is when it attempts to load them.
> > >
> > > Unfortunately, it is wrong.  In fact, this error occurs with all
> > > DSO modules made with apxs.  Ah well, I still like the apxs
> > > functionality.
> > >
> > > Just edit httpd.conf and try changing line 34 so that the path
> > > reads /usr/lib/apache/mod_auth_mysql.so and the problem should
> > > disappear when you restart your server.  If not, let me know.
> > >
> > > Hope this helps -
> > >
> > > Michael Lampkin
> > > Business Dev. Engr
> > > Cobalt Networks, Inc.
> > >
> > >
> > >
> > > Ben Rothe wrote:
> > >>
> > >> Hi folks:
> > >>
> > >> I'm having trouble compiling mod_auth_mysql-2.20 as a DSO using
> > >> the /usr/sbin/apxs tool on a RaQ3i. Here is a brief summary of
> > >> what I have tried and the error that is being returned.
> > >>
> > >> The RaQ3i is just out-of-the-box and the only other things I have
> > >> installed is:
> > >>    MySQL-client-3.22.30-1.i386.rpm
> > >>    MySQL-devel-3.22.30-1.i386.rpm
> > >> I am using the version of Apache 1.3.6 that Cobalt supplied
> > >> with this machine.
> > >>
> > >> The error I get at run-time is:
> > >>
> > >> Syntax error on line 34 of /etc/httpd/conf/httpd.conf:
> > >> Cannot load /etc/httpd/lib/apache/mod_auth_mysql.so into server:
> > >> /etc/httpd/lib/apache/mod_auth_mysql.so: undefined symbol: __ucmpdi2
> > >>
> > >> Basically, I followed these steps to compile it.
> > >>
> > >> # ./configure --with-mysql=/usr --with-apxs=/usr/sbin
> > >> # apxs -c mod_auth_mysql.c (which outputs the following)
> > >>
> > >>
> >
>
cc -O2 -m486 -fno-strength-reduce -DLINUX=2 -DNO_DBM_REWRITEMAP -DMOD_SSL=20
> > >>
> >
>
2108 -DMOD_PERL -DUSE_PERL_SSI -Dbool=char -DHAS_BOOL -I/usr/include/mysql -
> > >>
> >
>
I/usr/local/include -DEAPI -DBIG_SECURITY_HOLE -DCOBALT_RAQ_LED -fpic -DSHAR
> > >> ED_MODULE -I/usr/include/apache  -c mod_auth_mysql.c
> > >> ld -Bshareable -o mod_auth_mysql.so mod_auth_mysql.o
> > >>
> > >> # /usr/sbin/apxs -i -a -n auth_mysql mod_auth_mysql.so
> > >> # cp mod_auth_mysql.so /usr/lib/apache/mod_auth_mysql.so
> > >>
> > >> I then added the necessary lines to the httpd.conf file and
> > >> restarted the server, but I always get the error above.
> > >>
> > >> Has anyone else had similar problems? Anyone had any success?
> > >> I would really like to get this module working with my httpd
> > >> (without recompiling httpd if possible). Any help or pointers
> > >> would be appreciated.
> > >>
> > >> - Ben Rothe
> > >> ben@xxxxxxxxxxxxxxx
> > >