This repository was archived by the owner on Jan 30, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlemp.sh
More file actions
90 lines (82 loc) · 3.06 KB
/
lemp.sh
File metadata and controls
90 lines (82 loc) · 3.06 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
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
#!/bin/bash
# GET ALL USER INPUT
tput setaf 2; echo "Domain Name (eg. example.com)?"
read DOMAIN
tput setaf 2; echo "Username (eg. database name)?"
read USERNAME
tput setaf 2; echo " MySQL ROOT Password?"
read DBRPASS
tput setaf 2; echo "Updating OS..."
sleep 2;
tput sgr0
sudo add-apt-repository ppa:ondrej/php -y
sudo apt-get update
tput setaf 2; echo "Installing Nginx"
sleep 2;
tput sgr0
sudo apt-get install nginx zip unzip curl wget git pwgen -y
tput setaf 2; echo "Please wait..."
sleep 2;
tput sgr0
cd /etc/nginx/sites-available/
sudo wget -qO "$DOMAIN" https://raw.githubusercontent.com/endree-eph/LEMP-Stack/master/example.com.conf
sudo sed -i -e "s/example.com/$DOMAIN/" "$DOMAIN"
sudo ln -s /etc/nginx/sites-available/"$DOMAIN" /etc/nginx/sites-enabled/
sudo mkdir -p /var/www/"$DOMAIN"
cd /var/www/"$DOMAIN"
cd ~
tput setaf 2; echo "Nginx server installation completed.."
sleep 2;
tput sgr0
cd ~
sudo chown www-data:www-data -R /var/www/"$DOMAIN"
sudo systemctl restart nginx.service
tput setaf 2; echo "let's install php 7.4 and modules"
sleep 2;
tput sgr0
sudo apt install php7.4 php7.4-fpm -y
sudo apt-get -y install php7.4 php7.4-fpm php7.4-mysql php-common php7.4-cli php7.4-common php7.4-json php7.4-opcache php7.4-readline php7.4-mbstring php7.4-xml php7.4-gd php7.4-curl php-memcached php-imagick php-memcache memcached graphviz php-pear php-xdebug php-msgpack
tput setaf 2; echo "Some php.ini Tweaks"
sleep 2;
tput sgr0
sudo sed -i "s/post_max_size = .*/post_max_size = 2000M/" /etc/php/7.4/fpm/php.ini
sudo sed -i "s/memory_limit = .*/memory_limit = 3000M/" /etc/php/7.4/fpm/php.ini
sudo sed -i "s/upload_max_filesize = .*/upload_max_filesize = 100M/" /etc/php/7.4/fpm/php.ini
sudo sed -i "s/max_execution_time = .*/max_execution_time = 18000/" /etc/php/7.4/fpm/php.ini
sudo sed -i "s/;max_input_vars = .*/max_input_vars = 5000/" /etc/php/7.4/fpm/php.ini
sudo sed -i "s/max_input_time = .*/max_input_time = 1000/" /etc/php/7.4/fpm/php.ini
sudo systemctl restart php7.4-fpm.service
tput setaf 2; echo "Instaling MariaDB"
sleep 2;
tput sgr0
sudo apt install mariadb-server mariadb-client php7.4-mysql -y
sudo systemctl restart php7.4-fpm.service
sudo mysql -e "SET PASSWORD FOR root@localhost = PASSWORD('$DBRPASS');FLUSH PRIVILEGES;"
printf "$DBRPASS\n n\n n\n y\n y\n y\n y\n" | sudo mysql_secure_installation
PASS=`pwgen -s 14 1`
mysql -u root -p$DBRPASS <<EPH
CREATE DATABASE $USERNAME;
CREATE USER '$USERNAME'@'localhost' IDENTIFIED BY '$PASS';
GRANT ALL PRIVILEGES ON $USERNAME.* TO '$USERNAME'@'localhost';
FLUSH PRIVILEGES;
EPH
echo
echo
tput setaf 2; echo "Here is your Credentials"
echo "--------------------------------"
echo "Website: $DOMAIN"
echo
tput setaf 4; echo "Database Name: $USERNAME"
tput setaf 4; echo "Database Username: $USERNAME"
tput setaf 4; echo "Database Password: $PASS"
tput setaf 4; echo "MySQL ROOT Password: $DBRPASS"
echo "--------------------------------"
tput sgr0
echo
echo
tput setaf 3; echo "Installation & configuration succesfully finished."
echo
echo "Website: https://ooshi.space"
echo "E-mail: support@ooshi.space"
echo "Good luck!"
tput sgr0