Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Nov 2006
    Posts
    106
    Thanks
    0
    Thanked 0 Times in 0 Posts

    best way to Authentication

    Well, I have a website I want to allow un authenticated access to. Then I have several directories of html and php files that I want to password protect. What is the best way to do this? I can do it with .htaccess but I don't think anyone likes to use that anymore? Is there an easyish way to setup a small db to store usernames, password and group and then set the directories to allow groups in? I would need to be able to have people belong to multiple groups as some people will have access to more than one authenticated directory.

  • #2
    Regular Coder
    Join Date
    Nov 2006
    Posts
    106
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I read this file but I am unsure of the <directory> part and how you assign a group to a particular directory. Has anyone used this method of securing a website?
    also I am not sure where you type in the <directory> part is that a set of commands to be run in mysql? or is that a file you put in the directory or what?

    # CREATE DATABASE auth;
    # USE auth;
    # CREATE TABLE users (
    # user_name CHAR(30) NOT NULL,
    # user_passwd CHAR(20) NOT NULL,
    # PRIMARY KEY (user_name)
    # );
    # CREATE TABLE groups (
    # user_name CHAR(30) NOT NULL,
    # user_group CHAR(20) NOT NULL,
    # PRIMARY KEY (user_name, user_group)
    # );
    # GRANT SELECT
    # ON auth.users
    # TO authuser@localhost
    # IDENTIFIED BY 'PaSsW0Rd';
    # GRANT SELECT
    # ON auth.groups
    # TO authuser@localhost
    # IDENTIFIED BY 'PaSsW0Rd';
    #
    # INSERT INTO users VALUES ('testuser', ENCRYPT('testpass'));
    # INSERT INTO groups VALUES ('testuser', 'user');
    # INSERT INTO users VALUES ('testadmin', ENCRYPT('testpass'));
    # INSERT INTO groups VALUES ('testadmin', 'admin');
    # INSERT INTO groups VALUES ('testadmin', 'user');
    #
    #<Directory /var/www>
    # AuthName "MySQL group authenticated zone"
    # AuthType Basic
    #
    # AuthMySQLEnable on
    # AuthMySQLUser authuser
    # AuthMySQLPassword PaSsW0Rd
    # AuthMySQLDB auth
    # AuthMySQLUserTable users
    # AuthMySQLNameField user_name
    # AuthMySQLPasswordField user_passwd
    # AuthMySQLGroupTable groups
    # AuthMySQLGroupField user_group
    #
    # require group user
    #</Directory>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •