-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap.sh
executable file
·109 lines (94 loc) · 2.23 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#!/usr/bin/env bash
apt-get update
apt-get install -y apache2
rm -rf /var/www
ln -fs /vagrant /var/www
apt-get install -y vim
# Add ServerName to httpd.conf
echo "ServerName localhost" > /etc/apache2/httpd.conf
# Setup hosts file
VHOST=$(cat <<EOF
<VirtualHost *:80>
DocumentRoot "/vagrant/Sites/default"
ServerName localhost
<Directory "/vagrant/Sites/default">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
EOF
)
echo "${VHOST}" > /etc/apache2/sites-enabled/000-default
# Enable mod_rewrite
a2enmod rewrite
# Restart apache
service apache2 restart
# PHP 5.4
# -------
apt-get install -y libapache2-mod-php5
# Add add-apt-repository binary
apt-get install -y python-software-properties
# Install PHP 5.4
add-apt-repository ppa:ondrej/php5
# Update
apt-get update
# PHP stuff
# ---------
# Command-Line Interpreter
apt-get install -y php5-cli
# MySQL database connections directly from PHP
apt-get install -y php5-mysql
# cURL is a library for getting files from FTP, GOPHER, HTTP server
apt-get install -y php5-curl
# Module for MCrypt functions in PHP
apt-get install -y php5-mcrypt
# GD
apt-get install -y php5-gd
# cURL
# ----
apt-get install -y curl
# Mysql
# -----
# Ignore the post install questions
export DEBIAN_FRONTEND=noninteractive
# Install MySQL quietly
apt-get -q -y install mysql-server-5.5
# Git
# ---
apt-get install -y git-core
apt-get install -y git
# Generate a SSH key pair
if [ ! -f /home/vagrant/.ssh/id_rsa.pub ]; then
ssh-keygen -t rsa
echo "########### PUBLIC SSH KEY ###########"
cat /home/vagrant/.ssh/id_rsa.pub
echo "######################################"
fi
# Install Composer
# ----------------
curl -s https://getcomposer.org/installer | php
# Make Composer available globally
mv composer.phar /usr/local/bin/composer
# Install Ruby
# ------------
apt-get install -y ruby-full build-essential
# Install Rubygems
# ----------------
apt-get install -y rubygems
# Install Sass
# ------------
gem install sass
# Install Node JS and NPM
# ---------------
add-apt-repository ppa:richarvey/nodejs
apt-get update
apt-get install -y nodejs nodejs-dev npm
# Upgrade NPM
# -----------
npm update -g npm
# Grunt CLI
# ---------
npm install -g grunt-cli
# IMAP
# ----
apt-get install php5-imap