I was using WordPress on AWS (AWS Linux instance), but one day suddenly 504 Gateway Time-out came out.
[Wikipedia](https://ja.wikipedia.org/wiki/HTTP%E3%82%B9%E3%83%86%E3%83%BC%E3%82%BF%E3%82%B9%E3% According to 82% B3% E3% 83% BC% E3% 83% 89), 5XX refers to a server error and 504 is "Gateway timeout. Gateway proxy server does not have a proper response from the server inferred from the URI. It means "timed out." It seems to be a problem on AWS because it is an error on the server side.
$ df -h
It is said that you can check the storage capacity, but even if you look at the usage%, the ratio was not particularly high.
$ sudo systemctl status httpd.service
At this time, it was ʻActive: active (running)`, so I misunderstood that it was not a problem on the Apache side, but this was a mistake.
$ sudo systemctl restart httpd.service
This time Apahce seems to have fallen before I knew it, so I restarted Apache with the above command, the 504 error was resolved and the WordPress screen was displayed. Even if you check the status, it seems that it may not be reflected well sometimes, so it is more reliable to check whether the process is started properly with the ps command.
I searched for an online article and tried it as soon as I could, but I should have isolated the problem a little more as shown in the article below.
[People who are not good at infrastructure should know the failure patterns and solutions that do not lead to websites] (https://qiita.com/ykyk1218/items/5a541246e82678b2ece3)
It may be faster to google, but I would like to confirm the cause after predicting the cause with logs etc. in order to improve the infrastructure power.
Recommended Posts