-
Notifications
You must be signed in to change notification settings - Fork 1
/
provision.sh
52 lines (43 loc) · 2.19 KB
/
provision.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/env bash
# Mise à jour des dépots
apt-get -qq update
# Utils
apt-get -y install rpl
# Configuration de la timezone
echo "Europe/Paris" > /etc/timezone
apt-get install -y tzdata
dpkg-reconfigure -f noninteractive tzdata
# Installation de Apache et PHP
apt-get -y install libapache2-mod-php5 php5-cli php5-curl
mv /tmp/000-default.conf /etc/apache2/sites-available/000-default.conf
a2enmod rewrite
service apache2 restart
# Installation de MySQL
echo "mysql-server mysql-server/root_password password root" | debconf-set-selections
echo "mysql-server mysql-server/root_password_again password root" | debconf-set-selections
apt-get install -y mysql-server
# Installation de PhpMyAdmin
echo "phpmyadmin phpmyadmin/dbconfig-install boolean true" | debconf-set-selections
echo "phpmyadmin phpmyadmin/app-password-confirm password root" | debconf-set-selections
echo "phpmyadmin phpmyadmin/mysql/admin-pass password root" | debconf-set-selections
echo "phpmyadmin phpmyadmin/mysql/app-pass password root" | debconf-set-selections
echo "phpmyadmin phpmyadmin/reconfigure-webserver multiselect apache2" | debconf-set-selections
apt-get install -y phpmyadmin
# Création des bases de données
# -- forum
mysql --defaults-file=/etc/mysql/debian.cnf -e "drop database if exists net_musiquesincongrues_www_forum"
mysql --defaults-file=/etc/mysql/debian.cnf -e "create database net_musiquesincongrues_www_forum default charset utf8 collate utf8_general_ci"
gunzip -c /vagrant/src/data/net_musiquesincongrues_www_forum.dump.sql.gz | mysql --defaults-file=/etc/mysql/debian.cnf net_musiquesincongrues_www_forum
# -- asaph
mysql --defaults-file=/etc/mysql/debian.cnf -e "drop database if exists net_musiquesincongrues_www_asaph"
mysql --defaults-file=/etc/mysql/debian.cnf -e "create database net_musiquesincongrues_www_asaph default charset utf8 collate utf8_general_ci"
# Configuration du projet
apt-get install -y ant git
cd /vagrant
./composer.phar install --prefer-dist --no-progress
ant configure build -Dprofile=vagrant
chmod -R 777 /tmp/symfony/musiques-incongrues
/vagrant/src/symfony/symfony cache:clear
# Mise à disposition du projet dans Apache
ln -sf /vagrant/src/web/* /var/www/html/
rm -f /var/www/html/index.html