[Resolved] Directory indexing

Status
Not open for further replies.
#1
Hi,

Please let me know the how to enable the directory indexing in lite speed. I have turned on the file index option in the litespeed admin console, but it doesn't works. Also, it's working fine with apache.

----
Litespeed version: LiteSpeed/5.0.18
-----

Any suggestion on this?
 
#3
Hello,

We are getting the following apache error while accessing the page.
Code:
2016-08-18 16:45:42.019 [NOTICE] [XX.XX.XX.XX:59594] [STDERR] PHP Warning:  opendir(/home/ihome/public_html/test/): failed to open dir: No such file or directory in /usr/local/lib/php/autoindex/default.php on line 143
Note that the folder "/home/ihome/public_html/test/" already exist in the server. We have checked and verified that. There are no permissions/ownership issue as we have already tested this with full permission and even with nobody permission.
Code:
drwxr-xr-x 2 ihome nobody 4096 Aug 18 18:09 /home/ihome/www/test/
This is a Cpanel Server and Could you please check and let us know if we missed any thing.

Regards,
Matthew
 
Last edited by a moderator:
#5
Hello,
Yes, Nobody user can view the directory.
Code:
root@amethyst [/home/ihome/www/test]# sudo -u nobody ls -ald /home/ihome/www/test/
drwxr-xr-x 2 ihome nobody 4096 Aug 18 18:09 /home/ihome/www/test/
root@amethyst [/home/ihome/www/test]#
Regards,
Matthew
 
Last edited by a moderator:
L

Long

Guest
#6
Hi, Matthew,

How about if you turn off the open dir?

We'll analyze further based on the result.
 
#7
Hello,

The page goes to a 404 error page when open dir(Directory Indexing) is turned off.
404
Not Found
The resource requested could not be found on this server!
Please advise further.

Regards,
Liam
 
Last edited by a moderator:
#9
Hi,

Thank you for your update.

We have tried this and seems to be still it's not working.

Already 'Enable php open_basedir Protection' is enabled in the WHM, also not 'Exclude Protection' any host or domain name.

Regards,
Gary
 
#10
please switch between apache and litespeed, visit a phpinfo page, and compare open_basedir value.

if under apache, it's "no value"; but under litespeed, it's not empty, then lsphp not match with php under apache,

to be more clear, what the blog suggest is to disable open_basedir in WHM, or check 'Exclude Protection" on the problem domain.
 
#11
Hi,

We have switched between Apache and Litespeed web servers.

While checking in phpinfo page we could see that in both cases the value of 'open_basedir' shows as "no value".

Regards,
Gary
 
L

Long

Guest
#12
Hi,

Can you turn on the web server debug log an see what message it says when you visit the test url?
 
#13
Hi,

We have tried with changing web server LogLevel from warn to debug and checked the url. But its still showing the below error
Code:
2016-08-20 07:45:59.794 [NOTICE] [XX.XX.XX.XX:50504] [STDERR] PHP Warning:  opendir(/home/ihome/public_html/test/): failed to open dir: No such file or directory in /usr/local/lib/php/autoindex/default.php on line 143
Regards,
Edward
 
Last edited by a moderator:
#18
finally found the root cause ...
at server level lsphp5 configuration:
suEXEC User: joramriv
suEXEC Group: joramriv
default value is empty.

change back to default value, the error is gone.

this can explain why:
Code:
2016-08-20 07:45:59.794 [NOTICE] [XX.XX.XX.XX:50504] [STDERR] PHP Warning: opendir(/home/ihome/public_html/test/): failed to open dir: No such file or directory in /usr/local/lib/php/autoindex/default.php on line 143
because lsphp5 running as user "joramriv:joramriv" thus can't open /home/ihome/public_html/test/ or /home/ihome/*

lesson learned: don't change some lsws default value unless you know what you're doing exactly; audit default values changes carefully if have to change those default values.
 
Last edited by a moderator:
Status
Not open for further replies.
Top