Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
0
Help us understand the problem. What is going on with this article?
@kekosaka21762

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

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
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
0
Help us understand the problem. What is going on with this article?