potblog

技術メモとかガジェットレビューとか

Debian9でwordpressを構築する際のメモ

ipの固定

/etc/network/interfaces

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug enp0s25
#iface enp0s25 inet dhcp
iface enp0s25 inet static
address 192.168.2.104
netmask 255.255.255.0
gateway 192.168.2.1

dbの初期設定
passwordは各自で変更する

$ sudo mariadb
> CREATE DATABASE wordpress DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
> CREATE DATABASE mydb DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
> GRANT ALL ON wordpress.* TO 'wordpressuser'@'localhost' IDENTIFIED BY 'password';
> GRANT ALL ON mydb.* TO 'wordpressuser'@'localhost';
> FLUSH PRIVILEGES;
> exit;

MariaDBのバックアップ

 mysqldump -u wordpressuser -p mydb > /var/www/wordpress/wp-content/themes/penman/backup_db/mydb.sql

MySQL(MariaDB)をオンラインバックアップしてみる