Following are the step to install mod_auth_mysql for apache.
Download mod_auth_mysql-2.9.0.tar.gz
wget
http://downloads.sourceforge.net/modauth...g_mirror=0
Then move the downloaded file to
mv /usr/local/srcmv mod_auth_mysql-2.9.0.tar.tar /usr/local/src/mod_auth_mysql-2.9.0.tar.tar
Extract the files contents
tar xvzf mod_auth_mysql-2.9.0.tar.tarcd mod_auth_mysql-2.9.0.tar.tar
Now we’ll build the module file.
/usr/local/apache/bin/apxs -c -lmysqlclient -lm -lz -I /usr/include/mysql/ mod_auth_mysql.c
After building the module we will install it.
/usr/local/apache/bin/apxs -i mod_auth_mysql.so
Open up httpd.conf pico /usr/local/apache/conf/httpd.confSearch for the .so files and add this below them.ctrl + w add the following line
LoadModule mysql_auth_module libexec/mod_auth_mysql.so
We need to add a second line to the httpd.conf so lets do another search.Search for the AddModule files and add this below them.ctrl + wadd the follwing second line
AddModule mod_auth_mysql.c
Restart Apache server
/etc/init.d/httpd restart
You can see your new module in phpinfo(); pages, in the apache heading, you should see.
Loaded Modules mod_auth_mysql
Add following in .htaccess in which folder you need to protect.
AuthMySQLEnable on
AuthName "Boys-Smoking.com Member Area"
AuthType Basic
AuthMySQLHost localhost
AuthMySQLDB boyssmok_boysmoking
AuthMySQLUser boyssmok_boysmok
AuthMySQLPassword boysmoking@xxx
AuthMySQLUserTable mysql_auth
AuthMySQLNameField username
AuthMySQLPasswordField passwd
AuthMySQLGroupField status
AuthMySQLNoPasswd On
AuthMySQLPwEncryption md5
require valid-user