😺
【infra】(aws ハンズオン)ブラウザを更新すると画面表示が崩れた(wordpress)
原因
ipを固定してないため、変更がwordpressのdbに反映されず、差異が生じたため
rdsログイン
Warning: Permanently added '13.112.121.67' (ECDSA) to the list of known hosts.
Last login: Sun Sep 5 21:48:45 2021 from m106072036034.v4.enabler.ne.jp
__| __|_ )
_| ( / Amazon Linux 2 AMI
___|\___|___|
https://aws.amazon.com/amazon-linux-2/
[ec2-user@ip-10-0-0-240 ~]$ mysql -h database-1.cotqzffqvzlc.ap-northeast-1.rds.amazonaws.com -P 3306 -u wordpress -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is 1842
Server version: 8.0.23 Source distribution
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MySQL [(none)]>
dbスイッチ
use wordpress
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
MySQL [wordpress]>
設定されておるサイトのURL
MySQL [wordpress]> SELECT * FROM wp_options WHERE option_name IN ('siteurl', 'home');
+-----------+-------------+---------------------------------------------------------+----------+
| option_id | option_name | option_value | autoload |
+-----------+-------------+---------------------------------------------------------+----------+
| 2 | home | http://LB-1-2105490641.ap-northeast-1.elb.amazonaws.com | yes |
| 1 | siteurl | http://LB-1-2105490641.ap-northeast-1.elb.amazonaws.com | yes |
+-----------+-------------+---------------------------------------------------------+----------+
2 rows in set (0.00 sec)
MySQL [wordpress]>
ドメイン名に変更
UPDATE wp_options SET option_value = 'https://blog.aws-tano-demo.ga' WHERE option_name IN ('siteurl', 'home');
Query OK, 2 rows affected (0.00 sec)
Rows matched: 2 Changed: 2 Warnings: 0
MySQL [wordpress]>
表示修正成功
MySQL [wordpress]> SELECT * FROM wp_options WHERE option_name IN ('siteurl', 'home');
+-----------+-------------+-------------------------------+----------+
| option_id | option_name | option_value | autoload |
+-----------+-------------+-------------------------------+----------+
| 2 | home | https://blog.aws-tano-demo.ga | yes |
| 1 | siteurl | https://blog.aws-tano-demo.ga | yes |
+-----------+-------------+-------------------------------+----------+
2 rows in set (0.00 sec)
MySQL [wordpress]>
Discussion