How to restrict a directory from being accessed with LSWS

Launch the LiteSpeed console and log in using your admin credentials. If you can't remember the login details for the LiteSpeed console, you can easily reset the password by executing the following command line:

sh /usr/local/lsws/admin/misc/admpass.sh

After successfully logging into the LiteSpeed console, navigate to the "Virtual Hosts" section and locate the configuration of the virtual host you wish to modify.

In the virtual host configuration, select the "Context" option, as shown in the attached screenshot.

Click on the "Add" button (Symbol: +) to create a new context.

Make sure to choose the "Static" type and proceed to the next step.

Enter the appropriate URL and select the desired accessible mode, referring to the screenshot for guidance. Save the changes once you're done.

To apply the modifications, gracefully reboot the LiteSpeed server.

Once the server has rebooted, your changes will be in effect. You have now completed the process.

  • 1 Users Found This Useful
Was this answer helpful?

Related Articles

How to install LiteSpeed Web Server in cPanel?

Run the following command to install the LSWS plugin in cPanel: cd /usr/local/srcwget -N...

How to uninstall LiteSpeed on cPanel web server?

To uninstall LiteSpeed Web Server, perform the following steps: As the root user, convert your...

Apache Fails With "Syntax error on line #" on Server?

If you had an Apache/LiteSpeed-powered web server, you might see such an error that the HTTPD...

404 Not Found Error on All Websites (CyberPanel)

Make sure to check your website without HTTPS. If your website is accessible with HTTP and can't...

How can you Switch to Apache from LiteSpeed?

Apache and Litespeed are web servers. Both of them are good in their own ways and both of them do...