-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.sh
More file actions
executable file
·42 lines (29 loc) · 1.24 KB
/
bootstrap.sh
File metadata and controls
executable file
·42 lines (29 loc) · 1.24 KB
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
#!/usr/bin/env bash
sudo debconf-set-selections <<< 'mysql-server-5.5 mysql-server/root_password password rootpass'
sudo debconf-set-selections <<< 'mysql-server-5.5 mysql-server/root_password_again password rootpass'
sudo apt-get update
sudo apt-get -y install make mysql-server-5.5 php5-mysql php5-curl php5-dev php-pear apache2 php5 php5-gd
sudo pecl install xdebug
cp /vagrant/data/php.ini /etc/php5/apache2/php.ini
cp /vagrant/data/my.cnf /etc/mysql/my.cnf
sudo service apache2 restart
if [ ! -f /var/log/databasesetup ];
then
echo "CREATE USER 'wordpressuser'@'localhost' IDENTIFIED BY 'wordpresspass'" | mysql -uroot -prootpass
echo "CREATE DATABASE wordpress" | mysql -uroot -prootpass
echo "GRANT ALL ON wordpress.* TO 'wordpressuser'@'localhost'" | mysql -uroot -prootpass
echo "flush privileges" | mysql -uroot -prootpass
touch /var/log/databasesetup
if [ -f /vagrant/data/wordpress.sql ];
then
mysql -uroot -prootpass wordpress < /vagrant/data/wordpress.sql
fi
fi
if [ ! -h /var/www ];
then
rm -rf /var/www sudo
ln -s /vagrant/public /var/www
a2enmod rewrite
sed -i '/AllowOverride None/c AllowOverride All' /etc/apache2/sites-available/default
service apache2 restart
fi