Skip to main content

Litespeed - default error pages cannot be found

Comments

13 comments

  • cPanelLauren
    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: curl -vv alittletest.com/doesnotexist * Trying ... * 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: * 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)
    0
  • serpent_driver
    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). [CODE=apacheconf] 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).
    0
  • cPanelLauren
    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:
    0
  • LucasRolff
    [QUOTE]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.
    0
  • serpent_driver
    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!
    0
  • LucasRolff
    [QUOTE]and system can't find the error document although this error document exist
    You wrote something else: [QUOTE] 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.
    0
  • serpent_driver
    You wrote something else: 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.

    You must have Litespeed to understand the issue.
    0
  • serpent_driver
    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.
    0
  • cPanelLauren
    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: 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: I *DO* receive it if I change my log level [Thu Apr 16 12:00:16.972698 2020] [core:info] [pid 22466:tid 47090272139008] [client :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. [Thu Apr 16 12:04:20.650545 2020] [actions:info] [pid 24326:tid 47824993785600] [client :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 :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.
    0
  • LucasRolff
    You must have Litespeed to understand the issue.

    I have both Apache and LiteSpeed. I do understand the issue. Let me quote you again [QUOTE]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.
    0
  • serpent_driver
    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.
    0
  • cPanelLauren
    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.
    0

Please sign in to leave a comment.