MYSQL auth with apache .htaccess

MySQL authentication provides a more flexible and powerful system than Basic or Digest authentication. All the username's and passwords can be in database which provides capability to standardize among all web servers.

Module: mod_auth_mysql

Configure following parameters at .htaccess file

AuthType: This need to be Basic.
AuthName: This is the name (realm) you want to give to your password protected site.
Auth_MYSQLhost: Your MySQL database hostname.
Auth_MYSQLusername: Your MySQL database username.
Auth_MYSQLpassword: Your MySQL database password.
Auth_MYSQLdatabase: This is your database with the member's info.
Auth_MYSQLpwd_table: The members info table containing (Apache username/password).
Auth_MYSQLuid_field: The username field.
Auth_MYSQLpwd_field: The password field.
Auth_MYSQL_EncryptedPasswords: Are the password MySQL encrypt. [onoff].
require valid-user

Ref:
https://www.widexl.com/tutorials/htaccess.html

Comments