Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
litespeed_wiki:config:authenticate [2018/06/15 20:10]
Eric Leu [How to set Site Authentication]
litespeed_wiki:config:authenticate [2018/06/18 13:24]
Lisa Clarke Proofreading
Line 1: Line 1:
-====== How to set Site Authentication ====== +====== 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 first thing we are going to do us create ​authentication ​database. +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 ​database ​file and then load it via the WebConsole, and vice versa
-===== Create Access Password ===== +=====Method 1. Setup by Web GUI ===== 
-====Method 1. Create account through Realm ==== +==== Step 1.Create Authorization Realms DB ==== 
-=== Step 1.Create Authorization Realms DB === +We will create a new one as an example.
-We will create a new one as example+
  
 {{:​litespeed_wiki:​config:​realm-1.png?​800|}} {{:​litespeed_wiki:​config:​realm-1.png?​800|}}
  
-Choose ​DB type as Password File+Set **DB Type** to ''​Password File''​.
  
 {{:​litespeed_wiki:​config:​realm-2.png?​|}} {{:​litespeed_wiki:​config:​realm-2.png?​|}}
  
 Set: Set:
-  - Realm name, e.g. TEST +  - **Realm name**, e.g. ''​TEST''​ 
-  - DB Location, e.g. $VH_ROOT/​conf/​TESTDB+  - **DB Location**, e.g. ''​$VH_ROOT/​conf/​TESTDB''​
 {{:​litespeed_wiki:​config:​realm-7.png?​800|}} {{:​litespeed_wiki:​config:​realm-7.png?​800|}}
  
-=== Step 2.Create Auth user === +==== Step 2.Create Auth User ==== 
-Set e.g. User/​Password ​TEST/​TEST ​+Set **User**/​**Password**, ​e.g. ''​TEST''​/''​TEST'' ​
  
 {{:​litespeed_wiki:​config:​realm-6.png?​|}} {{:​litespeed_wiki:​config:​realm-6.png?​|}}
  
-====Method 2Create account through htpasswd ==== +==== Step 3Add Access Require ​by Context====
-Run the following command to generate TESTDB file from console +
- +
-<​code>​htpasswd -c /​PATH_YOU_WANT/​TESTDB TEST</​code>​ +
- +
-Then enter password (e.g.TEST) two times +
- +
-===== Protect site by adding auth require ===== +
-===== Method 1. Through ​Context=====+
 Add a Context and select type as ''​Static''​ Add a Context and select type as ''​Static''​
  
 Set: Set:
-  - URI ''/''​ +  - **URI** ''/''​ 
-  - Set Location ''​$VH_ROOT/​html/''​ +  - **Location** ''​$VH_ROOT/​html/''​ 
-  - Accessible ''​Yes''​ +  - **Accessible** ''​Yes''​ 
-  - Realm ''​TEST''​ +  - **Realm** ''​TEST''​ 
-  - Access Allowed ''​*''​+  - **Access Allowed** ''​*''​
 {{:​litespeed_wiki:​config:​realm-8.png?​|}} {{:​litespeed_wiki:​config:​realm-8.png?​|}}
 {{:​litespeed_wiki:​config:​realm-9.png?​|}} {{:​litespeed_wiki:​config:​realm-9.png?​|}}
  
-===== Method 2. Through .htaccess===== +=====Method 2. Setup By Hand ===== 
-Add following rules into your .htaccess file.+====Step1. Create Account ​Through ​htpasswd ==== 
 +Run the following command to generate ''​TESTDB''​ file from console: 
 + 
 +<​code>​htpasswd -c /​PATH_YOU_WANT/​TESTDB TEST</​code>​ 
 + 
 +Then enter the password (e.g.''​TEST''​) two times. 
 + 
 +==== Step 2. Add Access Require by htaccess==== 
 +Add the following rules into your .htaccess file.
 <​code>​ <​code>​
 AuthType Basic AuthType Basic
Line 50: Line 49:
 Require valid-user Require valid-user
 </​code>​ </​code>​
-  ​AuthName can be set to any, e.g. ''​TEST''​ +  ​* ''​AuthName'' ​can be set to anything, e.g. ''​TEST''​ 
-  ​AuthUserFile ​need a valid file, e.g.''/​usr/​local/​lsws/​DEFAULT/​conf/​TESTDB''​+  ​* ''​AuthUserFile''​ needs a valid file, e.g.''/​usr/​local/​lsws/​DEFAULT/​conf/​TESTDB''​
  
 ===== How to Verify ===== ===== How to Verify =====
-Access the site will require ​auth login +Access the site. It will require ​an authorized ​login
  
 {{:​litespeed_wiki:​config:​realm-10.png?​|}} {{:​litespeed_wiki:​config:​realm-10.png?​|}}
  • Admin
  • Last modified: 2020/09/16 17:42
  • by Lisa Clarke