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?

More than 3 years have passed since last update.

wordpressの小さいエラーを解決していく

Last updated at Posted at 2021-04-21

wordpressのエラー解決その1 DBが立ち上がってなかったとき

初投稿です。これからQiitaで日々のQuickFixを記録に残していこうと思います。
以下の環境でWordpressサイトを構築しており、関連したTipsになる予定です。

環境

AWS EC2 Amazonlinux2
Nginx 
MariaDB
wordpress
Rails

問題と解決

今までアクセスできていたトップページにアクセスすると502エラーが発生
The page you are looking for is temporarily unavailable. Please try again later.

原因調べようとエラーログを見ようとしたが特に何も出力されてなかったので原因はwordpressのほうにありそうだ

/etc/nginx/nginx.conf

http {
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile            on;
    tcp_nopush          on;
    tcp_nodelay         on;
    keepalive_timeout   65;
    types_hash_max_size 4096;

    include             /etc/nginx/mime.types;
    default_type        application/octet-stream;

    # Load modular configuration files from the /etc/nginx/conf.d directory.
    # See http://nginx.org/en/docs/ngx_core_module.html#include
    # for more information.
    include /etc/nginx/conf.d/*.conf;

起動しているサービスを調べたらmariaDBが起動していない

$ sudo service mariadb status
Redirecting to /bin/systemctl status mariadb.service
● mariadb.service - MariaDB database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)
   Active: inactive (dead)

wordpressとかの更新で再起動した際に止まったのかも
自動開始する設定を入れる
disabledなので現在は自動開始しない

$ systemctl is-enabled mariadb
disabled

以下のコマンドで自動開始するよう設定を変更

$ sudo systemctl enable mariadb
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.

引用

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?