1.线索:cat /var/log/httpd/error_log 2.发现:每次登录加密目录失败后都会在error_log追加如下记录: [Sat Jun 18 02:32:16 2005] [error] [client 221.5.200.34] MySQL ERROR: Table 'test.user_info' doesn't exist (晕:居然跟mysql 有关,各位看官此时是不是有些纳闷?) 3.Google里搜寻:MySQL ERROR: Table 'test.user_info' doesn't exist 4.如下收获: If you are trying to run mod_auth_mysql and BASIC htaccess authentication at the same time you may want to do something like so in your httpd.conf after you have mod_auth_mysql working. Options All AuthMySQLEnable off AllowOverride All This will turn it off globally. The main reason for us needing to do this is because if a client uses cpanel to create Password Protected Directories and then tries to access this protected directory you'll get something like: [Mon May 2 10:29:48 2005] [error] MySQL ERROR: Table 'test.user_info' doesn't exist: /test [Mon May 2 10:29:48 2005] [error] MySQL user test not found: /test [Mon May 2 10:29:49 2005] [error] MySQL ERROR: Table 'test.user_info' doesn't exist: /test [Mon May 2 10:29:49 2005] [error] MySQL user test not found: /test [Mon May 2 10:29:50 2005] [error] MySQL ERROR: Table 'test.user_info' doesn't exist: /test [Mon May 2 10:29:50 2005] [error] MySQL user test not found: /test It automatically tries to use mod_auth_mysql as the only authentication. So turn it off globally and then in your .htaccess file turn it back on per directory as you need it. And a good how-to on installing mod_auth_mysql with Apache 1.3 (linux) go here: http://www.webhostgear.com/215.html Just wanted to share this in case anyone else has run into the same problem. 5.根据该贴修改配置,大功告成,可以成功登录密码限制目录。
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/48770/viewspace-179614/
,如需转载,请注明出处,否则将追究法律责任。