How to Set Site Authentication

Authentication is the process of confirming a user's identity, and it provides a way to ensure that legitimate users create content on your site. The steps in the methods below (Web GUI and By Hand) are interchangeable. You can manually create a database file and then load it via the WebConsole, and vice versa.

Method 1. Setup by Web GUI

Step 1.Create Authorization Realms DB

We will create a new one as an example.

Set DB Type to Password File.


  1. Realm name, e.g. TEST
  2. DB Location, e.g. $VH_ROOT/conf/TESTDB

Step 2.Create Auth User

Set User/Password, e.g. TEST/TEST

Step 3. Add Access Require by Context

Add a Context and select type as Static


  1. URI /
  2. Location $VH_ROOT/html/
  3. Accessible Yes
  4. Realm TEST
  5. Access Allowed *

Method 2. Setup By Hand

Step1. Create Account Through htpasswd

Run the following command to generate TESTDB file from console:


Then enter the password (e.g.TEST) two times.

Step 2. Add Access Require by htaccess

Add the following rules into your .htaccess file.

AuthType Basic
AuthName "My Protected Area"
AuthUserFile /path/to/.htpasswd
Require valid-user
  • AuthName can be set to anything, e.g. TEST
  • AuthUserFile needs a valid file, e.g./usr/local/lsws/DEFAULT/conf/TESTDB

How to Verify

Access the site. It will require an authorized login.

litespeed_wiki/config/authenticate.txt · Last modified: 2018/06/18 13:24 by Lisa Clarke