Article by Aashish
# yum install httpd* mysql* -y
*** Install Module Needed for Authentication from MySQL databases. ***
# yum install mod_auth_mysql -y
*** Create a database which contains a table holding the username and passwd ***
#mysql -u root -p
password:
mysql> create database httpd;
mysql> use httpd;
mysql> create user ‘apache’@'localhost’ identified by ‘apache’;
mysql> create table users( user_name char(30) NOT NULL, user_passwd char(30), user_group char(30)
NOT NULL, PRIMARY KEY(user_name));
mysql> grant all privileges on *.* to ‘apache’@'localhost’ with GRANT option;
mysql> INSERT INTO users VALUES (’testuser’, ENCRYPT(’testpass’), ‘user’);
mysql> INSERT INTO users VALUES (’admin’, ENCRYPT(’testpass’), ‘group’);
mysql> quit
# service mysqld restart
# vim /etc/httpd/conf/httpd.conf
AuthName “MySQL group authenticated zone”
AuthType Basic
AuthMYSQLEnable on
AuthMySQLUser apache
AuthMySQLPassword apache
AuthMySQLDB httpd
AuthMySQLUserTable users
AuthMySQLNameField user_name
AuthMySQLPasswordField user_passwd
AuthMySQLGroupField user_group
require group admin /or/ require valid-user
# service httpd restart
enjoy
2 Responses to How to Implement htaccess with MySQL
JIMMIE
July 3rd, 2010 at 11:49 pm
Buy:Maxaman.Levitra.Zithromax.Viagra Super Active+.Viagra Soft Tabs.Cialis.Viagra.Tramadol.VPXL.Super Active ED Pack.Cialis Super Active+.Cialis Professional.Propecia.Soma.Viagra Professional.Viagra Super Force.Cialis Soft Tabs….
r2
August 30th, 2010 at 4:35 am
r2 http://eavedaspaxf.AUTOPARTSVILLE.INFO/tag/r2+Sap+Aveda/ : Sap…
Aveda…