httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Mehler <>
Subject [users@httpd] Apache 2.4 with Mysql authentication
Date Mon, 01 May 2017 21:39:06 GMT

I've got a Mysql database set up for user authentication, with fields
username, password, group, and active. I've got a group testgroup that
i've put users in. I'm wanting to authorize users as follows: any
users in the testgroup but who must also be a valid-user.

Can someone take a look at my mysql setup and tell me if I have any
mistakes in it?


 # mod_dbd configuration
DBDriver mysql
DBDParams "host=localhost port=xxxx user=xxxxxx pass=xxxxxxxxxx dbname=dbname"
DBDMin 4
DBDKeep 8
DBDMax 10
DBDExptime 300
DBDPersist On

# The http virtual host
<VirtualHost *:80>
     DocumentRoot /usr/local/www/apache24/
     ErrorLog "/usr/local/www/apache24/"
     CustomLog "/usr/local/www/apache24/"
	ErrorDocument 404 /errordocs/error404.htm
<Directory /usr/local/www/apache24/>
 # mod_authn_core and mod_auth_basic configuration
 # for mod_authn_dbd
 AuthType Basic
 AuthName "Restricted Access"

 # To cache credentials, put socache ahead of dbd here
 AuthBasicProvider socache dbd

 # Also required for caching: tell the cache to cache dbd lookups!
 AuthnCacheProvideFor dbd
 AuthnCacheContext my-server

 # mod_authn_dbd SQL query to authenticate a user
 AuthDBDUserPWQuery "SELECT password FROM dbname WHERE username = %s"

 # mod_authz_core configuration
                #Require group alpha beta testgroup
#Require dbd-group team
                #Require not group reject
                    #Require valid-user
            #Require group temps
                    #Require group testgroup
Require dbd-group testgroup
                    Require valid-user

  # mod_authz_dbd configuration
  AuthzDBDQuery "SELECT group FROM dbname WHERE username = '%s'"
AuthzSendForbiddenOnFailure On
Options FollowSymLinks
AllowOverRide None

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message