LEMP WordPress 5.2 Stack (configured for cloudflare dns only)

by maxcontrol
4 deployments · 0 still active · last rev. 16 days ago

Custom LEMP with compiled NGINX.

Compatible with: Ubuntu 18.04 LTS, Ubuntu 18.10, Ubuntu 19.04
						#!/bin/bash

apt update -y
apt upgrade -y

apt install git -y
apt install unzip -y

git clone git://github.com/jblevins1991/NGINX-Compiled.git

cd NGINX-Compiled
git submodule init
git submodule add
./provision.sh

cd /etc/nginx

mv nginx.conf nginx.old
wget -L https://raw.githubusercontent.com/jblevins1991/NGINX-Configuration/master/WordPress/nginx/nginx.conf
chmod --reference=nginx.old nginx.conf
chown --reference=nginx.old nginx.conf

wget -L https://raw.githubusercontent.com/jblevins1991/NGINX-Configuration/master/WordPress/nginx/restrictions.conf
vagr
cd sites-enabled
wget -L https://raw.githubusercontent.com/jblevins1991/NGINX-Configuration/master/WordPress/nginx/wordpress

systemctl start nginx

sudo apt install php-fpm -y

cd /etc/php/7.2/fpm

mv php-fpm.conf php-fpm.old
wget -L https://raw.githubusercontent.com/jblevins1991/NGINX-Configuration/master/WordPress/php/php-fpm.conf
chmod --reference=php-fpm.old php-fpm.conf
chown --reference=php-fpm.old php-fpm.conf

mv php.ini php.old
wget -L https://raw.githubusercontent.com/jblevins1991/NGINX-Configuration/master/WordPress/php/php.ini
chmod --reference=php.old php.ini
chown --reference=php.old php.ini

cd pool.d

wget -L https://raw.githubusercontent.com/jblevins1991/NGINX-Configuration/master/WordPress/php/pool.d/wp.conf
chmod --reference=www.conf wp.conf
chown --reference=www.conf wp.conf
rm www.conf

systemctl restart php7.2-fpm

sudo apt install mysql-server php-mysql -y

mysql_secure_installation <<EOF
n
password
password
y
y
y
y
y
EOF

systemctl restart mysql

sudo mysql --user=root --password=password <<EOF
CREATE DATABASE IF NOT EXISTS wordpress;
CREATE USER 'root'@'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'pma'@'%' WITH GRANT OPTION;
EOF

systemctl restart mysql

apt install unzip -y

cd /var/www
wget -L https://wordpress.org/latest.zip
unzip latest.zip html
chown -R www-data html