User Tools

Site Tools


doc:appunti:linux:sa:apache_php_optimization

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
doc:appunti:linux:sa:apache_php_optimization [2026/10/26 14:50] – [Modulo MPM event, proxy_fcgi e php-fpm] niccolodoc:appunti:linux:sa:apache_php_optimization [2026/10/26 14:56] (current) – [Configurazione differenziata per VirtualHost] niccolo
Line 160: Line 160:
     </FilesMatch>     </FilesMatch>
   </IfModule>   </IfModule>
 +</file>
 +
 +In alternativa è possibile includere la configurazione FPM **/etc/apache2/conf-available/php7.0-fpm.conf** che ha alcune impostazioni predefinite per file .php, .phps, ecc. nonché alcune impostazoini per trasferire al PHP le informazioni sull'autenticazione base HTTP:
 +
 +<file>
 +<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/php8.4-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>
 </file> </file>
  
doc/appunti/linux/sa/apache_php_optimization.txt · Last modified: by niccolo