Litespeed - default error pages cannot be found

serpent_driver

Active Member
Aug 1, 2019
29
7
8
Home
cPanel Access Level
Root Administrator
Hello cPanel,

before I opened this thread I already asked Litespeed for support, but they can't find something on my server that is Litespeed responsible for. So, they asked me to contact cPanel.

For all of my applications I have custom error pages. This works, but if there are no error pages defined error_log has additional entries for each error because *.shtml file cannot be found. All related configurations to error pages and much more are default. This issue happens with Litespeed AND if switched to Apache.

Michael



error_log
Code:
2020-04-08 08:36:01.061306 [INFO] [5834] [xxx.xxx.xxx.xxx:50562:HTTP2-19#APVH_docs.account.de:443] File not found [/home/account/public_html/docs/403.shtml]
2020-04-08 08:36:01.061282 [INFO] [5834] [xxx.xxx.xxx.xxx:50562:HTTP2-19#APVH_docs.account.de:443] Auto Index is disabled for [/home/account/public_html/docs/], access denied
2020-04-08 08:35:50.734290 [INFO] [5834] [xxx.xxx.xxx.xxx:50562:HTTP2-17#APVH_docs.account.de:443] File not found [/home/account/public_html/docs/403.shtml]
2020-04-08 08:35:50.734265 [INFO] [5834] [xxx.xxx.xxx.xxx:50562:HTTP2-17#APVH_docs.account.de:443] Auto Index is disabled for [/home/account/public_html/docs/], access denied
2020-04-08 08:35:47.976640 [INFO] [5834] [xxx.xxx.xxx.xxx:50562:HTTP2-15#APVH_docs.account.de:443] File not found [/home/account/public_html/docs/403.shtml]
2020-04-08 08:35:47.976620 [INFO] [5834] [xxx.xxx.xxx.xxx:50562:HTTP2-15#APVH_docs.account.de:443] Auto Index is disabled for [/home/account/public_html/docs/], access denied
2020-04-08 08:34:53.764346 [INFO] [5456] [xxx.xxx.xxx.xxx:50545:HTTP2-15#APVH_docs.account.de:443] File not found [/home/account/public_html/docs/403.shtml]
2020-04-08 08:34:53.764323 [INFO] [5456] [xxx.xxx.xxx.xxx:50545:HTTP2-15#APVH_docs.account.de:443] Auto Index is disabled for [/home/account/public_html/docs/], access denied
2020-04-08 08:34:19.216594 [INFO] [5277] [xxx.xxx.xxx.xxx:50544:HTTP2-15#APVH_docs.account.de:443] Auto Index is disabled for [/home/account/public_html/docs/], access denied
2020-04-08 08:19:12.724365 [INFO] [490] [xxx.xxx.xxx.xxx:50369:HTTP2-15#APVH_docs.account.de:443] File not found [/home/account/public_html/docs/403.shtml]
2020-04-08 08:19:12.724346 [INFO] [490] [xxx.xxx.xxx.xxx:50369:HTTP2-15#APVH_docs.account.de:443] Auto Index is disabled for [/home/account/public_html/docs/], access denied
2020-04-08 08:11:00.418531 [INFO] [27655] [xxx.xxx.xxx.xxx:50285:HTTP2-15#APVH_docs.account.de:443] File not found [/home/account/public_html/docs/403.shtml]
2020-04-08 08:11:00.418509 [INFO] [27655] [xxx.xxx.xxx.xxx:50285:HTTP2-15#APVH_docs.account.de:443] Auto Index is disabled for [/home/account/public_html/docs/], access denied
2020-04-08 08:09:46.850411 [INFO] [27655] [xxx.xxx.xxx.xxx:50269:HTTP2-15#APVH_docs.account.de:443] File not found [/home/account/public_html/docs/htdocs/403.shtml]
2020-04-08 08:09:46.850381 [INFO] [27655] [xxx.xxx.xxx.xxx:50269:HTTP2-15#APVH_docs.account.de:443] Auto Index is disabled for [/home/account/public_html/docs/], access denied
2020-04-08 08:07:04.354367 [INFO] [27655] [xxx.xxx.xxx.xxx:50249:HTTP2-15#APVH_docs.account.de:443] File not found [/home/account/public_html/docs/403.shtml]

Apache config:
/etc/apache2/conf.d>cat cperror.conf
# Enable SSI handling of error document files
<Directory /var/www/html>
    Options +Includes
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
</Directory>

Alias /cpanel-error-pages /var/www/html/
ErrorDocument 400 /cpanel-error-pages/400.shtml
ErrorDocument 401 /cpanel-error-pages/401.shtml
ErrorDocument 403 /cpanel-error-pages/403.shtml
ErrorDocument 404 /cpanel-error-pages/404.shtml
ErrorDocument 413 /cpanel-error-pages/413.shtml
ErrorDocument 500 /cpanel-error-pages/500.shtml


HTML:
/var/www/html>curl -i docs.account.de
HTTP/1.1 403 Forbidden
Date: Wed, 08 Apr 2020 09:41:26 GMT
Server: Apache
Content-Length: 318
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access this resource.</p>
<p>Additionally, a 403 Forbidden
error was encountered while trying to use an ErrorDocument to handle the request.</p>
</body></html>
 

cPanelLauren

Technical Support Community Manager
Staff member
Nov 14, 2017
13,271
1,243
313
Houston
Hi @serpent_driver

If it doesn't work on Apache or LiteSpeed I wouldn't wager that it's an issue related to LiteSpeed


A few questions:

1. How did you add the custom error pages initially?

2. You're opting for a sever wide solution by the include in the apache conf which isn't normally how this is configured. It's usually a per-account configuration and the SHTML file is added to the public_html for the account. For example, I have this configured for a test domain:

Code:
curl -vv alittletest.com/doesnotexist
*   Trying <MyIPAddress>...
* TCP_NODELAY set
* Connected to alittletest.com (MyIPAddress) port 80 (#0)
> GET /doesnotexist HTTP/1.1
> Host: alittletest.com
> User-Agent: curl/7.64.1
> Accept: */*
>
< HTTP/1.1 404 Not Found
< Date: Thu, 09 Apr 2020 21:30:41 GMT
< Server: Apache
< Strict-Transport-Security: max-age=300; includeSubDomains; preload
< Accept-Ranges: bytes
< Transfer-Encoding: chunked
< Content-Type: text/html
<
This is a custom error page I made today

Your browser is: curl/7.64.1
Your IP is: <MyLocalIp>
* Connection #0 to host alittletest.com left intact
The URL you requested was: /doesnotexist* Closing connection 0
(changed my hosts file to reference the domain locally to my server's IP so it's not a live domain)
 

serpent_driver

Active Member
Aug 1, 2019
29
7
8
Home
cPanel Access Level
Root Administrator
Hello @cPanelLauren

You don't want to wager that it's an issue related to LiteSpeed, because you believe I have caused the issue? I wager it will be the next "battle" between LiteSpeed and cPanel where nobody can reproduce the issue. If I am right I will win cPanel license fee free for 1 year. Remember Ticket ID: 93467103 ;)

Maybe we have a missunderstanding or I don't understand why you ask me these question, so again what the issue is. The issue is not about custom error pages. It is all about DEFAULT error pages and why default error pages are missing if error_log is right. My cperror.conf is also default. Nobody changed it and I don't want to include a server wide solution. Displaying of default error_pages works in LiteSpeed (if enabled) style with displaying error code, if there is no custom error page defined, but error_log wants me to believe *.shtml file cannot be found. This happens all the time if there is no custom error page defined and if I haven't defined a *.shtml file in cPanel.

To answer your questions:

1. If I define custom error pages I add it in .htaccess for each account within each account (/public_html).

Apache config:
ErrorDocument 400 /error_400.php
ErrorDocument 403 /error_403.php
ErrorDocument 404 /error_404.php
ErrorDocument 410 /error_410.php
ErrorDocument 500 /error_500.php
ErrorDocument 503 /error_503.php
2. Is not a question. I don't want to include a server wide solution. Displaying of default error pages works, but I want no extra error entry in error_log because *.shtml file cannot be found. I don't use cPanel function to create/define custom error pages (*.shtml).
 

cPanelLauren

Technical Support Community Manager
Staff member
Nov 14, 2017
13,271
1,243
313
Houston
What I'm trying to say is that if it's occurring with apache it's most likely not a litespeed issue, otherwise it wouldn't occur with Apache. Any further perception of blame past that is not the intention of my statement.


The issue is not about custom error pages. It is all about DEFAULT error pages and why default error pages are missing if error_log is right. My cperror.conf is also default. Nobody changed it and I don't want to include a server wide solution. Displaying of default error_pages works in LiteSpeed (if enabled) style with displaying error code, if there is no custom error page defined, but error_log wants me to believe *.shtml file cannot be found. This happens all the time if there is no custom error page defined and if I haven't defined a *.shtml file in cPanel.
So based on the statements made here, I am definitely confused as you specifically indicated that this *IS* about custom error pages in your initial response:
For all of my applications I have custom error pages. This works, but if there are no error pages defined error_log has additional entries for each error because *.shtml file cannot be found.
By your saying ALL of your applications, I assume that everything has custom error pages defined. Please keep in mind before you send responses of this nature that I have 0 access to your server, I also have no way to know what you have configured or don't have configured. Explaining things in the most detailed manner as possible is imperative.

It sounds like now the issue is actually the instances in which you've not defined custom error pages? If so, I believe this thread details the issue really well: SOLVED - default error documents. if not, please clarify further.
 

serpent_driver

Active Member
Aug 1, 2019
29
7
8
Home
cPanel Access Level
Root Administrator
@cPanelLauren

The issue in this thread SOLVED - default error documents is similiar, but is exactly not the same, because there is a especially situation with Apache and LiteSped. To exclude any missunderstanding for further discussion, forget "custom error page". We only talk about the behavior of:

1. Default error pages
2. No custom configuration for error documents in .htaccess (at document_root level)

To understand why this issue is especially I describe what happen if Apache is running and if LiteSpeed is running.

LiteSpeed
******************
If I request a URL that doesn't exist or auto index is not allowed, LiteSpeed displays an error page in LiteSpeed style with error code. There is no *.shtml document and there are no configurations in .htaccess for error pages.


ls_error.png

If I check error_log there are 2 entries for this request. As you can see this seems to be a wrong behavior. Displaying an error message is okay, but why is there an additional entry for 403.shtml cannot be found? Is it a problem of LiteSpeed or cPanel?

Code:
2020-04-11 08:18:27.600796 [INFO] [3550] [xxx.xxx.xxx.xxx:49597:HTTP2-17#APVH_docs.accountname.de:443] Auto Index is disabled for [/home/accountname/public_html/docs/], access denied
2020-04-11 08:16:23.599870 [INFO] [3550] [xxx.xxx.xxx.xxx:49585:HTTP2-15#APVH_docs.accountname.de:443] File not found [/home/accountname/public_html/docs/403.shtml]

Apache
******************
I manually created a 403.shtml document and put Apache default error message in this document and placed it in /public_html/docs. (/docs is the custom document_root for this subdomain). Again, there is no custom configuration in .htaccess for error_pages.

apache_error.png



If I check error_log again for this request there is only 1 entry. This is the behavior I expect if LiteSpeed is running.

Code:
2020-04-11 09:08:08.940377 [INFO] [3550] [xxx.xxx.xxx.xxx:49862:HTTP2-15#APVH_docs.accountname.de:443] Auto Index is disabled for [/home/accountname/public_html/docs/], access denied

I hope you can see where the difference is and what the issue is. So the question is who is responsible for this wrong behavior? cPanel or LiteSpeed?
 

LucasRolff

Well-Known Member
Community Guide Contributor
May 27, 2013
139
83
78
cPanel Access Level
Root Administrator
I hope you can see where the difference is and what the issue is. So the question is who is responsible for this wrong behavior? cPanel or LiteSpeed?
I'm not sure whether it's wrong behaviour - It simply logs that the file configured as ErrorDocument (Which is defined in /etc/apache2/conf.d/includes/errordocument.conf) does not exist.

A lot of junk will be found in error_log that could probably be avoided in any scenario, but that can be fixed by changing the Log Level to something higher than DEBUG or INFO, if it's too verbose.
 

serpent_driver

Active Member
Aug 1, 2019
29
7
8
Home
cPanel Access Level
Root Administrator
I'm not sure whether it's wrong behaviour - It simply logs that the file configured as ErrorDocument (Which is defined in /etc/apache2/conf.d/includes/errordocument.conf) does not exist.

A lot of junk will be found in error_log that could probably be avoided in any scenario, but that can be fixed by changing the Log Level to something higher than DEBUG or INFO, if it's too verbose.
I am complete on your side that not every error entry in error_log is an error. If a URL is requested that doesn't exist is not an error, but if a URL is requested and system can't find the error document although this error document exist, this is a behavior I can't tolerate. To ignore it by changing Log Level is not a solution!
 

LucasRolff

Well-Known Member
Community Guide Contributor
May 27, 2013
139
83
78
cPanel Access Level
Root Administrator
and system can't find the error document although this error document exist
You wrote something else:

LiteSpeed
******************
If I request a URL that doesn't exist or auto index is not allowed, LiteSpeed displays an error page in LiteSpeed style with error code. There is no *.shtml document and there are no configurations in .htaccess for error pages.

* IMAGE HERE *


If I check error_log there are 2 entries for this request. As you can see this seems to be a wrong behavior. Displaying an error message is okay, but why is there an additional entry for 403.shtml cannot be found? Is it a problem of LiteSpeed or cPanel?
You say "There's no *.shtml document" - thus the error occurs, if the document exist in the document root of the site, the error will disappear, because ErrorDocument is configured to look for shtml files in the document root.
 

serpent_driver

Active Member
Aug 1, 2019
29
7
8
Home
cPanel Access Level
Root Administrator
The problem is that cPanel doesn' t respect LiteSpeed behavior. If there is no custom error document defined LiteSpeed displays it's own error document. See picture above. This error document is not a *.shtml file, but cPanel doesn't recognize this and writes error entry for missing error document in error_log because it is defined in /etc/apache2/conf.d/includes/errordocument.conf. If Apache is running everything is okay and writes entry in error_log only for the wrong request.

LiteSpeed support says this behavior isn't an issue caused by LiteSpeed and cPanel support should check it.
 

cPanelLauren

Technical Support Community Manager
Staff member
Nov 14, 2017
13,271
1,243
313
Houston
The thing is though, I've already explained that this is standard behavior. The error document you see when litespeed encounters a 403 is the error document supplied by litespeed, the additional error logged:

Code:
2020-04-11 08:16:23.599870 [INFO] [3550] [xxx.xxx.xxx.xxx:49585:HTTP2-15#APVH_docs.accountname.de:443] File not found [/home/accountname/public_html/docs/403.shtml]
Indicates that it didn't find a custom error document though it's being told by the configuration to look for one. This doesn't occur when you're using apache with or without litespeed. I don't get the error on my standard cPanel server running apache though I do get the same error page on a 403:

Screenshot at Apr 16 11-51-42.png

I *DO* receive it if I change my log level

Code:
[Thu Apr 16 12:00:16.972698 2020] [core:info] [pid 22466:tid 47090272139008] [client <MYIPADDRESS>:52860] AH00128: File does not exist: /home/MYUSER/public_html/404.shtml
The standard log level for apache is warn - set this to info and you'll see the log output the same as it does for litespeed.

Code:
[Thu Apr 16 12:04:20.650545 2020] [actions:info] [pid 24326:tid 47824993785600] [client <MYIPADDRESS>:52938] AH00652: File does not exist: /home/myuser/public_html/thisisatest.php
[Thu Apr 16 12:04:20.650760 2020] [core:info] [pid 24326:tid 47824993785600] [client <MYIPADDRESS>:52938] AH00128: File does not exist: /home/myuser/public_html/404.shtml
The error is the same on both systems, it's just the error page that is different due to LiteSpeed using a custom error page template.
 

LucasRolff

Well-Known Member
Community Guide Contributor
May 27, 2013
139
83
78
cPanel Access Level
Root Administrator
You must have Litespeed to understand the issue.
I have both Apache and LiteSpeed. I do understand the issue.

Let me quote you again

If I request a URL that doesn't exist or auto index is not allowed, LiteSpeed displays an error page in LiteSpeed style with error code. There is no *.shtml document and there are no configurations in .htaccess for error pages.
There is no *.shtml document and there are no configurations in .htaccess for error pages.

That's what you write.

LiteSpeed has a default error page, just like Apache has a default error page - the LiteSpeed one just looks pretty.

If you do not have shtml files in your document root, the default error page will get served, and it will be logged to the system that 403.shtml (for example) does not exist - because it does not, and the webserver has been told to look for 403.shtml.

The problem is that cPanel doesn' t respect LiteSpeed behavior. If there is no custom error document defined LiteSpeed displays it's own error document. See picture above. This error document is not a *.shtml file, but cPanel doesn't recognize this and writes error entry for missing error document in error_log because it is defined in /etc/apache2/conf.d/includes/errordocument.conf.
It's not cPanel writing to the log file, it's the webserver (LiteSpeed) that writes to the log file.


LiteSpeed support says this behavior isn't an issue caused by LiteSpeed and cPanel support should check it.
/etc/apache2/conf.d/includes/errordocument.conf defines error pages such as ErrorDocument 404 /404.shtml - LiteSpeed will process this file, and look for /404.shtml - file doesn't exist, thus logs it to the error_log.

There's no reason to do a blame game who's at fault here.

The webserver is reading the ErrorDocument configuration, looks for the files it's told to, and logs an error because the files it's told to look for, doesn't exist, and thus serves a default error page.
 

serpent_driver

Active Member
Aug 1, 2019
29
7
8
Home
cPanel Access Level
Root Administrator
The error is the same on both systems, it's just the error page that is different due to LiteSpeed using a custom error page template.
Yes, I never said anything different, but it's on you to decide if this should be fixed or not. LiteSpeed says it should. Chanching log level isn't a solution, because it is important to know if a system document doesn't exist or the behavior with system documents is wrong. And it is wrong! cPanel is a partner of LiteSpeed and cPanel sells LiteSpeed licenses. Therefore both, LiteSpeed and cPanel, have to find a solution for this issue.
 

cPanelLauren

Technical Support Community Manager
Staff member
Nov 14, 2017
13,271
1,243
313
Houston
I think I'm still not fully understanding what you're saying the issue is. The error is exactly the same for both, the only difference is in the template being used. The standard Apache template has different verbiage than the LiteSpeed template.

Changing the log level allows you to see the errors are identical in the error log, where you're saying they're different. I'm showing you that they are not different. I'm also trying to show you how to see them, if you want them to be the same.

The Litespeed web server regardless of whether or not is partnered with cPanel will never function identically to Apache, that's not its purpose. It has its own configurations and settings which differ from apache vastly, furthermore, cPanel does not develop Litespeed. Log output will be different in LiteSpeed in some cases than it is with Apache.

As far as I am seeing right now, this is confusion as to how the different webservers print log output which has been explained and I'm not understanding where the problem is.