-
Notifications
You must be signed in to change notification settings - Fork 1
/
lemp_deb_16.04.sh
97 lines (73 loc) · 2.6 KB
/
lemp_deb_16.04.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
#!/bin/bash
echo "Welcome to Easy LEMP Stack Setup (Ubuntu 16.04) 1.1"
echo "Steap:1 [System Update]"
echo "Update Starts....."
sudo apt-get update
echo -e "System Update Completed Successfully\n"
echo "Step:2 [Install NGINX]"
sudo apt-get install -y nginx
echo -e "NGINX Installation Completed Successfully\n"
echo "Step:3 [Install MySQL]"
sudo apt-get install -y mysql-server mysql-client libmysqlclient-dev
echo -e "MySQL Installation Completed Successfully\n"
echo "Step:4 [Install PHP7.2]"
sudo apt-get install -y software-properties-common
sudo add-apt-repository ppa:ondrej/php -y
sudo apt-get -y update
sudo apt-get install -y php7.2
sudo apt-cache search php7.2
sudo apt-get install -y php7.2-cli php7.2-fpm php7.2-mysql php7.2-curl php7.2-json php7.2-cgi libphp7.2-embed libapache2-mod-php7.2 php7.2-zip php7.2-mbstring php7.2-xml php7.2-intl
echo -e "PHP 7.2 Installation Completed Successfully\n"
sudo systemctl start php7.2-fpm
sudo systemctl enable php7.2-fpm
echo "Step:5 [Install PHPmyadmin]"
sudo apt-get install -y phpmyadmin
echo -e "PHPmyadmin Installation Completed Successfully\n"
sudo systemctl restart nginx
echo "Remove the default symlink in sites-enabled directory"
sudo rm /etc/nginx/sites-enabled/default
cat > /etc/nginx/sites-enabled/default <<EOF
server {
listen 80;
listen [::]:80;
server_name localhost;
root /usr/share/nginx/html/;
index index.php index.html index.htm index.nginx-debian.html;
location / {
try_files $uri $uri/ =404;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ \.php$ {
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
#fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
#include fastcgi_params;
#include snippets/fastcgi-php.conf;
}
location ~ /\.ht {
deny all;
}
}
EOF
sudo nginx -t
sudo systemctl reload nginx
echo "Step:6 [Install curl]"
sudo apt-get install -y curl
echo -e "curl Installation Completed Successfully\n"
echo "Step:7 [Install Git]"
sudo add-apt-repository ppa:git-core/ppa -y
sudo apt-get update
sudo apt-get install -y git
echo -e "Git Installation Completed Successfully\n"
echo "Step:8 [Install mcrypt and enable rewrite]"
sudo service php7.2-fpm restart
sudo systemctl restart nginx
echo -e "mcrypt Installation and enable rewrite Completed Successfully\n"
echo "Step:9 [Install Composer]"
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
echo -e "Composer Installation Completed Successfully\n"
echo "Thanks !!! ~ Your Lemp config has been successfully done"