#00013 Step สำหรับการ clone wordpress ขึ้นมาแบบ multiple site

รวม step/script สำหรับการ clone wordpress ขึ้นมาแบบ multiple site

Environment
OS: Ubuntu
DB: MySQL/MariaDB
Web: Apache


unzip latest.zip -d /var/www

mysql -u root

create database wp_note; 
create database wp_exam; 
CREATE USER 'wp_note'@'localhost' IDENTIFIED BY 'password';
CREATE USER 'wp_exam'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON wp_note.* TO 'wp_note'@'localhost';
GRANT ALL PRIVILEGES ON wp_exam.* TO 'wp_exam'@'localhost';

//drop database 'wp_exam'@'localhost';
//flush privileges;
//drop user wp_exam@localhost;

chown -R www-data:www-data note

cp wp-config-sample.php wp-config.php

cd sites-enabled/

cp udemy.conf note.conf

vi note.conf

vi /etc/hosts

a2ensite note.conf

systemctl reload apache2

certbot

config cloudflare
// ห้าม config cloudflare ก่อนทำ certbot เพราะจะ force redirect ไป HTTPS แล้วพบ error #00130

setup wordpress