Skip to main content

Error Document Directives Issue

Comments

6 comments

  • Zoltan Szabo
    Dear All, Please let me know how to edit my httpd.conf if that is the problem ? Or just let me know what could be the possible cause of the error All best Z

    I did some troubleshoot, now please let me know if id did right? I have opened /usr/local/apache/conf/htppd.conf I found this line: Include "/etc/apache2/conf.d/includes/errordocument.conf" After opening the included error documents, I found this for 404 pages # 404 - Not Found ErrorDocument 404 /404.shtml # # ErrorDocument 404 default # Here as you can see If shtml file saved it gives that one as 404. I guess this happens if you give a custom 404 in Cpanel. The problematic line here is the else statement which would give 404 before my .htaccess kicks in. I just commented out that else statement and left everything untouched. My custom 404 pages with .htaccess all works now. (For settings to be live an apache restart is needed) Is this a proper solution ? Was this error handling change by h2 or It did happen by any new feature of cpanel that I missed? Sorry I might missed this error for long, I just now realised after mod_http2 was put in place. All best Z
    0
  • RickKukiela
    So the other day our apache restarted and all of the sudden every single custom ErrorDocument set up in a .htaccess file stopped working. It turns out that on july 7th, a new file was added to my /etc/apache2/bin/ folder called 'generate-errordoc-conf' which is a script file that generated a file at /etc/apache2/conf.d/includes/errordocument.conf' This sets the errodocument directives globally for the whole server and its presence cause the .haccess errordocument directives to be completely ignored unless the error documents are named "/DOCROOT/.shtml" and unfortunately for me none of my site's custom error documents were a .shtml file type. (Honestly who uses SHTML anymore? What is this 1998?) I had to `mv errordocument.conf` errordocument.old` and restart apache to fix this problem. I'm worried that this script file is going to run again and recreate this config file I do not want. I'm afraid if I delete the script out of bin, an update will just re-create it. Is there a setting I can just disable this? I dont want updates messing with my configuration and I'm kind of pissed that I did this time around. It caused me a bunch of wasted time trying to figure out what the hell happened and how to fix it. In the future please do not introduce changes that are going to just break previously working configs without any type of confirmation by us. Thanks.
    0
  • cPanelMichael
    Hello, Internal case EA-6533 is open to address an issue where /etc/apache2/conf.d/includes/errordocument.conf takes precedence over individual ErrorDocument entries in .htaccess files and thus makes any ErrorDocument directive in htaccess irrelevant. I'll monitor the status of this case and update this thread with more information as it becomes available. Edit - [Temporary workaround removed] To update, this was fixed in yesterday's mv /etc/apache2/conf.d/includes/errordocument.conf /etc/apache2/conf.d/includes/errordocument.conf.backup1 yum reinstall ea-apache24-config-runtime
    Thank you.
    0
  • Zoltan Szabo
    In the meantime, a temporary workaround is to remove the "Else" statements from /etc/apache2/conf.d/includes/errordocument.conf using the following commands:

    Hello, Sorry I am not that deep into server config this is why I picked cpanel rather than doing commands on my own. I am saying this as I did not really understand your commands. (I guess it just removes else statement but not sure in that) What I want to ask: I also figured out that the problem is the else statement and commented it out. Is this a proper solution or by time some refresh might recreate the file and we are back where we started ? Or just relax and possible next generation of file is after the fix of this issue. Bye Z P.S. I commented out else for 404 and my one works now ! Also wasted a lot of time, would be better to watch GOT instead :-)
    0
  • cPanelMichael
    I also figured out that the problem is the else statement and commented it out. Is this a proper solution or by time some refresh might recreate the file and we are back where we started ?

    Hello, This is the temporary workaround until a resolution associated with internal case EA-6533 is published. cPanel updates will not modify the errordocument.conf file in the meantime. I'll monitor the internal case and update this thread with more information about the resolution as it becomes available. Thank you.
    0

Please sign in to leave a comment.