-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathlemp-install.sh
More file actions
58 lines (51 loc) · 1.69 KB
/
Copy pathlemp-install.sh
File metadata and controls
58 lines (51 loc) · 1.69 KB
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
#!/bin/bash
scriptPath=$PWD
# add php7 and nginx repos
sudo add-apt-repository -y ppa:nginx/development
sudo add-apt-repository -y ppa:ondrej/php
sudo apt-get update
# install basics
sudo apt-get install -y git tmux vim curl wget zip unzip htop
# Nginx
echo "Installing Nginx"
sudo apt-get install -y nginx
# PHP
echo "Installing PHP 7.1"
sudo apt-get install -y php7.1-fpm php7.1-cli php7.1-mcrypt php7.1-gd php7.1-mysql php7.1-pgsql php7.1-imap php-memcached php7.1-mbstring php7.1-xml php7.1-curl php7.1-bcmath php7.1-sqlite3 php7.1-xdebug
# Composer
echo "Installing Composer"
php -r "readfile('http://getcomposer.org/installer');" | sudo php -- --install-dir=/usr/bin/ --filename=composer
echo "Installing Laravel into /var/www"
#getting a Laravel application up and running:
echo "Installing Laravel application into /var/www/myapp"
cd /var/www
sudo composer create-project laravel/laravel:dev-develop myapp
echo "Configuring Nginx for Laravel myapp "
touch /etc/nginx/sites-available/default
echo '
server {
listen 80 default_server;
root /var/www/myapp/public;
index index.html index.htm index.php;
server_name _;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php7.1-fpm.sock;
}
}
' > /etc/nginx/sites-available/default
chown -R www-data: /var/www/myapp/storage /var/www/myapp/bootstrap
#Restart Nginx
service nginx restart
############### Setting for PHP
echo "Setting php "
/bin/bash $scriptPath/config-php71.sh
sleep 5
echo "Installing Redis"
/bin/bash $scriptPath/install-redis.sh
sleep 5
#echo "Installing Mysql "
#/bin/bash $scriptPath/config-mysql.sh