aboutsummaryrefslogtreecommitdiff
path: root/wordpress
blob: 93f9880323def5a312a1e27af4c5bd3bb1e35048 (plain) (blame)
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
#!/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