From 18fb98a157422c885418894c3aa3a57dfacbad72 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Tue, 17 Jan 2017 13:56:12 +0100 Subject: [PATCH] User standard dans le pool fpm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Utilisation du user vagrant dans le pool fpm et ainsi pouvoir utiliser simplement les cli php sans problème de permission --- lamp-trusty64-fpm/Vagrantfile | 2 +- lamp-trusty64-fpm/bootstrap.sh | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/lamp-trusty64-fpm/Vagrantfile b/lamp-trusty64-fpm/Vagrantfile index 723e9c2..48fca88 100644 --- a/lamp-trusty64-fpm/Vagrantfile +++ b/lamp-trusty64-fpm/Vagrantfile @@ -38,7 +38,7 @@ Vagrant.configure(2) do |config| # the path on the guest to mount the folder. And the optional third # argument is a set of non-required options. # config.vm.synced_folder "../data", "/vagrant_data" - config.vm.synced_folder "../../", "/home/vhosts", owner: "www-data", group: "www-data" + config.vm.synced_folder "../../", "/home/vhosts" # Provider-specific configuration so you can fine-tune various # backing providers for Vagrant. These expose provider-specific options. diff --git a/lamp-trusty64-fpm/bootstrap.sh b/lamp-trusty64-fpm/bootstrap.sh index 5a6a38a..59e6420 100644 --- a/lamp-trusty64-fpm/bootstrap.sh +++ b/lamp-trusty64-fpm/bootstrap.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash + + VARGANTDEV=1 DIR=/vagrant DIRDATA=$DIR/data @@ -84,7 +86,11 @@ if [ ! -f /usr/bin/php5 ]; then sudo sed -i -e 's/upload_max_filesize = 2M/upload_max_filesize = 50M/g' /etc/php5/fpm/php.ini sudo sed -i -e 's/session.gc_maxlifetime = 1440/session.gc_maxlifetime = 86400/g' /etc/php5/fpm/php.ini sudo sed -i -e 's/;opcache.enable=0/opcache.enable=1/g' /etc/php5/fpm/php.ini - sudo cp -f $DIRDATA/PHP/xdebug.ini /etc/php5/mods-available/xdebug.ini + sudo cp -f $DIRDATA/PHP/xdebug.ini /etc/php5/mods-available/xdebug.ini + # Pool user + sudo sed -i -e 's/user = www-data/user = vagrant/g' /etc/php5/fpm/pool.d/www.conf + sudo sed -i -e 's/group = www-data/group = vagrant/g' /etc/php5/fpm/pool.d/www.conf + sudo sed -i -e 's/listen.group = www-data/listen.group = www-data/g' /etc/php5/fpm/pool.d/www.conf # --- Browscap sudo cp -f $DIRDATA/PHP/php_browscap.ini /etc/php5/fpm/ @@ -101,7 +107,7 @@ if [ ! -f /usr/bin/php5 ]; then sudo cp $DIRDATA/ChartDirector/chartdir.ini /etc/php5/mods-available/ sudo php5enmod chartdir fi - + sudo service php5-fpm restart fi # --- Composer @@ -116,8 +122,8 @@ if [ ! -d "/home/vhosts/$PHPMYADMIN_DIR" ]; then wget -q "$PHPMYADMIN_URL/$PHPMYADMIN_VERSION/$PHPMYADMIN_DIR.tar.xz" -O "/home/vagrant/$PHPMYADMIN_DIR.tar.xz" if [ -f "/home/vagrant/$PHPMYADMIN_DIR.tar.xz" ]; then tar xJvf "/home/vagrant/$PHPMYADMIN_DIR.tar.xz" --directory /home/vhosts/ - mysql -hlocalhost -uroot -p$MYSQL_PASS < /home/vhosts/$PHPMYADMIN_DIR/sql/create_tables.sql - mysql -hlocalhost -uroot -p$MYSQL_PASS < $DIRDATA/Apps/phpmyadmin.sql + mysql -uroot -p$MYSQL_PASS < /home/vhosts/$PHPMYADMIN_DIR/sql/create_tables.sql + mysql -uroot -p$MYSQL_PASS < $DIRDATA/Apps/phpmyadmin.sql sudo service mysql restart cp $DIRDATA/Apps/config.inc.php /home/vhosts/$PHPMYADMIN_DIR/ chmod 0644 /home/vhosts/$PHPMYADMIN_DIR/config.inc.php @@ -164,7 +170,7 @@ for f in *.conf; do continue fi if [ -f $f ]; then - sudo cp -vf $f /etc/apache2/sites-available/; + sudo cp -vf $f /etc/apache2/sites-available/ VHOSTS+=" $f" fi done;