Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-69034

Apache 2.2 directives in .htaccess files fill logs of Apache 2.4 servers

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.8.3, 3.9
    • Fix Version/s: None
    • Component/s: Installation
    • Labels:
      None
    • Affected Branches:
      MOODLE_38_STABLE, MOODLE_39_STABLE

      Description

      Hi,

      In files

      lib/setuplib.php ( function protect_directory () )
      and lib/installlib.php ( function install_init_dataroot() )

      Moodle creates .htaccess if needed, but with Apache 2.2 directives.

      Lines are :

      fwrite($handle, "deny from all\r\nAllowOverride None\r\nNote: this file is broken intentionally, we do not want anybody to undo it in subdirectory!\r\n");

      Today, most of Apache servers are in version 2.4, and "Require all denied" replace "deny from all"

      Line should be

      fwrite($handle, "Require all denied\r\nAllowOverride None\r\nNote: this file is broken intentionally, we do not want anybody to undo it in subdirectory!\r\n");

      The site works in both cases, but Apache logs are filled with warnings like "AH01630: client denied by server configuration:"

      Another solution is to add a new parameter in config.php to setup the web server type and version. And creates .htaccess files according to this parameter.

      Thanks a lot

      Bruno

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            uha Bruno Malaval
            Participants:
            Component watchers:
            Matteo Scaramuccia, Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated: