-
Notifications
You must be signed in to change notification settings - Fork 42
/
isle-init.sh
49 lines (42 loc) · 1.5 KB
/
isle-init.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
mysql -uroot -p'root' << EOF
CREATE DATABASE isle_dev;
exit
EOF
# Disable default scotchbox site
a2dissite scotchbox.local
# Add site configuration for ISLE
cp /var/www/isle.local.conf /etc/apache2/sites-available/isle.local.conf
a2ensite isle.local
# Initialize db tables and data for each instance.
mysql -uroot -p'root' -h localhost isle_dev < "/var/www/instances/myinstance/init.sql"
mysql -uroot -p'root' -h localhost isle_dev < "/var/www/instances/myinstance/data.sql"
mysql -uroot -p'root' -h localhost isle_dev < "/var/www/instances/myinstance2/init.sql"
mysql -uroot -p'root' -h localhost isle_dev < "/var/www/instances/myinstance2/data.sql"
# Create apache conf for each instance.
cp /var/www/instances/myinstance/isle.local.myinstance.conf /etc/apache2/sites-available/isle.local.myinstance.conf
a2ensite isle.local.myinstance
cp /var/www/instances/myinstance2/isle.local.myinstance2.conf /etc/apache2/sites-available/isle.local.myinstance2.conf
a2ensite isle.local.myinstance2
# Create logrotate conf for each instance.
cat <<EOT >> /etc/logrotate.d/isle-myinstance
/var/www/instances/myinstance/logs/*.log {
yearly
maxsize 2M
rotate 5
notifempty
missingok
su vagrant vagrant
}
EOT
cat <<EOT >> /etc/logrotate.d/isle-myinstance2
/var/www/instances/myinstance2/logs/*.log {
yearly
maxsize 2M
rotate 5
notifempty
missingok
su vagrant vagrant
}
EOT
# Restart Apache for conf changes to take effect
service apache2 reload