[users@httpd] How to use mod_authn_dbd and sqlite3 for authentication?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



HI,

I've been trying to configure mod_authn_dbd ( my apache version is
2.2.3 ) to use sqlite3 for user authentication, two days passed but
things still didn't work well :-(

So here is what I did:

1. First I created a database file and inserted some user information
for test using sqlite3.

# sqlite3 userpasswd.db
sqlite3> create table authn (user_name char(20) not null primary key,
user_passwd char(20) not null);
sqlite3> insert into authn values ('user', 'passwd'); # not encrypted,
I don't know whether it should be encrypted

2. Then add the following configuration to httpd.conf. It's almost the
same with the sample in the document except the arguments for DBDriver
and DBDParams. The required modules are all loaded.

DBDriver sqlite3
DBDParams "/path/to/userpasswd.db" # the document says the string will
be passed to sqlite3_open, but I didn't know what should actually
write here.

#Parameters for Connection Pool Management
DBDMin  1
DBDKeep 2
DBDMax  10
DBDExptime 60

#Authentication Section
<Directory /var/httpd/html/private/>

   #mod_auth configuration for authn_dbd
   AuthType Basic
   AuthBasicProvider dbd
   AuthName "private content"

   #authz configuration
   Require valid-user

   #SQL query to verify a user
   #(note: DBD drivers recognise both stdio-like %s and native syntax)
   AuthDBDUserPWQuery "select user_passwd from authn where user_name=%s"
</Directory>

After that, I restarted apache, and tried to visit pages in the
private directory. There does appears an authentication dialog asking
for user name and password. However, after entered the same user name
and password in the database file, I got the message "Error 500".
Then I looked up in the error log and see this "No DBD Authn
configured!" I've justed started learn to use apache and don't know
what does this mean.

I've googled for information about mod_authn_dbd and sqlite3 but
didn't find something useful. Has anyone succeed to configured this?
Any suggession or information will be great help to me!

--
Best regards,
Chen Yufei

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux