LiteSpeed with cPanel and Directory listing (404 vs 403 error)

#1
Hi. My goal is to disable directory listing globally on a cPanel server with Litespeed. I've configured following settings on a server to make this possible:

- directory listing disabled in apache global config on cpanel
- Auto Index set to NO in litespeed server general config
- added "Options -Indexes" on the bottom of server general config in "Apache Style Configurations" section.

Directory listing seems to be disabled, but when visiting eg. empty folder, LS serves 404 error, compared to the same cPanel server with apache, which serves 403.

If I create local .htaccess file and put "Options -Indexes" inside, then LS also serves 403 when I visit an empty dir. What else am I missing? Is returned 404 expected behaviour, or is configuration "Apache Style Configurations" simply ignored?
 

NiteWave

Administrator
#2
how about editing /etc/apache2/conf.d/userdata/lscache_vhosts.conf
adding
Options -Indexes
i.e.
Code:
<IfModule Litespeed>
CacheRoot lscache
Options -Indexes
</IfModule>
 
#3
Hmm, I tried similar thing it by adding custom file, /etc/apache2/conf.d/userdata/disable.conf

Content of the file:
Code:
Options -Indexes
then i rebuilt the config and restarted litespeed, with no success (still 404). Will try it your way now.
 
#4
how about editing /etc/apache2/conf.d/userdata/lscache_vhosts.conf
adding
Options -Indexes
i.e.
Code:
<IfModule Litespeed>
CacheRoot lscache
Options -Indexes
</IfModule>
Unfortunately it didn't help even when I moved "Options -Indexes" to /etc/apache2/conf.d/userdata/lscache_vhosts.conf like you suggested.
 
#6
@speedoflite

Options -Indexes works in document_root only and can't be defined on server level, but you try to add this to -Indexes part of httpd.conf
Hi, I'm not sure I understand you correctly, but "Options -Indexes" can be defined globally, what do you mean it can't? Here's another topic on this issue someone had in 2019: https://www.litespeedtech.com/suppo...-403-error-when-auto-index-is-disabled.17988/. The only difference is that configuration he used isn't working for me.
 

Pong

Administrator
Staff member
#7
"Options -Indexes" should work, maybe you enable it back from virtual host or from .htaccess. You can log a ticket and provide login. We can check for you.
 
Top