Menu

mod_auth_mysql crashes on windows

Help
casker
2005-02-07
2013-04-23
  • casker

    casker - 2005-02-07

    Hi,

    I successfully set up mod_auth_mysql. When using Mozilla to access my protected site everything is ok. But when using Internet Explorer, if keeps asking for user/pw again and again and the apache processes are gonna crash.

    Win 2000
    apache 1.3.31
    mysql 3.x

    any hint would be appreciated!

    Greetings
    Casker

     
    • Jerry Stuckle

      Jerry Stuckle - 2005-02-07

      Hi, Casker,

      Sorry, I don't have any idea what might be going on here.  There shouldn't be any difference between how IE and Mozilla operate; the authorization is pretty well documented and I haven't seen anything like this.

      Do you have any messages in your Apache error log?  This is always the best place to start.

      Additionally, how do you have mod_auth_mysql configured?

      Jerry

       
      • casker

        casker - 2005-02-08

        Hi, thanks for the answer,

        i changed to apache 2.0.52, mysql 4.0.21-nt, php5. thought it would have anything to do with the problem. but there is no difference.
        but now i don't think that it is a ie/mozilla problem anymore. i have the same probs with mozilla.
        except that ie crashes apache instantaneously and mozilla a bit later ...
        with mozilla i can login. but after clicking on some nav-links the apache-process fails.

        the following error message i find in the log ...

        [Tue Feb 08 17:09:34 2005] [error] [client 192.168.0.2] MySQL ERROR: Lost connection to MySQL server during query, referer: http://www.myserver.com/php/menu.php?sid=e2ea54f9002b673bce70293de9fae47d&lang=de

        in the httpd.conf file i inserted:

        LoadModule mysql_auth_module modules/mod_auth_mysql.so

        and

        <Directory "C:\Programme\mypath">
            Options Indexes FollowSymLinks MultiViews Includes ExecCGI
            AddType text/html .shtml
            AddHandler server-parsed .shtml
            AddHandler cgi-script .cgi .pl
            AllowOverride All
            Order allow,deny

            <IfModule mod_auth_mysql.c>
              Allow from all       
              AuthType Basic
             
              AuthName "this"

              AuthMySQLHost localhost
              AuthMySQLDB mydatabase
              AuthMySQLUser myuser
              AuthMySQLPassword mypasswd
              AuthMySQLUserTable users
              AuthMySQLGroupField usergroup
              AuthMySQLNameField username
              AuthMySQLPasswordField user_password
              AuthMySQLCryptedPasswords Off
              AuthMySQLKeepAlive On     

              require group training

            </IfModule>
           
        </Directory>

        my mysql configfile (my.cnf) is ...
        #**************************************
        port=3306
        #socket=MySQL

        # Here is entries for some specific programs
        # The following values assume you have at least 32M ram

        # The MySQL server
        [mysqld]
        port=3306
        #socket=MySQL
        skip-locking
        set-variable    = key_buffer=16M
        set-variable    = max_allowed_packet=10M
        set-variable    = table_cache=64
        set-variable    = sort_buffer=512K
        set-variable    = net_buffer_length=8K
        set-variable    = myisam_sort_buffer_size=8M
        server-id    = 1

        # Uncomment the following if you want to log updates
        #log-bin

        # Uncomment the following rows if you move the MySQL distribution to another
        # location
        #basedir = d:/mysql/
        #datadir = d:/mysql/data/

        # Uncomment the following if you are NOT using BDB tables
        #skip-bdb

        # Uncomment the following if you are using BDB tables
        #set-variable    = bdb_cache_size=4M
        #set-variable    = bdb_max_lock=10000

        [mysqldump]
        quick
        set-variable    = max_allowed_packet=16M

        [mysql]
        no-auto-rehash
        # Remove the next comment character if you are not familiar with SQL
        #safe-updates

        [isamchk]
        set-variable    = key_buffer=20M
        set-variable    = sort_buffer=20M
        set-variable    = read_buffer=2M
        set-variable    = write_buffer=2M

        [myisamchk]
        set-variable    = key_buffer=20M
        set-variable    = sort_buffer=20M
        set-variable    = read_buffer=2M
        set-variable    = write_buffer=2M

        [mysqlhotcopy]
        interactive-timeout

        #**************************************

        i can't see any configuration error on my side. (but that doesn't meen there is none ;-) )

        what could i try to solve the problem?
        thanks in advance ...

        casker

         
    • Jerry Stuckle

      Jerry Stuckle - 2005-02-08

      Hi, Casker,

      Well, first of all, you need to take off AuthMySQLKeepAlive.  It doesn't work with Apache 2.0, and can cause problems.  This is a known problem (see the CONFIGURE file); we haven't taken out the parameter because we're looking at other ways to fix the problem.  But it's not simple :-).

      The fact you see a lost connection in the Apache log also points to this as a potential problem.

      However, it still bothers me that Apache is crashing.  The worst we should be able to do is not authorize the user; the fact there is a crash is a major problem.  Is there anything else in your Apache log, syslog, etc., reference the crash?

      Jerry

       
    • Christian Meisinger

      just a guess:
      maybe mysql_handle gets NULL or invalid after the connection error.
      and then mayyybeee mysql_error(mysql_handle) crashes?

       
    • Jerry Stuckle

      Jerry Stuckle - 2005-02-09

      Christian,

      This is possible.  However, I'd rather not guess at this time. 

      There are known problems with AuthMySQLKeepAlive and we are looking at how to rewrite this whole area.  The code from Apache 1.x doesn't work with Apache 2.x due to the different threading mechanism used by Apache.  However, it's not easy, requiring the use of semaphores and shared memory to hold the connection information.

      And while we're at it, we're looking at how to streamline the processing, also.  Currently there are a  several extra calls being made which could be streamlined.  The current code works (usually :) ) and has the advantage of being simple.  But it has performance problems in heavily-loaded systems.

      The best thing to do right now is to just not use AuthMySQLKeepAlive, especially with Apache 2.x, until we get everything sorted out.

      Jerry

      There are known performance problems here, especially in heavily loaded systems.  We're currently doing a lot of extra calls which aren't really necessary if we redesign the connection code.  The current code is good in that it's simple - and works

       
    • casker

      casker - 2005-03-02

      Hi there,

      I just want to give some feedback on my problem. I could not solve it and I didn't want to look any further. It was frustrating enough. I changed my complete development environment to suse linux 9.2 and voila ... no problems whatsoever.

      Never use windows as a serversystem! ;-)

      Thanks for trying to help me.

      Greetings from Berlin, Germany!
      casker

       
    • Jerry Stuckle

      Jerry Stuckle - 2005-03-02

      Casker,

      Glad to hear you got it working on suse. 

      I really don't know what the problem was on Windows.  However, looks like I'm going to have to find a cheap copy of Visual C++ to be able to compile and test on Windows.  Been watching ebay, but nothing in the price range I want to spend for VC++ 6.0 Professional.

      Jerry

       

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.