Utilisation du module fcgi fournit avec apache à partir de la version

2.4.10
This commit is contained in:
Michael RICOIS 2016-06-24 11:35:08 +02:00
parent eaeffc2b10
commit 0157b2f88b
4 changed files with 31 additions and 15 deletions

View File

@ -5,7 +5,7 @@ DIR=/vagrant
DIRDATA=$DIR/data
MYSQL_PASS=scores
MARIADB_VERSION="10.1"
PHPMYADMIN_VERSION="4.6.1"
PHPMYADMIN_VERSION="4.6.3"
# --- Add a file action.upgrade to perfom a system upgrade
if [ -f $DIR/action.upgrade ]
@ -59,15 +59,19 @@ fi
# --- PHP
if [ ! -f /usr/bin/php5 ]
then
# Get apache2.4 from backports
sudo cp -f $DIRDATA/apt/preferences /etc/apt/preferences
# Install
sudo apt-get update
sudo apt-get -y install htop unzip apache2 libapache2-mod-fastcgi php5-fpm php5-cli php5-apcu php5-curl php5-xmlrpc php5-xsl php5-mysqlnd
sudo apt-get -y install htop unzip apache2 php5-fpm php5-cli php5-apcu php5-curl php5-xmlrpc php5-xsl php5-mysqlnd
if [ $VARGANTDEV -eq 1 ]
then
sudo apt-get -y install php5-xdebug
fi
sudo a2enmod autoindex deflate expires headers rewrite actions
sudo cp -f $DIRDATA/Apache/fastcgi.conf /etc/apache2/mods-available/fastcgi.conf
sudo a2enmod autoindex deflate expires headers rewrite actions proxy proxy_fcgi
sudo cp -f $DIRDATA/Apache/phpfcgi.conf /etc/apache2/conf-available/phpfcgi.conf
sudo a2enconf phpfcgi
# --- Configuration PHP / CLI
if [ -f /etc/php5/cli/php.ini ]
@ -127,7 +131,7 @@ then
mysql -hlocalhost -uroot -p$MYSQL_PASS < $DIRDATA/Apps/phpmyadmin.sql
sudo service mysql restart
cp $DIRDATA/Apps/config.inc.php /home/vhosts/$PHPMYADMIN_DIR/
chmod 0444 /home/vhosts/$PHPMYADMIN_DIR/config.inc.php
chmod 0644 /home/vhosts/$PHPMYADMIN_DIR/config.inc.php
fi
fi

View File

@ -1,9 +0,0 @@
<IfModule mod_fastcgi.c>
AddType application/x-httpd-fastphp5 .php
Action application/x-httpd-fastphp5 /php5-fcgi
Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi
FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -socket /var/run/php5-fpm.sock -pass-header Authorization -idle-timeout 310
<Directory /usr/lib/cgi-bin>
Require all granted
</Directory>
</IfModule>

View File

@ -0,0 +1,18 @@
<FilesMatch "\.php$">
# Pick one of the following approaches
# Use the standard TCP socket
# SetHandler "proxy:fcgi://localhost/:9000"
# If your version of httpd is 2.4.9 or newer (or has the back-ported feature), you can use the unix domain socket
# SetHandler "proxy:unix:/path/to/app.sock|fcgi://localhost/"
SetHandler "proxy:unix:/var/run/php5-fpm.sock|fcgi://localhost/"
</FilesMatch>
# Définition d'une configuration de mandataire qui convient.
# La partie qui est mise en correspondance avec la valeur de SetHandler est la partie qui suit
# le "pipe". Si vous devez faire une distinction, "localhost" peut être changé en un nom de
# serveur unique.
#<Proxy "fcgi://localhost/" enablereuse=on max=10>
#</Proxy>
# Add Authorization Header
SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1

View File

@ -0,0 +1,3 @@
Package: *
Pin: release a=trusty-backports
Pin-Priority: 500