Add user/passwd for access to a page

Discussion in 'Install/Configuration' started by reshu1596, Feb 14, 2007.

  1. reshu1596

    reshu1596 Member

    Hi: I have created a php page and want to add security to the page. I know the data needs to be in the ~lsws/DEFAULT/conf/htpasswd. How do I add a new username/passwd and link it to a php file or directory.

  2. mistwang

    mistwang LiteSpeed Staff

  3. reshu1596

    reshu1596 Member

  4. mistwang

    mistwang LiteSpeed Staff

  5. reshu1596

    reshu1596 Member

    I created a new realm under the Virtual Host Example with the following attributes

    Realm Name: PolicyPHP
    UserDB Location $VH_ROOT/conf/spt-passwd and added a user to the file
    GroupDB Location $VH_ROOT/conf/spt-htgroup
    cache and timeout: 200, 60

    Created a new static type context with the above Realm, and above user, URI: /sprint/, Location: sprint/

    when I point my browser to http://hostname:port/sprint/, iit prints the stuff in index.html without asking for password.
    but http://hostname:port/protected does ask for the password.

    Any file I can check to see what might be the issue?

  6. mistwang

    mistwang LiteSpeed Staff

    "Authentication Name" and "Required" should be set in addition to "Realm" for the context. Please double check.
  7. reshu1596

    reshu1596 Member

    sorry forgot to mention. Yes they are set as well. All of them are default values except the following:

    URI /sprint/
    Location sprint/
    Accessible Yes
    Realm SprintPolicyPHP
    Authentication Name Sprint
    Required user rmalghan
    Access Allowed *
    Access Denied N/A
    Add Default Charset Off

  8. mistwang

    mistwang LiteSpeed Staff

    Have you restart the server to apply the change? Any error messages in lsws/logs/error.log?

Share This Page