Add machine lamp-trusty64-fpm

This commit is contained in:
Michael RICOIS 2016-02-15 17:26:52 +01:00
parent fbf4b34a01
commit 33bae37e1b
51 changed files with 498981 additions and 0 deletions

1
lamp-trusty64-fpm/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/.vagrant/

80
lamp-trusty64-fpm/Vagrantfile vendored Normal file
View File

@ -0,0 +1,80 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.
# Every Vagrant development environment requires a box. You can search for
# boxes at https://atlas.hashicorp.com/search.
config.vm.box = "ubuntu/trusty64"
# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
# `vagrant box outdated`. This is not recommended.
# config.vm.box_check_update = false
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# config.vm.network "forwarded_port", guest: 80, host: 8080
# Create a private network, which allows host-only access to the machine
# using a specific IP.
config.vm.network "private_network", ip: "192.168.33.10", netmask: "255.255.255.0"
# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
# config.vm.network "public_network"
# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# 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"
# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
# Example for VirtualBox:
#
# config.vm.provider "virtualbox" do |vb|
# # Display the VirtualBox GUI when booting the machine
# vb.gui = true
#
# # Customize the amount of memory on the VM:
# vb.memory = "1024"
# end
#
# View the documentation for the provider you are using for more
# information on available options.
# Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
# such as FTP and Heroku are also available. See the documentation at
# https://docs.vagrantup.com/v2/push/atlas.html for more information.
# config.push.define "atlas" do |push|
# push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
# end
# Enable provisioning with a shell script. Additional provisioners such as
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
# documentation for more information about their specific syntax and use.
# config.vm.provision "shell", inline: <<-SHELL
# sudo apt-get update
# sudo apt-get install -y apache2
# SHELL
config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--memory", "1024"]
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
end
config.vm.provision :shell, :path => "./bootstrap.sh"
end

View File

@ -0,0 +1,183 @@
#!/usr/bin/env bash
VARGANTDEV=1
DIR=/vagrant
DIRDATA=$DIR/data
MYSQL_PASS=scores
MARIADB_VERSION="10.1"
PHPMYADMIN_VERSION="4.5.4.1"
# --- Add a file action.upgrade to perfom a system upgrade
if [ -f $DIR/action.upgrade ]
then
sudo apt-get update
sudo apt-get -y upgrade
sudo rm -rf $DIR/action.upgrade
fi
# --- Installation Wkhtmltopdf
if [ ! -f /usr/local/bin/wkhtmltopdf ]
then
sudo dpkg -i $DIRDATA/Apps/wkhtmltox-0.12.2.1_linux-trusty-amd64.deb
sudo apt-get -f install -y
fi
# --- Database
if [ $VARGANTDEV -eq 1 ]
then
# --- Installation MariaDB
if [ ! -f /etc/mysql/vagrant ]
then
sudo apt-get install software-properties-common
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
sudo add-apt-repository 'deb [arch=amd64,i386] http://ftp.igh.cnrs.fr/pub/mariadb/repo/10.1/ubuntu trusty main'
sudo apt-get update
sudo debconf-set-selections <<< "mariadb-server-$MARIADB_VERSION mysql-server/root_password password $MYSQL_PASS"
sudo debconf-set-selections <<< "mariadb-server-$MARIADB_VERSION mysql-server/root_password_again password $MYSQL_PASS"
sudo apt-get -y install mariadb-server mariadb-client
sudo sed -i -e 's/bind-address[ \t]*= 127.0.0.1/bind-address = 0.0.0.0/g' /etc/mysql/my.cnf
sudo sed -i -e 's/max_connections[ \t]*= 100/max_connections = 20/g' /etc/mysql/my.cnf
sudo service mysql restart
sudo touch /etc/mysql/vagrant
fi
else
# --- Installation MySQL Server
if [ ! -f /etc/mysql/vagrant ]
then
sudo debconf-set-selections <<< "mysql-server mysql-server/root_password password $MYSQL_PASS"
sudo debconf-set-selections <<< "mysql-server mysql-server/root_password_again password $MYSQL_PASS"
sudo apt-get -y install mysql-server mysql-client
sudo sed -i -e 's/bind-address[ \t]*= 127.0.0.1/bind-address = 0.0.0.0/g' /etc/mysql/my.cnf
sudo sed -i -e 's/max_connections[ \t]*= 100/max_connections = 20/g' /etc/mysql/my.cnf
sudo service mysql restart
sudo touch /etc/mysql/vagrant
fi
fi
# --- PHP
if [ ! -f /usr/bin/php5 ]
then
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
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
# --- Configuration PHP / CLI
if [ -f /etc/php5/cli/php.ini ]
then
sudo sed -i -e 's/short_open_tag = Off/short_open_tag = On/g' /etc/php5/cli/php.ini
sudo sed -i -e 's/;mbstring.internal_encoding = UTF-8/mbstring.internal_encoding = UTF-8/g' /etc/php5/cli/php.ini
sudo sed -i -e 's/;date.timezone =/date.timezone = Europe\/Paris/g' /etc/php5/cli/php.ini
fi
# --- Configuration PHP FPM
if [ -f /etc/php5/fpm/php.ini ]
then
sudo sed -i -e 's/short_open_tag = Off/short_open_tag = On/g' /etc/php5/fpm/php.ini
sudo sed -i -e 's/;mbstring.internal_encoding = UTF-8/mbstring.internal_encoding = UTF-8/g' /etc/php5/fpm/php.ini
sudo sed -i -e 's/;date.timezone =/date.timezone = Europe\/Paris/g' /etc/php5/fpm/php.ini
sudo sed -i -e 's/post_max_size = 8M/post_max_size = 50M/g' /etc/php5/fpm/php.ini
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
# --- Browscap
sudo cp -f $DIRDATA/PHP/php_browscap.ini /etc/php5/fpm/
sudo sed -i -e 's/;browscap = extra\/browscap.ini/browscap = \/etc\/php5\/fpm\/php_browscap.ini/g' /etc/php5/fpm/php.ini
fi
# --- ChartDirector
if [ ! -f /usr/lib/php5/20121212/chartdir.lic ]
then
sudo cp -R $DIRDATA/ChartDirector/lib/fonts /usr/lib/php5/20121212/
sudo cp $DIRDATA/ChartDirector/lib/libchartdir.so /usr/lib/php5/20121212/
sudo cp $DIRDATA/ChartDirector/lib/phpchartdir550.dll /usr/lib/php5/20121212/
sudo cp $DIRDATA/ChartDirector/chartdir.lic /usr/lib/php5/20121212/
sudo cp $DIRDATA/ChartDirector/chartdir.ini /etc/php5/mods-available/
sudo php5enmod chartdir
fi
fi
# --- Composer
if [ ! -f /usr/local/bin/composer ]
then
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
fi
# --- Installation phpMyAdmin
PHPMYADMIN_DIR="phpMyAdmin-$PHPMYADMIN_VERSION-all-languages"
PHPMYADMIN_URL="https://files.phpmyadmin.net/phpMyAdmin"
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
sudo service mysql restart
cp $DIRDATA/Apps/config.inc.php /home/vhosts/$PHPMYADMIN_DIR/
chmod 0444 /home/vhosts/$PHPMYADMIN_DIR/config.inc.php
fi
fi
# --- Configuration Apache
if [ ! -f /etc/apache2/conf-available/httpd.conf ]
then
sudo echo "ServerName 127.0.0.1" > /etc/apache2/conf-available/httpd.conf
sudo a2enconf httpd
fi
# --- Disable all website
cd /etc/apache2/sites-available/
for f in *.conf; do
if [ $f = "000-default.conf" ]; then
continue
fi
if [ $f = "default-ssl.conf" ]; then
continue
fi
sudo a2dissite $f;
sudo rm -vf /etc/apache2/sites-available/$f;
done;
# --- phpmyadmin.sd.dev
cp -f $DIRDATA/Apache/phpmyadmin.conf $DIR/vhosts/phpmyadmin.conf
sed -i -e "s/VERSION/$PHPMYADMIN_VERSION/" $DIR/vhosts/phpmyadmin.conf
# --- test.sd.dev
cp -f $DIRDATA/Apache/test.conf $DIR/vhosts/test.conf
if [ ! -d /home/vhosts/test ]
then
sudo mkdir /home/vhosts/test
fi
# --- Copy Vhosts files
VHOSTS='000-default.conf'
cd $DIR/vhosts/
for f in *.conf; do
if [ $f = "000-default.conf" ]; then
continue
fi
if [ $f = "default-ssl.conf" ]; then
continue
fi
if [ -f $f ]
then
sudo cp -vf $f /etc/apache2/sites-available/;
VHOSTS+=" $f"
fi
done;
sudo a2ensite $VHOSTS
# --- Restart apache
sudo service apache2 restart

View File

@ -0,0 +1,9 @@
<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
<Directory /usr/lib/cgi-bin>
Require all granted
</Directory>
</IfModule>

View File

@ -0,0 +1,18 @@
<VirtualHost *:80>
ServerName phpmyadmin.sd.dev
UseCanonicalName On
UseCanonicalPhysicalPort On
DocumentRoot /home/vhosts/phpMyAdmin-VERSION-all-languages
<Directory /home/vhosts/phpMyAdmin-VERSION-all-languages/>
EnableSendfile Off
AllowOverride all
Require all granted
</Directory>
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
LogLevel error
ErrorLog ${APACHE_LOG_DIR}/phpmyadmin-error.log
CustomLog ${APACHE_LOG_DIR}/phpmyadmin-access.log combined
</VirtualHost>

View File

@ -0,0 +1,20 @@
<VirtualHost *:80>
ServerName test.sd.dev
UseCanonicalName On
UseCanonicalPhysicalPort On
DocumentRoot /home/vhosts/test
<Directory /home/vhosts/test/>
# EnableSendFile is disable for performance reason under vagrant
EnableSendfile Off
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Require all granted
</Directory>
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
LogLevel error
ErrorLog ${APACHE_LOG_DIR}/test-error.log
CustomLog ${APACHE_LOG_DIR}/test-access.log combined
</VirtualHost>

View File

@ -0,0 +1,55 @@
<?php
/*
* Generated configuration file
* Generated by: phpMyAdmin 3.4.3.2 setup script
* Date: Wed, 03 Aug 2011 15:15:00 +0200
*/
/* Servers configuration */
$i = 0;
/* Server: localhost [1] */
$i++;
$cfg['Servers'][$i]['verbose'] = 'DEV';
$cfg['Servers'][$i]['host'] = '192.168.33.10';
$cfg['Servers'][$i]['port'] = '';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['controluser'] = 'pma';
$cfg['Servers'][$i]['controlpass'] = 'pmapass';
/* Storage database and tables */
$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
$cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';
$cfg['Servers'][$i]['relation'] = 'pma__relation';
$cfg['Servers'][$i]['table_info'] = 'pma__table_info';
$cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';
$cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';
$cfg['Servers'][$i]['column_info'] = 'pma__column_info';
$cfg['Servers'][$i]['history'] = 'pma__history';
$cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
$cfg['Servers'][$i]['tracking'] = 'pma__tracking';
$cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
$cfg['Servers'][$i]['recent'] = 'pma__recent';
$cfg['Servers'][$i]['favorite'] = 'pma__favorite';
$cfg['Servers'][$i]['users'] = 'pma__users';
$cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
$cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';
$cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches';
$cfg['Servers'][$i]['central_columns'] = 'pma__central_columns';
$cfg['Servers'][$i]['designer_settings'] = 'pma__designer_settings';
$cfg['Servers'][$i]['export_templates'] = 'pma__export_templates';
/* End of servers configuration */
$cfg['ThemeDefault'] = 'original';
$cfg['DefaultLang'] = 'fr';
$cfg['ServerDefault'] = 1;
$cfg['blowfish_secret'] = '4e38214cb34af7.78090185';
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';
$cfg['LoginCookieValidity'] = 3600 * 9;
?>

View File

@ -0,0 +1 @@
GRANT SELECT, INSERT, DELETE, UPDATE, ALTER ON phpmyadmin.* TO 'pma'@'%' IDENTIFIED BY 'pmapass';

View File

@ -0,0 +1 @@
extension=phpchartdir550.dll

View File

@ -0,0 +1 @@
DEVP-2AGF-AAFD-GAEY-BF6F-829C

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,5 @@
[xdebug]
zend_extension=xdebug.so
xdebug.remote_enable = 1
xdebug.remote_port = 9000
xdebug.remote_connect_back = 1

View File

@ -0,0 +1,18 @@
<VirtualHost *:80>
ServerName phpmyadmin.sd.dev
UseCanonicalName On
UseCanonicalPhysicalPort On
DocumentRoot /home/vhosts/phpMyAdmin-4.5.4.1-all-languages
<Directory /home/vhosts/phpMyAdmin-4.5.4.1-all-languages/>
EnableSendfile Off
AllowOverride all
Require all granted
</Directory>
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
LogLevel error
ErrorLog ${APACHE_LOG_DIR}/phpmyadmin-error.log
CustomLog ${APACHE_LOG_DIR}/phpmyadmin-access.log combined
</VirtualHost>

View File

@ -0,0 +1,20 @@
<VirtualHost *:80>
ServerName test.sd.dev
UseCanonicalName On
UseCanonicalPhysicalPort On
DocumentRoot /home/vhosts/test
<Directory /home/vhosts/test/>
# EnableSendFile is disable for performance reason under vagrant
EnableSendfile Off
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Require all granted
</Directory>
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
LogLevel error
ErrorLog ${APACHE_LOG_DIR}/test-error.log
CustomLog ${APACHE_LOG_DIR}/test-access.log combined
</VirtualHost>