index files issues

#1
Hello,

I recently installed OpenLiteSpeed and CyberPanel on AlmaLinux OS 8 (64-bit)
  • OpenLiteSpeed 1.7.18
  • CyberPanel Ver.: 2.3 | Build: 4
Try to active Index Files from mydomain:7080 as below:



But when opening mydomain.com/Test it shows the below error:

HTML:
This page isn’t working

**mydomain.com** is currently unable to handle this request.

HTTP ERROR 500

Also, I created file.html (mydomain.com/Test/index.html), to test and I can see it without any issues.
Try also steps in this article but nothing.

Any suggestions to resolve this issue?

Thanks in advance.
 
#3
Please share the output of "/usr/local/lsws/logs/error.log" while getting the 500 error.
Thanks @Cold-Egg for your message, please see the below logs:

2023-11-02 09:38:33.322943 [NOTICE] [126035] [51.39.227.95:17470:HTTP2-1#domain.com] [STDERR] PHP Warning: Unknown: open_basedir restriction in effect. File(/usr/local/lsws/share/autoindex/default.php) is not within the allowed path(s): (/tmp:/home/domain.com/) in Unknown on line 0
2023-11-02 09:38:33.323003 [NOTICE] [126035] [51.39.227.95:17470:HTTP2-1#domain.com] [STDERR] PHP Warning: Unknown: Failed to open stream: Operation not permitted in Unknown on line 0
2023-11-02 09:38:33.323018 [NOTICE] [126035] [51.39.227.95:17470:HTTP2-1#domain.com] [STDERR] PHP Warning: Unknown: open_basedir restriction in effect. File(/usr/local/lsws/share/autoindex/default.php) is not within the allowed path(s): (/tmp:/home/domain.com/) in Unknown on line 0
2023-11-02 09:38:33.323029 [NOTICE] [126035] [51.39.227.95:17470:HTTP2-1#domain.com] [STDERR] PHP Warning: Unknown: Failed to open stream: Operation not permitted in Unknown on line 0
2023-11-02 09:38:33.323041 [NOTICE] [126035] [51.39.227.95:17470:HTTP2-1#domain.com] [STDERR] PHP Fatal error: Failed opening required '/usr/local/lsws/share/autoindex/default.php' (include_path='.:/usr/local/lsws/lsphp81/share/pear:/usr/local/lsws/lsphp81/share/php:/usr/share/pear:/usr/share/php') in Unknown on line 0
2023-11-02 09:38:38.322988 [NOTICE] [126035] [51.39.227.95:17470:HTTP2-5#domain.com] [STDERR] PHP Warning: Unknown: open_basedir restriction in effect. File(/usr/local/lsws/share/autoindex/default.php) is not within the allowed path(s): (/tmp:/home/domain.com/) in Unknown on line 0
2023-11-02 09:38:38.323022 [NOTICE] [126035] [51.39.227.95:17470:HTTP2-5#domain.com] [STDERR] PHP Warning: Unknown: Failed to open stream: Operation not permitted in Unknown on line 0
2023-11-02 09:38:38.323034 [NOTICE] [126035] [51.39.227.95:17470:HTTP2-5#domain.com] [STDERR] PHP Warning: Unknown: open_basedir restriction in effect. File(/usr/local/lsws/share/autoindex/default.php) is not within the allowed path(s): (/tmp:/home/domain.com/) in Unknown on line 0
2023-11-02 09:38:38.323046 [NOTICE] [126035] [51.39.227.95:17470:HTTP2-5#domain.com] [STDERR] PHP Warning: Unknown: Failed to open stream: Operation not permitted in Unknown on line 0
2023-11-02 09:38:38.323057 [NOTICE] [126035] [51.39.227.95:17470:HTTP2-5#domain.com] [STDERR] PHP Fatal error: Failed opening required '/usr/local/lsws/share/autoindex/default.php' (include_path='.:/usr/local/lsws/lsphp81/share/pear:/usr/local/lsws/lsphp81/share/php:/usr/share/pear:/usr/share/php') in Unknown on line 0
2023-11-02 10:06:32.530613 [INFO] [126035] [backu1302.655340]: locked pid file [/tmp/lshttpd/backu1302.sock.pid].
2023-11-02 10:06:32.530639 [INFO] [126035] [backu1302.655340] remove unix socket for detached process: /tmp/lshttpd/backu1302.sock
2023-11-02 10:06:32.530746 [NOTICE] [126035] [LocalWorker::workerExec] VHost:domain.com suExec check uid 65534 gid 65534 setuidmode 0.
2023-11-02 10:06:32.530762 [NOTICE] [126035] [LocalWorker::workerExec] Config[backu1302.655340]: suExec uid 5002 gid 5002 cmd /usr/local/lsws/lsphp81/bin/lsphp, final uid 5002 gid 5002, flags: 0.
2023-11-02 10:06:32.537411 [NOTICE] [126035] [backu1302.655340] add child process pid: 141743
2023-11-02 10:06:32.537493 [INFO] [126035] [backu1302.655340]: unlocked pid file [/tmp/lshttpd/backu1302.sock.pid].
2023-11-02 10:06:32.718944 [NOTICE] [126035] [205.169.39.194:55966#domain.com] [STDERR] PHP Warning: Unknown: open_basedir restriction in effect. File(/usr/local/lsws/share/autoindex/default.php) is not within the allowed path(s): (/tmp:/home/domain.com/) in Unknown on line 0
2023-11-02 10:06:32.719024 [NOTICE] [126035] [205.169.39.194:55966#domain.com] [STDERR] PHP Warning: Unknown: Failed to open stream: Operation not permitted in Unknown on line 0
2023-11-02 10:06:32.719153 [NOTICE] [126035] [205.169.39.194:55966#domain.com] [STDERR] PHP Warning: Unknown: open_basedir restriction in effect. File(/usr/local/lsws/share/autoindex/default.php) is not within the allowed path(s): (/tmp:/home/domain.com/) in Unknown on line 0
2023-11-02 10:06:32.719223 [NOTICE] [126035] [205.169.39.194:55966#domain.com] [STDERR] PHP Warning: Unknown: Failed to open stream: Operation not permitted in Unknown on line 0
2023-11-02 10:06:32.719276 [NOTICE] [126035] [205.169.39.194:55966#domain.com] [STDERR] PHP Fatal error: Failed opening required '/usr/local/lsws/share/autoindex/default.php' (include_path='.:/usr/local/lsws/lsphp81/share/pear:/usr/local/lsws/lsphp81/share/php:/usr/share/pear:/usr/share/php') in Unknown on line 0
2023-11-02 10:08:10.334455 [NOTICE] [126035] [65.154.226.166:37306#domain.com] [STDERR] PHP Warning: Unknown: open_basedir restriction in effect. File(/usr/local/lsws/share/autoindex/default.php) is not within the allowed path(s): (/tmp:/home/domain.com/) in Unknown on line 0
2023-11-02 10:08:10.334497 [NOTICE] [126035] [65.154.226.166:37306#domain.com] [STDERR] PHP Warning: Unknown: Failed to open stream: Operation not permitted in Unknown on line 0
2023-11-02 10:08:10.334510 [NOTICE] [126035] [65.154.226.166:37306#domain.com] [STDERR] PHP Warning: Unknown: open_basedir restriction in effect. File(/usr/local/lsws/share/autoindex/default.php) is not within the allowed path(s): (/tmp:/home/domain.com/) in Unknown on line 0
2023-11-02 10:08:10.334522 [NOTICE] [126035] [65.154.226.166:37306#domain.com] [STDERR] PHP Warning: Unknown: Failed to open stream: Operation not permitted in Unknown on line 0
2023-11-02 10:08:10.334535 [NOTICE] [126035] [65.154.226.166:37306#domain.com] [STDERR] PHP Fatal error: Failed opening required '/usr/local/lsws/share/autoindex/default.php' (include_path='.:/usr/local/lsws/lsphp81/share/pear:/usr/local/lsws/lsphp81/share/php:/usr/share/pear:/usr/share/php') in Unknown on line 0
2023-11-02 10:23:48.370019 [INFO] [126035] [backu1302.655340]: locked pid file [/tmp/lshttpd/backu1302.sock.pid].
2023-11-02 10:23:48.370046 [INFO] [126035] [backu1302.655340] remove unix socket for detached process: /tmp/lshttpd/backu1302.sock
2023-11-02 10:23:48.370185 [NOTICE] [126035] [LocalWorker::workerExec] VHost:domain.com suExec check uid 65534 gid 65534 setuidmode 0.
2023-11-02 10:23:48.370205 [NOTICE] [126035] [LocalWorker::workerExec] Config[backu1302.655340]: suExec uid 5002 gid 5002 cmd /usr/local/lsws/lsphp81/bin/lsphp, final uid 5002 gid 5002, flags: 0.
2023-11-02 10:23:48.377665 [NOTICE] [126035] [backu1302.655340] add child process pid: 142174
2023-11-02 10:23:48.377759 [INFO] [126035] [backu1302.655340]: unlocked pid file [/tmp/lshttpd/backu1302.sock.pid].
2023-11-02 10:23:48.563372 [NOTICE] [126035] [51.39.227.95:13341-Q:DBE07F8568025429-0#domain.com] [STDERR] PHP Warning: Unknown: open_basedir restriction in effect. File(/usr/local/lsws/share/autoindex/default.php) is not within the allowed path(s): (/tmp:/home/domain.com/) in Unknown on line 0
2023-11-02 10:23:48.563447 [NOTICE] [126035] [51.39.227.95:13341-Q:DBE07F8568025429-0#domain.com] [STDERR] PHP Warning: Unknown: Failed to open stream: Operation not permitted in Unknown on line 0
2023-11-02 10:23:48.563565 [NOTICE] [126035] [51.39.227.95:13341-Q:DBE07F8568025429-0#domain.com] [STDERR] PHP Warning: Unknown: open_basedir restriction in effect. File(/usr/local/lsws/share/autoindex/default.php) is not within the allowed path(s): (/tmp:/home/domain.com/) in Unknown on line 0
2023-11-02 10:23:48.563620 [NOTICE] [126035] [51.39.227.95:13341-Q:DBE07F8568025429-0#domain.com] [STDERR] PHP Warning: Unknown: Failed to open stream: Operation not permitted in Unknown on line 0
2023-11-02 10:23:48.563719 [NOTICE] [126035] [51.39.227.95:13341-Q:DBE07F8568025429-0#domain.com] [STDERR] PHP Fatal error: Failed opening required '/usr/local/lsws/share/autoindex/default.php' (include_path='.:/usr/local/lsws/lsphp81/share/pear:/usr/local/lsws/lsphp81/share/php:/usr/share/pear:/usr/share/php') in Unknown on line 0
2023-11-02 10:23:53.630550 [NOTICE] [126035] [51.39.227.95:13341-Q:DBE07F8568025429-4#domain.com] [STDERR] PHP Warning: Unknown: open_basedir restriction in effect. File(/usr/local/lsws/share/autoindex/default.php) is not within the allowed path(s): (/tmp:/home/domain.com/) in Unknown on line 0
2023-11-02 10:23:53.630681 [NOTICE] [126035] [51.39.227.95:13341-Q:DBE07F8568025429-4#domain.com] [STDERR] PHP Warning: Unknown: Failed to open stream: Operation not permitted in Unknown on line 0
2023-11-02 10:23:53.630860 [NOTICE] [126035] [51.39.227.95:13341-Q:DBE07F8568025429-4#domain.com] [STDERR] PHP Warning: Unknown: open_basedir restriction in effect. File(/usr/local/lsws/share/autoindex/default.php) is not within the allowed path(s): (/tmp:/home/domain.com/) in Unknown on line 0
2023-11-02 10:23:53.630959 [NOTICE] [126035] [51.39.227.95:13341-Q:DBE07F8568025429-4#domain.com] [STDERR] PHP Warning: Unknown: Failed to open stream: Operation not permitted in Unknown on line 0
2023-11-02 10:23:53.631040 [NOTICE] [126035] [51.39.227.95:13341-Q:DBE07F8568025429-4#domain.com] [STDERR] PHP Fatal error: Failed opening required '/usr/local/lsws/share/autoindex/default.php' (include_path='.:/usr/local/lsws/lsphp81/share/pear:/usr/local/lsws/lsphp81/share/php:/usr/share/pear:/usr/share/php') in Unknown on line 0
2023-11-02 10:26:54.246243 [NOTICE] [126035] [51.39.227.95:10773:HTTP2-3#domain.com] [STDERR] PHP Warning: Unknown: open_basedir restriction in effect. File(/usr/local/lsws/share/autoindex/default.php) is not within the allowed path(s): (/tmp:/home/domain.com/) in Unknown on line 0
2023-11-02 10:26:54.246282 [NOTICE] [126035] [51.39.227.95:10773:HTTP2-3#domain.com] [STDERR] PHP Warning: Unknown: Failed to open stream: Operation not permitted in Unknown on line 0
2023-11-02 10:26:54.246296 [NOTICE] [126035] [51.39.227.95:10773:HTTP2-3#domain.com] [STDERR] PHP Warning: Unknown: open_basedir restriction in effect. File(/usr/local/lsws/share/autoindex/default.php) is not within the allowed path(s): (/tmp:/home/domain.com/) in Unknown on line 0
2023-11-02 10:26:54.246308 [NOTICE] [126035] [51.39.227.95:10773:HTTP2-3#domain.com] [STDERR] PHP Warning: Unknown: Failed to open stream: Operation not permitted in Unknown on line 0
2023-11-02 10:26:54.246320 [NOTICE] [126035] [51.39.227.95:10773:HTTP2-3#domain.com] [STDERR] PHP Fatal error: Failed opening required '/usr/local/lsws/share/autoindex/default.php' (include_path='.:/usr/local/lsws/lsphp81/share/pear:/usr/local/lsws/lsphp81/share/php:/usr/share/pear:/usr/share/php') in Unknown on line 0
2023-11-02 10:27:06.697247 [NOTICE] [126035] [51.39.227.95:2383-Q:16B73E9B353B28DB-0#domain.com] [STDERR] PHP Warning: Unknown: open_basedir restriction in effect. File(/usr/local/lsws/share/autoindex/default.php) is not within the allowed path(s): (/tmp:/home/domain.com/) in Unknown on line 0
2023-11-02 10:27:06.697288 [NOTICE] [126035] [51.39.227.95:2383-Q:16B73E9B353B28DB-0#domain.com] [STDERR] PHP Warning: Unknown: Failed to open stream: Operation not permitted in Unknown on line 0
2023-11-02 10:27:06.697302 [NOTICE] [126035] [51.39.227.95:2383-Q:16B73E9B353B28DB-0#domain.com] [STDERR] PHP Warning: Unknown: open_basedir restriction in effect. File(/usr/local/lsws/share/autoindex/default.php) is not within the allowed path(s): (/tmp:/home/domain.com/) in Unknown on line 0
2023-11-02 10:27:06.697315 [NOTICE] [126035] [51.39.227.95:2383-Q:16B73E9B353B28DB-0#domain.com] [STDERR] PHP Warning: Unknown: Failed to open stream: Operation not permitted in Unknown on line 0
2023-11-02 10:27:06.697327 [NOTICE] [126035] [51.39.227.95:2383-Q:16B73E9B353B28DB-0#domain.com] [STDERR] PHP Fatal error: Failed opening required '/usr/local/lsws/share/autoindex/default.php' (include_path='.:/usr/local/lsws/lsphp81/share/pear:/usr/local/lsws/lsphp81/share/php:/usr/share/pear:/usr/share/php') in Unknown on line 0
2023-11-02 10:27:24.071648 [NOTICE] [126035] [51.39.227.95:2383-Q:16B73E9B353B28DB-4#domain.com] [STDERR] PHP Warning: Unknown: open_basedir restriction in effect. File(/usr/local/lsws/share/autoindex/default.php) is not within the allowed path(s): (/tmp:/home/domain.com/) in Unknown on line 0
2023-11-02 10:27:24.071687 [NOTICE] [126035] [51.39.227.95:2383-Q:16B73E9B353B28DB-4#domain.com] [STDERR] PHP Warning: Unknown: Failed to open stream: Operation not permitted in Unknown on line 0
2023-11-02 10:27:24.071700 [NOTICE] [126035] [51.39.227.95:2383-Q:16B73E9B353B28DB-4#domain.com] [STDERR] PHP Warning: Unknown: open_basedir restriction in effect. File(/usr/local/lsws/share/autoindex/default.php) is not within the allowed path(s): (/tmp:/home/domain.com/) in Unknown on line 0
2023-11-02 10:27:24.071711 [NOTICE] [126035] [51.39.227.95:2383-Q:16B73E9B353B28DB-4#domain.com] [STDERR] PHP Warning: Unknown: Failed to open stream: Operation not permitted in Unknown on line 0
2023-11-02 10:27:24.071723 [NOTICE] [126035] [51.39.227.95:2383-Q:16B73E9B353B28DB-4#domain.com] [STDERR] PHP Fatal error: Failed opening required '/usr/local/lsws/share/autoindex/default.php' (include_path='.:/usr/local/lsws/lsphp81/share/pear:/usr/local/lsws/lsphp81/share/php:/usr/share/pear:/usr/share/php') in Unknown on line 0
2023-11-02 10:27:24.881751 [NOTICE] [126035] [51.39.227.95:2383-Q:16B73E9B353B28DB-8#domain.com] [STDERR] PHP Warning: Unknown: open_basedir restriction in effect. File(/usr/local/lsws/share/autoindex/default.php) is not within the allowed path(s): (/tmp:/home/domain.com/) in Unknown on line 0
2023-11-02 10:27:24.881783 [NOTICE] [126035] [51.39.227.95:2383-Q:16B73E9B353B28DB-8#domain.com] [STDERR] PHP Warning: Unknown: Failed to open stream: Operation not permitted in Unknown on line 0
2023-11-02 10:27:24.881794 [NOTICE] [126035] [51.39.227.95:2383-Q:16B73E9B353B28DB-8#domain.com] [STDERR] PHP Warning: Unknown: open_basedir restriction in effect. File(/usr/local/lsws/share/autoindex/default.php) is not within the allowed path(s): (/tmp:/home/domain.com/) in Unknown on line 0
2023-11-02 10:27:24.881805 [NOTICE] [126035] [51.39.227.95:2383-Q:16B73E9B353B28DB-8#domain.com] [STDERR] PHP Warning: Unknown: Failed to open stream: Operation not permitted in Unknown on line 0
2023-11-02 10:27:24.881816 [NOTICE] [126035] [51.39.227.95:2383-Q:16B73E9B353B28DB-8#domain.com] [STDERR] PHP Fatal error: Failed opening required '/usr/local/lsws/share/autoindex/default.php' (include_path='.:/usr/local/lsws/lsphp81/share/pear:/usr/local/lsws/lsphp81/share/php:/usr/share/pear:/usr/share/php') in Unknown on line 0
2023-11-02 10:27:25.266629 [NOTICE] [126035] [51.39.227.95:2383-Q:16B73E9B353B28DB-12#domain.com] [STDERR] PHP Warning: Unknown: open_basedir restriction in effect. File(/usr/local/lsws/share/autoindex/default.php) is not within the allowed path(s): (/tmp:/home/domain.com/) in Unknown on line 0
2023-11-02 10:27:25.266658 [NOTICE] [126035] [51.39.227.95:2383-Q:16B73E9B353B28DB-12#domain.com] [STDERR] PHP Warning: Unknown: Failed to open stream: Operation not permitted in Unknown on line 0
2023-11-02 10:27:25.266669 [NOTICE] [126035] [51.39.227.95:2383-Q:16B73E9B353B28DB-12#domain.com] [STDERR] PHP Warning: Unknown: open_basedir restriction in effect. File(/usr/local/lsws/share/autoindex/default.php) is not within the allowed path(s): (/tmp:/home/domain.com/) in Unknown on line 0
2023-11-02 10:27:25.266680 [NOTICE] [126035] [51.39.227.95:2383-Q:16B73E9B353B28DB-12#domain.com] [STDERR] PHP Warning: Unknown: Failed to open stream: Operation not permitted in Unknown on line 0
2023-11-02 10:27:25.266690 [NOTICE] [126035] [51.39.227.95:2383-Q:16B73E9B353B28DB-12#domain.com] [STDERR] PHP Fatal error: Failed opening required '/usr/local/lsws/share/autoindex/default.php' (include_path='.:/usr/local/lsws/lsphp81/share/pear:/usr/local/lsws/lsphp81/share/php:/usr/share/pear:/usr/share/php') in Unknown on line 0
Also, I configured the DNS in CP and added the API for Cloudflare as below:
 
#4
======= Updated

1- I re-install OS + CyberPanel + OLS and followed the steps in the above
2- Remove "/usr/local/lsws/logs/error.log"
3- Reboot the server.
4- Open the "domain.com/Test" to attache full "error.log"

Please find the "error.log" attached
 

Attachments

Last edited:
#6
Let us know if it works.
Thanks @Cold-Egg
Working with me :)

Now I created 2 folders under /public_htm/.. (a and b)
Next login to OLS --> Virtual Host --> mydomain --> Security
And created "Realm" for 2 directory as below:

1699304138283.png
1699303470221.png
Then create a different user from "User DB location" for A and B.
After that open Context creates new static and chooses Realm for each one created in the first step


1699336544546.png

Now when opening mydomain/a required user/password is created and Realm (A) accepts the user and password created for A only
When trying to open mydomain/b also requires a user/password but accepts user&pass ( A and B )

And if I open mydomain/a or /b and put user&pass for A and open a new tab mydomain/b or a open it without asking for user&pass

Can support for this issue
 
Last edited:
#7
======= Updated

Now security working with me when logging to mydomain.com/a or /b requires user&pass for each directory.

But I have 2 issues:
1- When login to the main domain mydomain.com requires user&pass and accepts only user&pass for directory /a.
I need the main domain open without requiring user&pass

2- When opening any directory /a or /b and putting user&pass and closing the browser then reopening it opens directly without asking for the user&pass
-----------------------

The below is what I updated to work with me:

Security ---> Realm and create user&pass for each Realm as below:

1699475730724.png

Then in the Context create 2 URI /a and /b and give for each Realm and Require (Authorized Users/Groups) created in the Realm above

1699476075465.png
 

Cold-Egg

Administrator
#8
Since you have /a and /b contexts, it should not make the main domain require to input user&pass. Please try to visit it on an incognito browser. If it's reproducible, please submit the issue to support@litespeedtech.com with forum post link appended.
 
Top