-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap.sh
62 lines (46 loc) · 1.75 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
#!/usr/bin/env bash
# Vagrant config for PyroCMS
# Author: Dan Bough (daniel.bough <at> gmail <dot> com / www.danielbough.com)
# License: GPLv3
# Copyright 2013
# Choose your repo (only tested on 2.2/master)
REPO=2.2/master
# Using mod rewrite? (YES/NO)
REWRITE=YES
# Unlock the root and give it a password? (YES/NO)
ROOT=YES
if [ ! -f /var/log/firsttime ];
then
sudo touch /var/log/firsttime
# Set credentials for MySQL
sudo debconf-set-selections <<< 'mysql-server-5.5 mysql-server/root_password password password'
sudo debconf-set-selections <<< 'mysql-server-5.5 mysql-server/root_password_again password password'
# Install packages
sudo apt-get update
sudo apt-get -y install mysql-server-5.5 php5-mysql apache2 php5 git libapache2-mod-php5
# Add timezones to database
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -uroot -ppassword mysql
# Download PyroCMS
sudo git clone https://github.com/pyrocms/pyrocms.git -b $REPO
# Move Pyro to its new home.
sudo rm -f /var/www/*
sudo mv pyrocms/* /var/www/
# Remove repo folder (we don't need it anymore).
sudo rm -r -f pyrocms/
# Allow URL rewrites
sudo a2enmod rewrite
sudo sed -i '/AllowOverride None/c AllowOverride All' /etc/apache2/sites-available/default
# php5-mysql comes w/mysql drivers, but we still have to update php.ini to use them.
sudo sed -i 's/;pdo_odbc.db2_instance_name/;pdo_odbc.db2_instance_name\nextension=pdo_mysql.so/' /etc/php5/apache2/php.ini
sudo service apache2 restart
fi
# Copy add htaccess file if you're rewriting URLs
if [ $REWRITE = 'YES' ]
then
sudo cp /home/vagrant/shared/htaccess /var/www/.htaccess
fi
if [ $ROOT = 'YES' ]
then
sudo usermod -U root
echo -e "password\npassword" | sudo passwd root
fi