Jump to content

HowTo: mod_auth_mysql (windows)


scrupul0us

Recommended Posts

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.