Menu

Documentation: pre-reqs?

Dave Nice
2004-12-09
2013-04-23
  • Dave Nice

    Dave Nice - 2004-12-09

    Hi there.

    Quite enjoying the challenge of getting this working - I'm relatively new to linux.  I've got it working at home, with a recent fedora install of apache, php and mysql.  Took a while, and then was foiled by the new authentication in mysql.  I was wondering if this problem would be worth mentioning in the (new, improved!) documentation, or do you feel it's not directly relevant to the mod?

    Also, having sorted it at home, I'm trying to get it going at work.  The MySQL installation there is a 3.23 release, I've downloaded the source code (was installed from RPM originally), and it doesn't seem to include my_aes.h, which is required to compile the mod.  I'm guessing that this comes about somewhere around 4.x.  Would this be worth mentioning in the documentation?

    I'd be happy to have a go at this, if you think it would be appropriate.

    Dave

     
    • Jerry Stuckle

      Jerry Stuckle - 2004-12-09

      Hello, Dave,

      Darn - I thought I checked that out.  I don't have mysql 3.x here, but I checked back through the documentation...

      OK, let me look at it tomorrow.  I'll figure out a way to add or not add the AES encryption - either based on the mysql headers or a -D parameter in the compile line.

      Thanks for the heads up.

      Jerry

       
    • Jerry Stuckle

      Jerry Stuckle - 2004-12-11

      Dave,

      I've got a version ready which I *think* will work.  However, since I don't have MySQL 3.x, I'm not sure.

      Can I send it to you in email?  I'd rather not post it here until I have a better feel that it's OK.

      Jerry

       
      • Dave Nice

        Dave Nice - 2004-12-11

        Yes, that's fine.  I'll send my email address to your sourceforge one.

        You'll have to bear in mind that if it doesn't work it could well be due to my incompetence :)

        Cheers,

        Dave

         
    • Jerry Stuckle

      Jerry Stuckle - 2004-12-13

      Dave,

      Wondering how it went?  (My email was down for a little over a day - DDOS attack on the name servers).

      FYI - I'm just getting Version 2.8.1 going now.  Trying to detect AES encryption automatically has been a real pain.  Therefore, for now, anyway, I'm adding a new -D paramater in the compile line if you want AES encryption (and have a sufficiently late version of MySQL).

      The module is working; as soon as I update the doc I'll post it here - probably tomorrow.

      Jerry

       
      • Dave Nice

        Dave Nice - 2004-12-14

        Jerry,

        I've tried it, but got stuck again.  I'm sorry I'm not more competent with C etc, I'd try and work out myself more of what's going on :-s

        The module appeared to compile correctly after commenting the line (good news!), the info sent to STDERR is below (tidied up a bit).

        /opt/apache/build/libtool --silent --mode=compile gcc -prefer-pic  -DAP_HAVE_DESIGNATED_INITIALIZER
        -DLINUX=2 -D_REENTRANT -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE -g -O2 -pthread
        -I/opt/apache/include  -I/opt/apache/include   -I/opt/apache/include 
        -I/home/niced/mysql-3.23.49-pc-linux-gnu-i686/include/  -c -o mod_auth_mysql.lo mod_auth_mysql.c && touch mod_auth_mysql.slo /opt/apache/build/libtool --silent --mode=link gcc -o mod_auth_mysql.la -I/home/niced/mysql-3.23.49-pc-linux-gnu-i686/include/  -L/home/niced/php-4.3.9/ext/mysql/libmysql
        -rpath /opt/apache/modules -module -avoid-version    mod_auth_mysql.lo

        I ran the command
            /opt/apache/bin/apxs -i mod_auth_mysql.la and uncommented the correct line in my httpd.conf file
            #LoadModule mysql_auth_module modules/mod_auth_mysql.so

        When I restart apache, I get the following error.

        Cannot load /opt/apache/modules/mod_auth_mysql.so into server: /opt/apache/modules/mod_auth_mysql.so: undefined symbol: mysql_store_result

        As you may remember, I haven't actually used the source that MySQL and PHP were compiled from - either they were installed from RPMs, or I foolishly deleted the source because I ran out of disk space.  Could this cause these problems?  I'm fairly confident that I've downloaded the correct levels of source from the Internet, however.

        Any ideas?  Perhaps I should just upgrade MySQL? :)

        Thanks,

        Dave

         
    • Jerry Stuckle

      Jerry Stuckle - 2004-12-14

      Dave,

      What was the exact command you used to compile mod_auth_mysql?

      From your output, it looks like perhaps you put your -L and -l options after the mod_auth_mysql.c in the line.

      mod_auth_mysql.c MUST be the last item on the line; these are position dependent (-I, -L and -l options only affect modules which follow them in the command line).

      It also looks like I need to update the docs a little more to make this clear.

      Jerry

       
      • Dave Nice

        Dave Nice - 2004-12-14

        /opt/apache/bin/apxs -c
        -I/home/niced/mysql-3.23.49-pc-linux-gnu-i686/include/
        -L/home/niced/php-4.3.9/ext/mysql/libmysql
        mod_auth_mysql.c 2> errors.log

        This was my exact compilation command.

        I then used
        /opt/apache/bin/apxs -i mod_auth_mysql.la

        because I'm running Apache2.

        Thanks,

        Dave

         
    • Dave Nice

      Dave Nice - 2004-12-14

      Jerry,

      I didn't use a -l command.  It worked fine without at home - I presume now that I was using the default library name.  Perhaps this is something I  need to try specifying.

      Dave

       
    • Jerry Stuckle

      Jerry Stuckle - 2004-12-14

      Dave,

      Yes, if the libraries don't default, you need to use -L (path to your mysql libs) -lmysqlclient -lm -lz.

      It doesn't hurt to use them anyway to ensure you're picking up the right stuff.

      Jerry

       
    • Dave Nice

      Dave Nice - 2004-12-15

      Jerry.  Thanks for your help.

      I've tried a wide variety of compile commands this evening!  I kept getting errors about not finding -lz.  After a good search, I was missing zlib-devel.  I downloaded the zlib and zlib-devel RPMs, which seem to have allowed me to build it using the command:
      /opt/apache/bin/apxs -I ../mysql-3.23.49-pc-linux-gnu-i686/include/ -L ../mysql-3.23.49-pc-linux-gnu-i686/lib  -lmysqlclient -lm -lz -c mod_auth_mysql.c

      I also had a read of the apxs documentation and found the -i and -a options, to cover the apxs -i command, and adding the line to the config file.  Would this be a useful addition to simplify installation, or is there a potential pitfall with this?

      Once I've recovered enough to try it all out, I'll let you know if it actually works!

      Dave

       
    • Jerry Stuckle

      Jerry Stuckle - 2004-12-15

      Hi, Dave,

      Yes, you do need the zlib development package.  It's not mentioned in the module documentation because it's a requirement of MySQL - you need it to compile/link any of their modules.  But perhaps we should add it to the BUILD file.

      And yes, I'm familiar with the -a and -i options for apxs.  I never added it to the doc, though, because users generally have to modify httpd.conf anyway (at least ensure AllowOverrides is set).  Also, if apxs ever has a problem updating the httpd.conf file, it's hard telling what might happen. So, the easy way it to just add it manually - it's only one line, after all.

      And yes, please let me know how it works.

      Jerry

       
    • Dave Nice

      Dave Nice - 2004-12-16

      Jerry,

      Thanks.  All working well.  I just need to migrate my .htpasswd file now.  I think a quick edit in vi to replace : with , should let me import it using phpmyadmin as a CSV file, and then use the CRYPT password setting for now.

      Brilliant!

      Dave

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.