forked from mikkohei13/vagrant_test
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.sh
120 lines (88 loc) · 3.86 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
110
111
112
113
114
115
116
117
118
119
120
#!/usr/bin/env bash
# ----------------------------------------
# https://github.com/Divi/VagrantBootstrap
# ----------------------------------------
# Include parameteres file
# ------------------------------------------------
source /vagrant/bootstrap_parameters.sh
# Update the box release repositories
# ------------------------------------------------
apt-get update
# APACHE
# ------------------------------------------------
apt-get install -y apache2
# Add ServerName to httpd.conf for localhost
echo "ServerName localhost" > /etc/apache2/httpd.conf
# Enable "mod_rewrite"
a2enmod rewrite
# PHP 5.x
# ------------------------------------------------
apt-get install -y php5 libapache2-mod-php5
# Install "add-apt-repository" binaries
apt-get install -y python-software-properties
# Drivers
apt-get install -y php5-cli
apt-get install -y php5-mysql
# Tools
apt-get install -y php5-curl php5-mcrypt php5-gd php-pear php5-xdebug php5-intl php5-dev
# php.ini
# Setting the timezone
PHP_TIMEZONE="Europe/Helsinki"
sed 's#;date.timezone\([[:space:]]*\)=\([[:space:]]*\)*#date.timezone\1=\2\"'"$PHP_TIMEZONE"'\"#g' /etc/php5/apache2/php.ini > /etc/php5/apache2/php.ini.tmp
mv /etc/php5/apache2/php.ini.tmp /etc/php5/apache2/php.ini
sed 's#;date.timezone\([[:space:]]*\)=\([[:space:]]*\)*#date.timezone\1=\2\"'"$PHP_TIMEZONE"'\"#g' /etc/php5/cli/php.ini > /etc/php5/cli/php.ini.tmp
mv /etc/php5/cli/php.ini.tmp /etc/php5/cli/php.ini
# Showing error messages
sed 's#display_errors = Off#display_errors = On#g' /etc/php5/apache2/php.ini > /etc/php5/apache2/php.ini.tmp
mv /etc/php5/apache2/php.ini.tmp /etc/php5/apache2/php.ini
sed 's#display_startup_errors = Off#display_startup_errors = On#g' /etc/php5/apache2/php.ini > /etc/php5/apache2/php.ini.tmp
mv /etc/php5/apache2/php.ini.tmp /etc/php5/apache2/php.ini
sed 's#error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT#error_reporting = E_ALL#g' /etc/php5/apache2/php.ini > /etc/php5/apache2/php.ini.tmp
mv /etc/php5/apache2/php.ini.tmp /etc/php5/apache2/php.ini
# Essential packages
# ------------------
apt-get install -y build-essential git curl g++ libssl-dev apache2-utils
# MONGO
# ------------------------------------------------
# http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
sudo apt-get update
sudo apt-get install mongodb-10gen
# MongoDB driver, has to be after PHP Pear install
sudo pecl install mongo
sudo sed -i '$ a\extension=mongo.so' /etc/php5/apache2/php.ini
# Ruby & Rubygems
# ------------------------------------------------
# http://ndever.net/articles/linux/installing-sass-and-compass-ubuntu-1210-1304
sudo apt-get install -y ruby-full rubygems
# Node.js & Node Package Manager
# ------------------------------------------------
# http://stackoverflow.com/questions/16302436/install-nodejs-on-ubuntu-12-10
sudo add-apt-repository -y ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install -y nodejs
# SASS & Compass & Foundation SASS
# ------------------------------------------------
# http://ndever.net/articles/linux/installing-sass-and-compass-ubuntu-1210-1304
sudo gem install sass
sudo gem install compass
sudo npm install -g bower grunt-cli --no-bin-links # https://github.com/semmypurewal/node-dev-bootstrap
sudo gem install foundation
# MySQL
# ------------------------------------------------
export DEBIAN_FRONTEND=noninteractive
apt-get install -y mysql-server
apt-get install -y mysql-client
# Directories
# ------------------------------------------------
rm -rf /var/www
mkdir -p /vagrant/www
ln -fs /vagrant/www /var/www
# Finalize
# ------------------------------------------------
# Update repositories
apt-get update -y
#apt-get upgrade -y
# Finally, restart apache
sudo service apache2 restart