From 4224eff4b4f6e688183e724bbcf40beca959d3fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Villard?= Date: Fri, 18 Sep 2015 06:49:06 +0200 Subject: [PATCH 1/7] Ajout du .gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..591e112 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.idea/ +.vagrant/ From 3ba0e49e0c39e560d1ad94b3cb2434c91d219258 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Villard?= Date: Fri, 18 Sep 2015 06:49:45 +0200 Subject: [PATCH 2/7] Initialisation Vagrantfile --- Vagrantfile | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 Vagrantfile diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 0000000..6a45434 --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,6 @@ +Vagrant.configure("2") do |config| + + config.vm.box = "debian/jessie64" + config.vm.box_url = "https://atlas.hashicorp.com/debian/boxes/jessie64/versions/8.2.0/providers/virtualbox.box" + +end \ No newline at end of file From 4440103c9f76d4a9cf37d41db5e75163adfd12f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Villard?= Date: Fri, 18 Sep 2015 06:52:35 +0200 Subject: [PATCH 3/7] =?UTF-8?q?Ajout=20du=20hostname=20+=20des=20dossiers?= =?UTF-8?q?=20=C3=A0=20synchro=20de=20la=20VM?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Vagrantfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Vagrantfile b/Vagrantfile index 6a45434..9d67f09 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -3,4 +3,9 @@ Vagrant.configure("2") do |config| config.vm.box = "debian/jessie64" config.vm.box_url = "https://atlas.hashicorp.com/debian/boxes/jessie64/versions/8.2.0/providers/virtualbox.box" + config.vm.hostname = "ezplatform" + + config.vm.synced_folder ".", "/vagrant", disabled: true + config.vm.synced_folder ".", "/var/www/html", create: true, group: "www-data", owner: "vagrant" + end \ No newline at end of file From e568aa52d347c7201c1cce353289caa1a5a69ee7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Villard?= Date: Wed, 7 Oct 2015 22:20:14 +0200 Subject: [PATCH 4/7] =?UTF-8?q?Configuration=20cpu=20+=20ram=20+=20dossier?= =?UTF-8?q?=20partag=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Vagrantfile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index 9d67f09..c083941 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -3,9 +3,18 @@ Vagrant.configure("2") do |config| config.vm.box = "debian/jessie64" config.vm.box_url = "https://atlas.hashicorp.com/debian/boxes/jessie64/versions/8.2.0/providers/virtualbox.box" + config.vm.provider "virtualbox" do |v| + v.customize ["modifyvm", :id, "--cpus", "2"] + v.customize ["modifyvm", :id, "--memory", "2048"] + end + config.vm.hostname = "ezplatform" + config.vm.network :forwarded_port, guest: 80, host: 8080, auto_correct: true config.vm.synced_folder ".", "/vagrant", disabled: true - config.vm.synced_folder ".", "/var/www/html", create: true, group: "www-data", owner: "vagrant" + config.vm.synced_folder ".", "/var/www/html", create: true, + owner: "vagrant", + group: "www-data", + mount_options: ["dmode=775,fmode=664"] end \ No newline at end of file From 5c98194d6a1c1cefa6ea7a632a7b1a1c2d32c26b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Villard?= Date: Wed, 7 Oct 2015 22:21:32 +0200 Subject: [PATCH 5/7] =?UTF-8?q?Mise=20en=20place=20du=20serveur=20lamp=20+?= =?UTF-8?q?=20outils=20n=C3=A9cessaire=20pour=20ezplatform?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Vagrantfile | 2 ++ bin/setup.sh | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 bin/setup.sh diff --git a/Vagrantfile b/Vagrantfile index c083941..8ef3ff8 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -17,4 +17,6 @@ Vagrant.configure("2") do |config| group: "www-data", mount_options: ["dmode=775,fmode=664"] + config.vm.provision "shell", path: "bin/setup.sh" + end \ No newline at end of file diff --git a/bin/setup.sh b/bin/setup.sh new file mode 100644 index 0000000..38758da --- /dev/null +++ b/bin/setup.sh @@ -0,0 +1,51 @@ +#!/bin/bash + +echo "Provisioning virtual machine..." + +echo "Installing common packages" +apt-get -y update +apt-get -y install vim curl unzip git debconf-utils + +echo "Installing Apache + activate modules" +apt-get -y install apache2 +a2enmod rewrite headers expires deflate + +echo "Destroy default configuration Apache" +if [ -f /etc/apache2/sites-available/000-default.conf ] +then + rm -f /etc/apache2/sites-available/000-default.conf + rm -f /etc/apache2/sites-enabled/000-default.conf +fi +if [ -f /etc/apache2/sites-available/default-ssl.conf ] +then + rm -f /etc/apache2/sites-available/default-ssl.conf +fi +if [ -f /var/www/html/index.html ] +then + rm -f /var/www/html/index.html +fi + +echo "Installing mysql" +debconf-set-selections <<< "mysql-server mysql-server/root_password password ezplatform" +debconf-set-selections <<< "mysql-server mysql-server/root_password_again password ezplatform" +apt-get -y install mysql-server + +echo "Installing php + modules" +apt-get -y install php5 php5-mysql php5-xsl php5-intl php5-curl php5-gd + +echo "Installing APC" +apt-get -y install php-pear +pear upgrade pear +apt-get -y install php-apc +ln -s /usr/share/doc/php-apc/apc.php /var/www/apc.php + +echo "Installing imagemagick" +apt-get -y install imagemagick + +echo "Installing Java jre7 + utils packages for solr engine search" +apt-get -y install openjdk-7-jre poppler-utils wv + +echo "Restart Apache for the config to take effect" +service apache2 restart + +echo "Finished provisioning." \ No newline at end of file From 8274d1d4c9e03381b742cb9cc46e0c463f1601c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Villard?= Date: Wed, 7 Oct 2015 22:22:07 +0200 Subject: [PATCH 6/7] Mise en place du script shell pour l'installation d'ezplatform --- Vagrantfile | 1 + bin/ezplatform.sh | 56 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 bin/ezplatform.sh diff --git a/Vagrantfile b/Vagrantfile index 8ef3ff8..e3557de 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -18,5 +18,6 @@ Vagrant.configure("2") do |config| mount_options: ["dmode=775,fmode=664"] config.vm.provision "shell", path: "bin/setup.sh" + config.vm.provision "shell", path: "bin/ezplatform.sh" end \ No newline at end of file diff --git a/bin/ezplatform.sh b/bin/ezplatform.sh new file mode 100644 index 0000000..7d52a44 --- /dev/null +++ b/bin/ezplatform.sh @@ -0,0 +1,56 @@ +#!/bin/bash + +echo "Installing eZPLatform on virtual machine..." + +echo "Download ezplatform by composer..." +rm -rf /var/www/html/ezplatform && cd /var/www/html +curl -s http://getcomposer.org/installer | php +php -d memory_limit=-1 composer.phar create-project --no-dev ezsystems/ezplatform /var/www/html/ezplatform + +echo "Create database for eZPlatform" +DB_NAME="ezplatform" +DB_PASSWD="ezplatform" +DB_RESULT=`mysqlshow -u root -p$DB_PASSWD $DB_NAME | grep -v Wildcard | grep -o $DB_NAME` +if [ "$DB_RESULT" == $DB_NAME ] + # if it's already installed, just indicate such + then + echo "Database $DB_NAME already installed." + + # if it's not installed, install it using the daptive_dma profile + else + echo "Database $DB_NAME not yet installed... installing using mysql" + mysql -u root -p$DB_PASSWD -e "CREATE DATABASE IF NOT EXISTS $DB_NAME CHARACTER SET utf8;" +fi + +echo "Update database settings for ezplatform..." +sed -i 's/database_password:/database_password: ezplatform/g' /var/www/html/ezplatform/ezpublish/config/parameters.yml.dist +sed -i 's/database_password: null/database_password: ezplatform/g' /var/www/html/ezplatform/ezpublish/config/parameters.yml + +echo "Implementation of eZPlatform vhost..." +cp /var/www/html/ezplatform/doc/apache2/vhost.template /etc/apache2/sites-available/ezplatform.conf +sed -i 's/%IP_ADDRESS%/*/g' /etc/apache2/sites-available/ezplatform.conf +sed -i 's/%PORT%/80/g' /etc/apache2/sites-available/ezplatform.conf +sed -i 's/%HOST%/ezplatform.local/g' /etc/apache2/sites-available/ezplatform.conf +sed -i 's/%HOST_ALIAS%/admin.ezplatform.local/g' /etc/apache2/sites-available/ezplatform.conf +sed -i 's/%BASEDIR%/\/var\/www\/html\/ezplatform/g' /etc/apache2/sites-available/ezplatform.conf +sed -i 's/%ENV%/dev/g' /etc/apache2/sites-available/ezplatform.conf +sed -i 's/AllowOverride None/AllowOverride all/g' /etc/apache2/sites-available/ezplatform.conf +sed -i 's/#SetEnv CUSTOM_CLASSLOADER_FILE/SetEnv CUSTOM_CLASSLOADER_FILE/g' /etc/apache2/sites-available/ezplatform.conf +sed -i 's/#SetEnv USE_HTTP_CACHE 1/SetEnv USE_HTTP_CACHE 1/g' /etc/apache2/sites-available/ezplatform.conf + +echo "Update php.ini..." +sed -i 's/;date.timezone =/date.timezone = "Europe\/Paris"/g' /etc/php5/apache2/php.ini +sed -i 's/max_execution_time = 30/max_execution_time = 60/g' /etc/php5/apache2/php.ini +sed -i 's/max_input_time = 60/max_input_time = 120/g' /etc/php5/apache2/php.ini +sed -i 's/memory_limit = 128M/memory_limit = 2048M/g' /etc/php5/apache2/php.ini + +echo "Run installation command..." +cd /var/www/html/ezplatform && rm -rf ezpublish/cache/* +cd /var/www/html/ezplatform && php -d memory_limit=-1 ezpublish/console ezplatform:install demo + +echo "Restart Apache2..." +cd /etc/apache2/sites-available +a2ensite ezplatform.conf +service apache2 restart + +echo "Finished installing eZPlatform." \ No newline at end of file From 4251bce8ae9412d4985cf5c0e3d623dc64c2f05b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Villard?= Date: Wed, 7 Oct 2015 22:22:37 +0200 Subject: [PATCH 7/7] Update .gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 591e112..7c3bfde 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ .idea/ .vagrant/ +ezplatform/ +composer.phar \ No newline at end of file