Nouvel configuration

This commit is contained in:
Michael RICOIS 2014-12-18 23:03:15 +01:00
parent 89c1cee020
commit 594ad797c1
2 changed files with 27 additions and 11 deletions

View File

@ -121,6 +121,12 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
#
# chef.validation_client_name = "ORGNAME-validator"
config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--memory", "768"]
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
end
config.vm.provision :shell, :path => "./bootstrap.sh"
end

View File

@ -1,23 +1,26 @@
#!/usr/bin/env bash
sudo apt-get update
sudo apt-get upgrade
sudo apt-get -y install htop unzip
# Installation MariaDB
MARIADB_VERSION='10.0'
MYSQL_PASS=scores
if [ ! -f /etc/mysql/vagrant ]
then
MARIADB_VERSION='10.0'
MYSQL_PASS='scores'
debconf-set-selections <<< "mariadb-server-$MARIADB_VERSION mysql-server/root_password password $MYSQL_PASS"
debconf-set-selections <<< "mariadb-server-$MARIADB_VERSION mysql-server/root_password_again password $MYSQL_PASS"
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 http://nwps.ws/pub/mariadb/repo/10.0/ubuntu trusty main'
sudo apt-get update
sudo apt-get -y install mariadb-server
debconf-set-selections <<< "mariadb-server-$MARIADB_VERSION mysql-server/root_password password $MYSQL_PASS"
debconf-set-selections <<< "mariadb-server-$MARIADB_VERSION mysql-server/root_password_again password $MYSQL_PASS"
sudo apt-get -y --allow-unauthenticated 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
sudo sed -i "s/bind-address *= 127.0.0.1/bind-address = 0.0.0.0/" /etc/mysql/my.cnf
sudo sed -i "s/max_connections *= 100/max_connections = 20/" /etc/mysql/my.cnf
sudo service mysql restart
mysql -hlocalhost -uroot -pscores < /vagrant/data/pma.sql
mysql -hlocalhost -uroot -p$MYSQL_PASS < /vagrant/data/pma.sql
sudo touch /etc/mysql/vagrant
fi
@ -43,7 +46,7 @@ then
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"
mysql -hlocalhost -uroot -p$MYSQL_PASS < "/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
@ -80,8 +83,15 @@ 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
if [ ! -d /home/vhosts/apachelog ]
then
sudo mkdir /home/vhosts/apachelog
fi
if [ ! -d /home/vhosts/test ]
then
sudo mkdir /home/vhosts/test
fi
fi
if [ ! -f /vagrant/vhosts/phpmyadmin.conf ]