PHP ErrorDocument mod_rewrite ProxyErrorOverride

  • Debian Jessie
    Apache 2.4
    IMSCP 1.3.5


    Problem:
    If .htaccess has "ErorDocument 404 script.php" or rewriting * with script.php (index.php), wich handling 404 errors - both no working (503 - php, or show standard 404 error)
    Because now in 00_namesever.conf : ProxyErrorOverride On - as default for all domains.
    ProxyErrorOverride Off - solve problem for domain, but do it every time after updating ...
    Any ideas ?

  • @kivamp


    The error is due to the following bug: https://bz.apache.org/bugzilla/show_bug.cgi?id=55415


    You have two solutions:

    • You simply comment the ErorDocument directive inside your .htaccess file and you live with the default error pages that you can customize through the panel interface
    • You create a small listener file which will set the ProxyErrorOverride directive value to Off for the specified domain(s).

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • @kivamp


    Without the ProxyErrorOverride directive set to On, any site which don't handle error documents through PHP will have no error document. For instance, if you reach an inexistent page, a blank page will be shown instead of the 404 error which is a very bad behavior for your visitors.


    Note that this behavior only affects the apache PHP-FPM server implementation where the apache mod_proxy_fcgi is used... You could switch (not recommended) to fcgid to avoid such a behavior. In that case, the ProxyErrorOverride directive would be ignored in that context because fcgi don't use mod_proxy_fcgi.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • Yesterday i upgraded I-MSCP from 1.3.0 to 1.3.5 and after i did apt-get upgrade on my debian too.


    After all this, my domains get error 503.
    I did not find any problem in the logs.


    I was confused which upgrade was the problematic upgrade :-)


    I switched back to fcgi but fcgi on debian 8 has a bug too, so i switched back again to fpm and i tried to fix my problem.


    I did not know untill now what was the problem, but the only solution was for me (not the best but worked) to restore /etc/apache2 from backup.


    So thank you kivamp and Nuxwin for your help, now it is clear what happened :-)

  • See also the related discussion on github: https://github.com/i-MSCP/imsc…cf#commitcomment-19188045

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • A fix has been added in the 1.3.x branch. See https://github.com/i-MSCP/imsc…verride-directive-apache2
    This fix will be part of next release.


    Thank you for your report.


    Thread closed.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • A fix has been added in the 1.3.x branch. See https://github.com/i-MSCP/imsc…ad40d724d9c364f3096bee57c
    This fix will be part of i-MSCP version 1.3.9


    Thank you for your report.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206