Now compatible windows, linux, mysql

This commit is contained in:
Michael RICOIS 2014-12-12 16:31:18 +01:00
parent f2afc200f6
commit 4e8c79f471
4 changed files with 49 additions and 36 deletions

View File

@ -40,7 +40,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) 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 "c:\\www", "/home/vhosts", owner: "www-data", group: "www-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.

View File

@ -2,16 +2,8 @@
sudo apt-get -y install htop unzip
# Installation
if [ ! -f /usr/bin/php5 ]
then
sudo apt-get update
sudo apt-get install -y apache2 mysql-client-5.5 php5 php-apc php5-curl php5-xmlrpc php5-xsl php5-mysqlnd
sudo a2enmod autoindex deflate expires headers rewrite
fi
# Installation MariaDB
if [ ! -f /usr/bin/mysql ]
if [ ! -f /etc/mysql/vagrant ]
then
MARIADB_VERSION='10.0'
MYSQL_PASS='scores'
@ -23,19 +15,30 @@ then
sudo apt-get update
sudo apt-get -y install mariadb-server
#sudo sed -i -e 's/datadir = \/var\/lib\/mysql/datadir = \/home\/vhosts\/mysql/g' /etc/mysql/my.cnf
sudo sed -i "s/bind-address = 127.0.0.1/bind-address = 0.0.0.0/" /etc/mysql/my.cnf
mysql -hlocalhost -uroot -pscores < /vagrant/data/pma.sql
sudo service mysql restart
sudo sed -i "s/bind-address = 127.0.0.1/bind-address = 0.0.0.0/" /etc/mysql/my.cnf
sudo service mysql restart
mysql -hlocalhost -uroot -pscores < /vagrant/data/pma.sql
sudo touch /etc/mysql/vagrant
fi
# Installation
if [ ! -f /usr/bin/php5 ]
then
sudo apt-get update
sudo apt-get install -y apache2 mysql-client-5.5 php5 php-apc php5-curl php5-xmlrpc php5-xsl php5-mysqlnd
sudo a2enmod autoindex deflate expires headers rewrite
fi
# Installation phpMyAdmin
PHPMYADMIN_VERSION='4.3.1'
if [ -f "/vagrant/data/phpMyAdmin-$PHPMYADMIN_VERSION-all-languages.zip" && ! -d "/home/vhosts/phpMyAdmin-$PHPMYADMIN_VERSION-all-languages" ]
if [ ! -d "/home/vhosts/phpMyAdmin-$PHPMYADMIN_VERSION-all-languages" ]
then
unzip "/vagrant/data/phpMyAdmin-$PHPMYADMIN_VERSION-all-languages.zip" -d /home/vhosts/
mysql -hlocalhost -uroot -pscores < "/home/vhosts/phpMyAdmin-$PHPMYADMIN_VERSION-all-languages/examples/create_tables.sql"
cp /vagrant/data/config.inc.php "/home/vhosts/phpMyAdmin-$PHPMYADMIN_VERSION-all-languages/"
sudo ln -s "/home/vhosts/phpMyAdmin-$PHPMYADMIN_VERSION-all-languages" /home/vhosts/phpmyadmin
if [ -f "/vagrant/data/phpMyAdmin-$PHPMYADMIN_VERSION-all-languages.zip" ]
then
unzip "/vagrant/data/phpMyAdmin-$PHPMYADMIN_VERSION-all-languages.zip" -d /home/vhosts/
mysql -hlocalhost -uroot -pscores < "/home/vhosts/phpMyAdmin-$PHPMYADMIN_VERSION-all-languages/examples/create_tables.sql"
cp /vagrant/data/config.inc.php "/home/vhosts/phpMyAdmin-$PHPMYADMIN_VERSION-all-languages/"
fi
fi
# Installation Wkhtmltopdf
@ -46,7 +49,12 @@ then
fi
# Configuration Apache
sudo cp /vagrant/data/httpd.conf /etc/apache2/httpd.conf
if [ ! -f /etc/apache2/conf-available/httpd.conf ]
then
sudo cp /vagrant/data/httpd.conf /etc/apache2/conf-available/
sudo mkdir /home/vhosts/apachelog
sudo mkdir /home/vhosts/test
fi
# Configuration PHP / Apache
sudo sed -i -e 's/short_open_tag = Off/short_open_tag = On/g' /etc/php5/apache2/php.ini

View File

@ -40,7 +40,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) 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 "c:\\www", "/home/vhosts", owner: "www-data", group: "www-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.

View File

@ -2,16 +2,8 @@
sudo apt-get -y install htop unzip
# Installation
if [ ! -f /usr/bin/php5 ]
then
sudo apt-get update
sudo apt-get install -y apache2 mysql-client-5.5 php5 php5-apcu php5-curl php5-xmlrpc php5-xsl php5-mysqlnd
sudo a2enmod autoindex deflate expires headers rewrite
fi
# Installation MariaDB
if [ ! -f /usr/bin/mysql ]
if [ ! -f /etc/mysql/vagrant ]
then
MARIADB_VERSION='10.0'
MYSQL_PASS='scores'
@ -23,19 +15,30 @@ then
sudo apt-get update
sudo apt-get -y install mariadb-server
#sudo sed -i -e 's/datadir = \/var\/lib\/mysql/datadir = \/home\/vhosts\/mysql/g' /etc/mysql/my.cnf
sudo sed -i "s/bind-address = 127.0.0.1/bind-address = 0.0.0.0/" /etc/mysql/my.cnf
mysql -hlocalhost -uroot -pscores < /vagrant/data/pma.sql
sudo sed -i "s/bind-address = 127.0.0.1/bind-address = 0.0.0.0/" /etc/mysql/my.cnf
sudo service mysql restart
mysql -hlocalhost -uroot -pscores < /vagrant/data/pma.sql
sudo touch /etc/mysql/vagrant
fi
# Installation
if [ ! -f /usr/bin/php5 ]
then
sudo apt-get update
sudo apt-get install -y apache2 mysql-client-5.5 php5 php5-apcu php5-curl php5-xmlrpc php5-xsl php5-mysqlnd
sudo a2enmod autoindex deflate expires headers rewrite
fi
# Installation phpMyAdmin
PHPMYADMIN_VERSION='4.3.1'
if [ -f "/vagrant/data/phpMyAdmin-$PHPMYADMIN_VERSION-all-languages.zip" && ! -d "/home/vhosts/phpMyAdmin-$PHPMYADMIN_VERSION-all-languages" ]
if [ ! -d "/home/vhosts/phpMyAdmin-$PHPMYADMIN_VERSION-all-languages" ]
then
unzip "/vagrant/data/phpMyAdmin-$PHPMYADMIN_VERSION-all-languages.zip" -d /home/vhosts/
mysql -hlocalhost -uroot -pscores < "/home/vhosts/phpMyAdmin-$PHPMYADMIN_VERSION-all-languages/examples/create_tables.sql"
cp /vagrant/data/config.inc.php "/home/vhosts/phpMyAdmin-$PHPMYADMIN_VERSION-all-languages/"
sudo ln -s "/home/vhosts/phpMyAdmin-$PHPMYADMIN_VERSION-all-languages" /home/vhosts/phpmyadmin
if [ -f "/vagrant/data/phpMyAdmin-$PHPMYADMIN_VERSION-all-languages.zip" ]
then
unzip "/vagrant/data/phpMyAdmin-$PHPMYADMIN_VERSION-all-languages.zip" -d /home/vhosts/
mysql -hlocalhost -uroot -pscores < "/home/vhosts/phpMyAdmin-$PHPMYADMIN_VERSION-all-languages/examples/create_tables.sql"
cp /vagrant/data/config.inc.php "/home/vhosts/phpMyAdmin-$PHPMYADMIN_VERSION-all-languages/"
fi
fi
# Installation Wkhtmltopdf
@ -50,6 +53,8 @@ if [ ! -f /etc/apache2/conf-available/httpd.conf ]
then
sudo cp /vagrant/data/httpd.conf /etc/apache2/conf-available/
sudo a2enconf httpd
sudo mkdir /home/vhosts/apachelog
sudo mkdir /home/vhosts/test
fi
# Configuration PHP / Apache