hiryu85
9/28/2015 - 3:38 PM

Configurazione Apache con FastCGI con più

Configurazione Apache con FastCGI con più

# /etc/apache2/httpd.conf
[...]

# Configurazioni personali
Include /private/etc/apache2/other/*.conf




# FastCGI factory
# File: /etc/apache2/other/fastcgi_factory.conf

<IfModule mod_fastcgi.c>
        AddHandler php-fastcgi .php

        # FIX: FastCGI HTTP Authorization header
                <IfModule env_module>
                        SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
                </IfModule>

        # PHP 53
        # Action php-fastcgi /php53-fpm
        # Alias /php53-fpm /usr/local/var/www/cgi-bin/php53.fcgi
        # FastCGIExternalServer /usr/local/var/www/cgi-bin/php53.fcgi -host 127.0.0.1:9053 -pass-header Authorization
        # <Location /php53-fpm>
        #    Require all granted
        #     Allow from env=REDIRECT_STATUS
        # </Location>

        # PHP 54
        Action php-fastcgi /php54-fpm
        Alias /php54-fpm /usr/local/var/www/cgi-bin/php54.fcgi
        FastCGIExternalServer /usr/local/var/www/cgi-bin/php54.fcgi -host 127.0.0.1:9054 -pass-header Authorization

        <Location /php54-fpm>
            Require all granted
            Allow from env=REDIRECT_STATUS
        </Location>

        # PHP 55
        Action php-fastcgi /php55-fpm
        Alias /php55-fpm /usr/local/var/www/cgi-bin/php55.fcgi
        FastCGIExternalServer /usr/local/var/www/cgi-bin/php55.fcgi -host 127.0.0.1:9055 -pass-header Authorization -appConnTimeout 300 -idle-timeout 400
        <Location /php55-fpm>
            Require all granted
            Allow from env=REDIRECT_STATUS
        </Location>

        # PHP 56
        Action php-fastcgi /php56-fpm
        Alias /php56-fpm /usr/local/var/www/cgi-bin/php56.fcgi
        FastCGIExternalServer /usr/local/var/www/cgi-bin/php56.fcgi -host 127.0.0.1:9056 -pass-header Authorization -appConnTimeout 300 -idle-timeout 400
        <Location /php56-fpm>
            Require all granted
            Allow from env=REDIRECT_STATUS
        </Location>

<IfModule mod_fastcgi.c>
alias apache_start="sudo apachectl start"
alias apache_stop="sudo apachectl stop"
alias apache_restart="sudo apachectl restart"
alias apache_config="sudo $EDITOR /usr/local/etc/apache2/2.4/httpd.conf"
alias apache_config_check="sudo apachectl -t"
alias apache_vhost="sudo $EDITOR /etc/apache2/extra/httpd-vhosts.conf"
alias apache_php_fm_config="sudo $EDITOR /etc/apache2/other/fastcgi_factory.conf"

# WebServer
alias conf_httpd="sudo $EDITOR /usr/local/etc/apache2/2.4/httpd.conf"
alias conf_php56="sudo $EDITOR /usr/local/etc/php/5.6/php.ini"
alias conf_php55="sudo $EDITOR /usr/local/etc/php/5.5/php.ini"
alias conf_php54="sudo $EDITOR /usr/local/etc/php/5.4/php.ini"
alias conf_php53="sudo $EDITOR /usr/local/etc/php/5.5/php.ini"

PHP54_PLIST="~/Library/LaunchAgents/homebrew.mxcl.php54.plist"
alias php54_fpm_start="launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php54.plist"
alias php54_fpm_stop="launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.php54.plist"
alias php54_fpm_restart="launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.php54.plist &> /dev/null && launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php54.plist &> /dev/null"
alias php54_fpm_config="sudo $EDITOR /usr/local/etc/php/5.4/php-fpm.conf"
alias php54_fpm_log="tail -f /usr/local/opt/php54/var/log/php-fpm.log"

alias php55_fpm_start="launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php55.plist"
alias php55_fpm_stop="launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.php55.plist"
alias php55_fpm_restart="launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.php55.plist &> /dev/null && launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php55.plist &> /dev/null"
alias php55_fpm_config="sudo $EDITOR /usr/local/etc/php/5.5/php-fpm.conf"
alias php55_fpm_log="tail -f /usr/local/opt/php55/var/log/php-fpm.log"

alias php56_fpm_start="launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php56.plist"
alias php56_fpm_start="launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.php56.plist"
alias php56_fpm_restart="launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.php56.plist &> /dev/null && launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php56.plist &> /dev/null"
alias php56_fpm_config="sudo $EDITOR /usr/local/etc/php/5.6/php-fpm.conf"
alias php56_fpm_log="tail -f /usr/local/opt/php56/var/log/php-fpm.log"