-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.sh
95 lines (75 loc) · 2.29 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# Update Packages
apt-get update
# Upgrade Packages
apt-get upgrade
# Basic Linux Stuff
apt-get install -y git
apt-get install -y sshpass
# Apache
apt-get install -y apache2
# Enable Apache Mods
a2enmod rewrite
#Add Onrej PPA Repo
apt-add-repository ppa:ondrej/php
apt-get update
# Install PHP
apt-get install -y php7.0
apt-get install -y composer
# PHP Apache Mod
apt-get install -y libapache2-mod-php7.0
# Restart Apache
service apache2 restart
# PHP Mods
apt-get install -y php7.0-common
apt-get install -y php7.0-mbstring
apt-get install -y php7.0-zip
apt-get install -y php7.0-gd
apt-get install -y php7.0-mcrypt
apt-get install -y php7.0-curl
apt-get install -y php7.0-xml
apt-get install -y php-imagick
# Set MySQL Pass
debconf-set-selections <<< 'mysql-server mysql-server/root_password password root'
debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root'
# Install MySQL
apt-get install -y mysql-server-5.7
# PHP-MYSQL lib
apt-get install -y php7.0-mysql
apt-get update
# Apache virtualhost configuration
cat > /etc/apache2/sites-available/000-default.conf << EOF
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/public_html
<Directory /var/www/public_html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
EOF
# Install Python v2.7
add-apt-repository ppa:deadsnakes/ppa
apt-get update
apt-get install -y python2.7
# Install nodejs v8.11.4 and gulp
curl -sL https://deb.nodesource.com/setup_8.x -o nodesource_setup.sh
bash nodesource_setup.sh
apt-get install -y nodejs
apt-get install -y build-essential
npm install --global gulp-cli
# Install Yarn
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
apt-get update
apt-get install -y yarn
# Install Ansible v2.6
apt-get install -y python-pip python-dev
pip install ansible==2.6
# Disable MySQL 5.7.5+ ONLY_FULL_GROUP_BY
mysql -uroot -proot -e "SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));"
# Restart Apache
service apache2 restart