httpd-users mailing list archives

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

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?

Thanks.
Dave.

httpd:
 # 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 test.example.com http virtual host
<VirtualHost *:80>
     ServerAdmin webmaster@example.com
     ServerName test.example.com
     ServerAlias test.example.com
     DocumentRoot /usr/local/www/apache24/test.example.com/htdocs
     ErrorLog "/usr/local/www/apache24/test.example.com/logs/error.log"
     CustomLog "/usr/local/www/apache24/test.example.com/logs/access_log"
combined
	ErrorDocument 404 /errordocs/error404.htm
<Directory /usr/local/www/apache24/test.example.com/htdocs>
 # 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
            #<RequireAll>
                #Require group alpha beta testgroup
#Require dbd-group team
                #Require not group reject
                #<RequireAny>
                    #Require valid-user
                #</RequireAny>
        #<RequireNone>
            #Require group temps
        #</RequireNone>
            #</RequireAll>
                    #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
</Directory>
</VirtualHost>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message