Share EncyclopediaHome EncyclopediaCategories Switch Channel

Mysql local identity apace and mysql integration to achieve basic identification mysql

2026-03-20 07:17670NameNetworking

Apache

There are many ways in which apache can achieve basic user identification, such as the most common txt text and dbm format, but these are not ideal methods in a heavily loaded server, text-based, flat, poor and unsafe form; dbm's better, but it's hard for thousands or thousands of usersBack-office storage is a good way of doing it - more efficient and secure than ground search, and user passwords are stored in the database's table in des encryption。

This has been achieved thanks to apache's own excellent modular structure - as well as an open dso approach - which allows developers to complete a large number of third-party modules and expand apache's functionality. I've only written in this paper that mysql is used as a backstage storage -- it can be done with postgresql, oracle and so on -- in the same way -- in each module。

Let's get started -- go to modeules. Apache. Org and find the mod auth mysql -- there'll be two -- we'll use the dso -- actually go straight to ftp://ftp. KcilInk. Com/pub/the next mod auth mysql. C. Gz is good -- untie it is a mod auth mysql. C -- we use apxs to generate the dso module (apache, you compiled in dso mode) -- apxs-c-i-a-l/usr/local/lib/mysql-lmysql >-lm mod auth mysql. C -- note that this is necessary -- l/usr/local/lib/mysql is the client library of mysql, i assume that mysql is an off-key installation) -- if it is not reported wrong -- it is not possible to load the module at the start of apache。

Look at the words loadmodule mysql auth module libexec/mod auth mysql. So and addmodule mod auth mysql. C。

And then we go into mysql, mysql >create databI don't know;

Mysql>useus;

Mysql

Php mysql apace

- no, no, no, no,

- we're in the middle of nowhere,

- ♪ groups char ♪,

- >primary key (username);

Note that the field name must be user name and user passwd. Insert several more records:

I'm sorry, mysql

I'm sorry'xingfei2', encrypt','xingfeiI'm sorry;

Query ok, 1row listed (0. 00 sec)

Php mysql apace

I'm sorry, mysql

I'm sorry'xingfei', encrypt','xingfeiI'm sorry;

Query ok, 1row listed (0. 00 sec)

Here abbcde is a password -- encrypted with an encrypt function, using des algorithms -- this is an algorithm equivalent to password for unix -- instead of a password() function encrypted by mysql itself。

Finally, a. Htaaccess (don't forget to open allooverride all) in the directory to protect reads:

"xingfei"

I don't think so

Authmysqlhost localhost ---mysql first name

Php mysql apace

Authmysqluser root ---mysql

Password for user authmysqlpassword ---mysql

Authmysqldb auth -- -- user's library -- that's what we built

Authmysqlusertable mysql auth -- table used

Authmysqlgroupfield groups --- user group fields first name

I'm sorry, i'm sorry

I'm sorry, sir

Users can be placed in a single group - as long as they are users in this group, they can be authenticated, or they can be used individually or more

Like 0
Report
Favorite 0
Tip 0
Comment 0
Share 4
MoreRelated Comments
No comments yet, be the first to comment