Ubuntu 18.04 aliases with http2 enabled and no mod_php

Discussion in 'General' started by Andy Lear, Jul 18, 2018.

  1. Andy Lear

    Andy Lear New Member

    Hi,

    How would we get the aliases for phpmyadmin and webmail to work on a server that has http2 enabled, as it would seem that mod_php can not be enabled and working at the same time because of a conflict between http2 and mpm_prefork.

    It would seem that http2 is the way to go for site performance for google rankings etc as it vastly improves server response times. The console itself seems to work fine using mod_fcgid. Is there anyway to get the aliases to do the same, or will I need to add apache directives to each site that wants them? Or is there something I can do to get the default site (eg. mail.example.com point to the ip of the server with no site set up) to work with the webmail alias.

    Thanks for any help

    Andy
     
  2. ztk.me

    ztk.me Well-Known Member HowtoForge Supporter

    you may need to replace the php version.
    it uses mod_proxy_fcgi though, say goodbye to mod_fcgid

    also the most improvement you got by ditching mpm_prefork ;) http2 still needs to be utilitized by adding the link headers.

    cat /etc/apache2/conf-enabled/php7.1-fpm.conf
    Code:
    # Redirect to local php-fpm if mod_php is not available
    <IfModule !mod_php7.c>
    <IfModule proxy_fcgi_module>
        # Enable http authorization headers
        <IfModule setenvif_module>
        SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1
        </IfModule>
    
        <FilesMatch ".+\.ph(ar|p|tml)$">
            SetHandler "proxy:unix:/run/php/php7.1-fpm.sock|fcgi://localhost"
        </FilesMatch>
        <FilesMatch ".+\.phps$">
            # Deny access to raw php sources by default
            # To re-enable it's recommended to enable access to the files
            # only in specific virtual host or directory
            Require all denied
        </FilesMatch>
        # Deny access to files without filename (e.g. '.php')
        <FilesMatch "^\.ph(ar|p|ps|tml)$">
            Require all denied
        </FilesMatch>
    </IfModule>
    </IfModule>
    
    edit:
    https://www.howtoforge.com/communit...-enigma-munin-phpmyadmin-using-php-fpm.77489/
    maybe needed, is for deian but one should get the point
     
    Jesse Norell likes this.

Share This Page