Stack de WordPress a través de Shell Script

Archivo de configuración básico wp-config.php.

HlPCGG]%E2+@l&r-.P%~3;&U*IRqC!aV%FXLK[qpDT:8E&ma;J#7zn2ip^#~oAKB' );
define( 'NONCE_KEY',        'E3G:]-Jg)=,moprv~l,X,@}8:}$e$yN3{{gu!3hX(kcq:}FUm[9(+$.X!!{+oM=_' );
define( 'AUTH_SALT',        'rZZA^G;IfE3s+kdXPLG4`uG&o&;I|]OP-X^TsA!q7Lo|ZvZ7_UT}>;*u4HiGy*M>' );
define( 'SECURE_AUTH_SALT', '8V?H_oadXXW_fSnOcN1l6n,MjN((JMW`aWT^,]>2{0(iU5&w;X(`0e6bgG$v]3dk' );
define( 'LOGGED_IN_SALT',   'KGq}g



Archivo de configuración básico Nginx (default), faltaría añadir los certificados SSL

server {
    listen 80;
    server_name socialcloud.es;

    #listen 443 ssl http2;

    root /var/www/html/juan;
    index index.php;

    # SSL parameters
    #ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
    #ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
    #ssl_trusted_certificate /etc/letsencrypt/live/example.com/chain.pem;
    #include snippets/ssl.conf;
    #include snippets/letsencrypt.conf;

    # log files
    access_log /var/log/nginx/example.com.access.log;
    error_log /var/log/nginx/example.com.error.log;

    location = /favicon.ico {
        log_not_found off;
        access_log off;
    }

    location = /robots.txt {
        allow all;
        log_not_found off;
        access_log off;
    }

    location / {
        try_files $uri $uri/ /index.php?$args;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php7.3-fpm.sock;
    }

    location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
        expires max;
        log_not_found off;
    }

}

Script para automatizar el despliegue de un stack con WordPress sobre un servidor LEMP (Linux, Nginx, MariaDB y Php7.3) en Debian 9

#! bin/bash

# Actualizacion de repositorios
apt update && apt -y upgrade

# Instalacion de complementos
apt -y install software-properties-common unzip

# Instalacion de la base de datos MariDB
apt -y install mariadb-server mariadb-client

# MariDB Setting
mysql -u root -e "SET PASSWORD FOR root@localhost = PASSWORD('mariadb2019')";
mysql -u root -pjuanreg21 -e "create database WpDemo2019;"
mysql -u root -pjuanreg21 WpDemo2019 -e "create user 'WpDbUser'@'localhost';"
mysql -u root -pjuanreg21 WpDemo2019 -e "grant all privileges on WpDemo2019.* to 'WpDbUser'@'localhost' identified by 'PassWpUser2019*';"

# Reiniciamos el servicio de Mysql
systemctl stop mysql.service
systemctl start mysql.service

# Instalacion del servidor web Nginx
apt -y update && apt -y upgrade && apt -y dist-upgrade && apt -y autoremove
apt -y install nginx nginx-extras

# Reinicamos el servicio de Nginx
systemctl stop nginx.service
systemctl enable nginx.service
systemctl start nginx.service

# Instalacion de Php 7.3
apt -y install apt-transport-https lsb-release ca-certificates
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
apt -y update && apt -y upgrade && apt -y dist-upgrade && apt -y autoremove
apt -y install php7.3 php7.3-fpm php7.3-common php7.3-dev php7.3-cli php7.3-bcmath php7.3-curl php7.3-gd php7.3-imap php7.3-json php7.3-mbstring php7.3-mysql php7.3-opcache php7.3-soap php7.3-xml php7.3-xmlrpc php7.3-zip php-imagick php-libsodium php-ssh2 php-xdebug libgeoip-dev

# Eliminamos el servidor Apache que instala php por defecto
apt -y purge apache2*

# Reiniciamos los servicios de Php7.3-fpm
systemctl stop php7.3-fpm.service
systemctl enable php7.3-fpm.service
systemctl start php7.3-fpm.service

# Eliminamos el directorio html por defecto
cd /var/www/
rm -R html

# Descargar y descomprimir la ultima version de WordPress
wget https://es.wordpress.org/latest-es_ES.zip
unzip latest-es_ES.zip

# Creamos un directorio llamado html
mv wordpress html
rm -R latest-es_ES.zip

# Asignamos permisos recursivos al directorio html
chown -R www-data:www-data html/

# Copiar archivo default en el directorio Nginx
cp ./default /etc/nginx/sites-enabled/

# Copiar el archivo base wp-config.php en el directorio de nuestro wordpress
cp ./wp-config.php /var/www/html/juan