scrupul0us Posted June 19, 2007 Share Posted June 19, 2007 Well after a couple of months ive figure out (on a win32 box at least) how to implement mod_auth_mysql First the setup apache 2.2.4 php 5.2.3 mysql 5.0.41 Now we need the auth module (i used DSO or .SO.. same thing) head over to the XAMPP website and grab this file: http://www.apachefriends.org/download.php?xampp-win32-1.6.2.zip (thats the loose pack for their latest release that includes the mod_auth_mysql.so) grab the file from the archive xampp\apache\modules\mod_auth_mysql.so and drop that into your current apache modules directory Configuring Apache to use the module -Edit your httpd.conf file and add this: LoadModule mysql_auth_module modules/mod_auth_mysql.so to the rest of your modules -at the very bottom add this <Directory "*****PATH*****"> AuthName "MySQL Testing" AuthType Basic AuthMySQLHost localhost AuthMySQLUser mod_auth AuthMySQLPassword mod_auth AuthMySQLDB mod_auth_mysql AuthMySQLUserTable user_info AuthMySQLNameField user_name AuthMySQLPasswordField user_passwd AuthMySQLPwEncryption md5 AuthMySQLEnable On require valid-user </Directory> (make sure you replace the *****PATH***** to reflect the directory you are protecting) (also you need to create this directory in your htdocs structure) Configure mysql -import this dump inside of a new database called mod_auth_mysql CREATE TABLE `user_info` ( `user_id` int(11) NOT NULL auto_increment, `user_name` char(30) collate utf8_unicode_ci NOT NULL, `user_passwd` varchar(32) collate utf8_unicode_ci NOT NULL, `user_group` char(10) collate utf8_unicode_ci default NULL, PRIMARY KEY (`user_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2 ; And that should work perfectly... hope that helps... feel free to post questions... il ltry to answer them Quote Link to comment Share on other sites More sharing options...
steviewdr Posted June 20, 2007 Share Posted June 20, 2007 Looks good. I hope you dont have httpd.conf accessible to all users - so they can read your mysql passwords!! -steve Quote Link to comment Share on other sites More sharing options...
scrupul0us Posted June 20, 2007 Author Share Posted June 20, 2007 no sir... apache runs as "apache".... not as "administrator" and i have its files locked down accordingly Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.