| 1 | 2 | simandl | # Configure all that stuff needed for using PHP-FPM as FastCGI |
| 2 | | | |
| 3 | | | # Set handlers for PHP files. |
| 4 | | | # application/x-httpd-php phtml pht php |
| 5 | | | # application/x-httpd-php3 php3 |
| 6 | | | # application/x-httpd-php4 php4 |
| 7 | | | # application/x-httpd-php5 php |
| 8 | | | <FilesMatch ".+\.ph(p[345]?|t|tml)$"> |
| 9 | | | SetHandler application/x-httpd-php |
| 10 | | | </FilesMatch> |
| 11 | | | # application/x-httpd-php-source phps |
| 12 | | | <FilesMatch ".+\.phps$"> |
| 13 | | | SetHandler application/x-httpd-php-source |
| 14 | | | # Deny access to raw php sources by default |
| 15 | | | # To re-enable it's recommended to enable access to the files |
| 16 | | | # only in specific virtual host or directory |
| 17 | | | Order Deny,Allow |
| 18 | | | Deny from all |
| 19 | | | </FilesMatch> |
| 20 | | | |
| 21 | | | # Deny access to files without filename (e.g. '.php') |
| 22 | | | <FilesMatch "^\.ph(p[345]?|t|tml|ps)$"> |
| 23 | | | Order Deny,Allow |
| 24 | | | Deny from all |
| 25 | | | </FilesMatch> |
| 26 | | | |
| 27 | | | # Define Action and Alias needed for FastCGI external server. |
| 28 | | | Action application/x-httpd-php /fcgi-bin/php5-fpm virtual |
| 29 | | | Alias /fcgi-bin/php5-fpm /fcgi-bin-php5-fpm |
| 30 | | | <Location /fcgi-bin/php5-fpm> |
| 31 | | | # here we prevent direct access to this Location url, |
| 32 | | | # env=REDIRECT_STATUS will let us use this fcgi-bin url |
| 33 | | | # only after an internal redirect (by Action upper) |
| 34 | | | Order Deny,Allow |
| 35 | | | Deny from All |
| 36 | | | Allow from env=REDIRECT_STATUS |
| 37 | | | </Location> |
| 38 | | | FastCgiExternalServer /fcgi-bin-php5-fpm -socket /var/run/php5-fpm.sock -pass-header Authorization |