aboutsummaryrefslogtreecommitdiff
path: root/wordpress
diff options
context:
space:
mode:
authorMateja <mail@matejamaric.com>2021-04-03 00:37:03 +0200
committerMateja <mail@matejamaric.com>2021-04-03 00:37:03 +0200
commita945feb02f6d64df2219ea1044251a7fe2ea98fc (patch)
treefe0242495eb35317fd5358e403a047657dfa04b5 /wordpress
downloadmisc-a945feb02f6d64df2219ea1044251a7fe2ea98fc.tar.gz
misc-a945feb02f6d64df2219ea1044251a7fe2ea98fc.zip
Initial commit.
Diffstat (limited to 'wordpress')
-rw-r--r--wordpress31
1 files changed, 31 insertions, 0 deletions
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