OpenLiteSpeed not accepting valid login credentials for basic authentication setup using realm

By Atif

February 17, 2026

Fixed OpenLiteSpeed basic authentication issue

You will learn how to fix one of the Basic Authentication issues on OLS

I had setup basic authentication for staging site over a year ago which was working fine until I made few changes on the virtual host deleting and recreating the realm.

After I made the changes I couldn’t access my website even with the correct user and password that was working just fine before I fiddled with the virtual host settings in the OLS admin.

I went through the Basic Authentication with Realms guide few time to make sure I was doing everything right but still it won’t let me through.

I searched the internet and but couldn’t find anything to pin point the issue – everything (location of the htpasswd file, permission and ownership of the htpasswd file) seemed to be setup correctly.

I had a hunch that it could be permission/ownership issue so I started checking the parent folders and I found out that the directory group of the website directory (example.com) under the vhosts directory was set to lsadm unlike nogroup for other website directories listed under vhosts directory.

Location of the htpasswd file listed below for reference.

/usr/local/lsws/conf/vhosts/example.com/htpasswd

See how other sites have nogroup assigned as the group.

root@ExampleStagingServer:/usr/local/lsws/conf/vhosts# ls -al
total 20
drwxr-x--- 5 lsadm nogroup 4096 Feb 16 04:09 .
drwxr-x--- 5 lsadm nogroup 4096 Feb 16 04:09 ..
drwxr-x--- 2 lsadm nogroup 4096 Jan 30 21:14 sample.com
drwxr-x--- 2 lsadm lsadm 4096 Feb 17 05:16 example.com
drwxr-x--- 2 lsadm nogroup 4096 Jan 24  2025 hello.com

So I changed the group owner of the example.com directory to nogroup to match other sites and it fixed the issue.

Command to change group is listed below.

cd /usr/local/lsws/conf/vhosts
chgrp nogroup example.com

Hey! how u doing 🙂