forked from Home4Refugees/website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
provision.sh
51 lines (39 loc) · 1.22 KB
/
provision.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
#!/usr/bin/env bash
sudo apt-get update
sudo apt-get install -y git curl php5-cli php5-curl php5-mcrypt php5-gd php5-fpm
### From Installing MySQL
sudo debconf-set-selections <<< 'mysql-server \
mysql-server/root_password password root'
sudo debconf-set-selections <<< 'mysql-server \
mysql-server/root_password_again password root'
sudo apt-get install -y php5-mysql mysql-server
sudo service mysql restart
mysql -uroot -proot -e "CREATE DATABASE home4refugees CHARACTER SET utf8 COLLATE utf8_general_ci;"
### From Installing nginx
sudo apt-get install -y nginx
/bin/cat <<EOM > /etc/nginx/sites-available/default
server {
listen 80;
root /var/www/public;
index index.php;
location / {
try_files \$uri \$uri/ /index.php;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;
include fastcgi_params;
}
}
EOM
sudo service nginx restart
# composer
cd /var/www
curl -sS 'https://getcomposer.org/installer' | php
php composer.phar install
# init laravel
cp .env.example .env
php artisan key:generate
echo "You've been provisioned"