From a945feb02f6d64df2219ea1044251a7fe2ea98fc Mon Sep 17 00:00:00 2001 From: Mateja Date: Sat, 3 Apr 2021 00:37:03 +0200 Subject: Initial commit. --- wordpress | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 wordpress (limited to 'wordpress') diff --git a/wordpress b/wordpress new file mode 100644 index 0000000..93f9880 --- /dev/null +++ b/wordpress @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +# Setup LEMP stack before this. + +# MariaDB + CREATE DATABASE wordpress DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci; + GRANT ALL ON wordpress.* TO 'wpuser'@'localhost' IDENTIFIED BY 'WP_DB_PASSWORD'; + FLUSH PRIVILEGES; + EXIT; + +# WordPress +# Download and set up WordPress +cd /tmp +curl -LO https://wordpress.org/latest.tar.gz +tar xzvf latest.tar.gz +cp /tmp/wordpress/wp-config-sample.php /tmp/wordpress/wp-config.php + +#WP-CONFIG +# Salts +curl -s https://api.wordpress.org/secret-key/1.1/salt/ >> wp-config.php +# DB connect +define('DB_NAME', 'wordpress'); +define('DB_USER', 'wpuser'); +define('DB_PASSWORD', 'WP_DB_PASSWORD'); +define('FS_METHOD', 'direct'); + +# Copy wp to www +cp -a /tmp/wordpress/. /var/www/example.com +chown -R www-data:www-data /var/www/example.com + +#END +systemctl restart nginx -- cgit v1.2.3