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

error "Web server software ({$a}) is not supported, sorry." when load balancing Moodle on PHP-FPM using HAProxy and FastCGI

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • None
    • 3.11, 4.0
    • Other
    • MOODLE_311_STABLE, MOODLE_400_STABLE
    • MDL-71897_add-haproxy-as-recognized-webserver
    • Hide
      1. The prerequisite is a working HAProxy (>= 2.2.15 or >= 2.3.11 or >= 2.4.1 ) and PHP-FPM installation available on localhost.
        1. Prepare a minimal HAProxy config named haproxy.cfg in the current directory

          global
              log /dev/log    local0
              user haproxy
              group www-data
           
          defaults
              log global
              mode    http
              option  httplog
              option  dontlognull
              timeout connect 5s
              timeout client  50s
              timeout server  50s
           
          frontend moodle
              bind :80
              default_backend phpservers
           
          backend phpservers
              use-fcgi-app php-fpm
              server server1 /run/php/moodle.sock proto fcgi
           
          fcgi-app php-fpm
              log-stderr global
              docroot /var/www/moodle
              index index.php
              path-info ^(/.+\.php)(/.*)?$
          

        2. Run a HAProxy server via Docker

          docker run --name my-haproxy --network host -v $(pwd):/usr/local/etc/haproxy:ro -p 80:80 -p 8080:8080 -d haproxytech/haproxy-ubuntu:2.4 

      1. Install Moodle

      Moodle should be successfully installed and can be accessed.

      Show
      The prerequisite is a working HAProxy (>= 2.2.15 or >= 2.3.11 or >= 2.4.1 ) and PHP-FPM installation available on localhost. Prepare a minimal HAProxy config named haproxy.cfg in the current directory global log /dev/log local0 user haproxy group www-data   defaults log global mode http option httplog option dontlognull timeout connect 5s timeout client 50s timeout server 50s   frontend moodle bind :80 default_backend phpservers   backend phpservers use-fcgi-app php-fpm server server1 /run/php/moodle.sock proto fcgi   fcgi-app php-fpm log-stderr global docroot /var/www/moodle index index.php path-info ^(/.+\.php)(/.*)?$ Run a HAProxy server via Docker docker run --name my-haproxy --network host -v $(pwd):/usr/local/etc/haproxy:ro -p 80:80 -p 8080:8080 -d haproxytech/haproxy-ubuntu:2.4 Install Moodle Moodle should be successfully installed and can be accessed.

      To reduce the number of involved parties when handling web traffic, we want to directly load-balance our moodle cluster running on PHP-FPM using HAProxy and the new FastCGI backend in HAProxy 2.1. So instead of handing off the request from HAProxy to the webserver (e.g. Apache or Nginx) and then via FastCGI to PHP-FPM, we relay requests directly from HAProxy to a running PHP-FPM service, reducing overhead. In addition, by separating static content from scripts using PHP-FPM, we can scale them independently as static files are still served via a regular webserver.

       

      STEPS TO REPRODUCE

      • Install HAProxy
      • Install PHP-FPM
      • Configure HAProxy with use-fcgi-app
      • Install moodle

      WHAT WAS EXPECTED

      • Moodle is installed and can be accessed

      WHAT ACTUALLY HAPPENS

      • The error message "Web server software ({$a}) is not supported, sorry." is shown.

            Daniel Ziegenberg Daniel Ziegenberg
            Daniel Ziegenberg Daniel Ziegenberg
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.