forked from shanethehat/zf2-doctrine-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.sh
50 lines (39 loc) · 1.3 KB
/
bootstrap.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
#!/usr/bin/env bash
# Use single quotes instead of double quotes to make it work with special-character passwords
PASSWORD='assessfirst'
sudo apt-get install python-software-properties software-properties-common
sudo LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
# update / upgrade
sudo apt-get update
sudo apt-get -y upgrade
# install apache 2.5 and php 5.5
sudo apt-get install -y apache2
sudo apt-get install -y php7.0
# install mysql and give password to installer
sudo debconf-set-selections <<< "mysql-server mysql-server/root_password password $PASSWORD"
sudo debconf-set-selections <<< "mysql-server mysql-server/root_password_again password $PASSWORD"
sudo apt-get -y install mysql-server
sudo apt-get install php7.0-mysql
sudo apt-get install -y php-xml
sudo apt-get install -y php7.0-mbstring
# setup hosts file
VHOST=$(cat <<EOF
<VirtualHost *:80>
DocumentRoot "/var/www/html/public"
<Directory "/var/www/html/">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
EOF
)
echo "${VHOST}" > /etc/apache2/sites-available/000-default.conf
# enable mod_rewrite
sudo a2enmod rewrite
# restart apache
service apache2 restart
# install git
sudo apt-get -y install git
# install Composer
curl -s https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer