Differences

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

Link to this comparison view

Both sides previous revision Previous revision
litespeed_wiki:config:authenticate [2020/09/16 17:42]
Lisa Clarke Added permissions line
litespeed_wiki:config:authenticate [2025/06/03 18:28] (current)
Lisa Clarke Redirect to new Documentation Site
Line 1: Line 1:
-====== How to Set Site Authentication ====== +~~REDIRECT>​https://docs.litespeedtech.com/lsws/security/#set-up-site-authentication~~
-Authentication is the process of confirming a user's identity, and it provides a way to ensure that only legitimate users can 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, or vice versa. +
-=====Method 1. Set up by Web GUI ===== +
-==== Step 1.Create Authorization Realms DB ==== +
-We will create a new one as an example. +
- +
-{{:litespeed_wiki:​config:​realm-1.png?​800|}} +
- +
-Set **DB Type** to ''​Password File''​. +
- +
-{{:​litespeed_wiki:​config:​realm-2.png?​|}} +
- +
-Set: +
-  - **Realm name**, e.g. ''​TEST''​ +
-  - **DB Location**, e.g. ''​$VH_ROOT/conf/TESTDB''​ +
-{{:​litespeed_wiki:​config:​realm-7.png?​800|}} +
- +
-==== Step 2.Create Auth User ==== +
-Set **User**/**Password**,​ e.g. ''​TEST''​/''​TEST''​  +
- +
-{{:​litespeed_wiki:​config:​realm-6.png?​|}} +
- +
-==== Step 3. Add Access Require by Context==== +
-Add a Context and select type as ''​Static''​ +
- +
-Set: +
-  - **URI** ''​/''​ +
-  ​**Location** ''​$VH_ROOT/​html/''​ +
-  - **Accessible** ''​Yes''​ +
-  - **Realm** ''​TEST''​ +
-  - **Access Allowed** ''​*''​ +
-{{:​litespeed_wiki:​config:​realm-8.png?​|}} +
-{{:​litespeed_wiki:​config:​realm-9.png?​|}} +
- +
-=====Method 2. Set up By Hand ===== +
-====Step1. Create Account Through htpasswd ==== +
-Run the following command to generate ''​TESTDB''​ file from console, making sure this file and its parent directory are both readable for the web server user (typically ''​nobody''​ or ''​apache''​):​ +
- +
-<​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>​ +
-AuthType Basic +
-AuthName "My Protected Area"​ +
-AuthUserFile /​path/​to/​.htpasswd +
-Require valid-user +
-</​code>​ +
-  * ''​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:​realm-10.png?|}}+
  • Admin
  • Last modified: 2025/06/03 18:28
  • by Lisa Clarke