Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
litespeed_wiki:config:authenticate [2018/06/15 16:17] Eric Leu |
litespeed_wiki:config:authenticate [2018/06/15 20:59] Jonathan Kagan [How to set Site Authentication] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== How to set Access site Authentication ===== | + | ====== How to set Site Authentication ====== |
- | ==== Method 1. Through realm==== | + | 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 Web Console and By Hand are interchangeable, you can manually create a database file and load it via the WebConsole and vice versa. |
- | === Step 1.Create Authorization Realms DB === | + | =====Method 1. Setup by Web GUI ===== |
+ | ==== Step 1.Create Authorization Realms DB ==== | ||
We will create a new one as example | We will create a new one as example | ||
Line 15: | Line 16: | ||
{{: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 e.g. User/Password TEST/TEST | ||
{{:litespeed_wiki:config:realm-6.png?|}} | {{:litespeed_wiki:config:realm-6.png?|}} | ||
- | ===Step 3. Create Context === | + | ==== Step 3. Add Access Require by Context==== |
- | Select type as ''Static'' | + | Add a Context and select type as ''Static'' |
Set: | Set: | ||
- URI ''/'' | - URI ''/'' | ||
Line 31: | Line 33: | ||
{{:litespeed_wiki:config:realm-9.png?|}} | {{:litespeed_wiki:config:realm-9.png?|}} | ||
- | ==== How to Verify ==== | + | =====Method 2. Setup By Hand ===== |
+ | ====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 password (e.g.TEST) two times | ||
+ | |||
+ | ==== Step 2. Add Access Require by htaccess==== | ||
+ | Add 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 any, e.g. ''TEST'' | ||
+ | * AuthUserFile need a valid file, e.g.''/usr/local/lsws/DEFAULT/conf/TESTDB'' | ||
+ | |||
+ | ===== How to Verify ===== | ||
Access the site will require auth login | Access the site will require auth login | ||
{{:litespeed_wiki:config:realm-10.png?|}} | {{:litespeed_wiki:config:realm-10.png?|}} |