0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【EC2】WordPressが応答しない

Posted at

はじめに

AWSのEC2にWordPressを構築している状況で、インスタンスを停止・再開した際に、パブリックIPアドレスが変わってしまい、WordPress管理画面が開かなくなった。

現象

http://[現在のIPアドレス]/wp-adminを入力したところ、
http://[過去のIPアドレス]/へリダイレクトされる。

対処法

DBの値を変更

mysqlへ接続
WordPressのデータベースを指定

USE <データベース名>;

wp_optionsテーブルから過去のIPアドレスを含むレコードを取得。

select * from wp_options where option_name IN ('siteurl', 'home')\G
*************************** 1. row ***************************
   option_id: 3
 option_name: home
option_value: http://<過去のIPアドレス>
    autoload: on
*************************** 2. row ***************************
   option_id: 2
 option_name: siteurl
option_value: http://<過去のIPアドレス>
    autoload: on
2 rows in set (0.01 sec)

現在のIPアドレスに更新

UPDATE wp_options SET option_value = 'http://<現在のIPアドレス>' WHERE option_name IN ('siteurl', 'home');
Query OK, 2 rows affected (0.01 sec)
Rows matched: 2  Changed: 2  Warnings: 0

更新確認

select * from wp_options where option_name IN ('siteurl', 'home')\G
*************************** 1. row ***************************
   option_id: 3
 option_name: home
option_value: http://<現在のIPアドレス>
    autoload: on
*************************** 2. row ***************************
   option_id: 2
 option_name: siteurl
option_value: http://<現在のIPアドレス>
    autoload: on
2 rows in set (0.00 sec)
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?