Website getting down periodically

0

I have a WordPress website hosted with AWS Lightsail. I have seen 503 error and connection refused error many times when the website cannot load. I have checked it on the AWS Lightsail dashboard but can not see unusual activity. Also, by using an external tool there is nothing has been found. But the issue still persists. I have tried to check server status with SSH using "sudo /opt/bitnami/ctlscript.sh status apache" and it responds "Apache is not running". After rebooting the instance, it works but it goes down again after a few hours. I have read some answers in re:Post and articles but it is not working in this case.

Please help to find the solution

asked 7 months ago285 views
2 Answers
1

Hi Vijay,

Frequent server downtimes and 503 errors on your WordPress website hosted on AWS Lightsail can be caused by a variety of issues. It's essential to diagnose and troubleshoot the problem step by step to identify the root cause and implement a solution. Here are some steps to help you resolve the issue:

  1. Check Server Resources:

    • Insufficient server resources, such as CPU, memory, or storage, can lead to server crashes and 503 errors. Check your AWS Lightsail instance's resource utilization and consider upgrading if needed.
  2. Review Apache Logs:

    • Examine Apache error logs (typically located at /opt/bitnami/apache2/logs/error_log) for any error messages or warnings that may indicate the cause of the server crashes.
  3. Examine Access Logs:

    • Analyze Apache access logs (located at /opt/bitnami/apache2/logs/access_log) for any unusual or excessive traffic patterns, such as a sudden increase in requests that may be overwhelming the server.
  4. Check for Plugins/Themes:

    • WordPress plugins or themes can sometimes cause server instability. Disable or remove any recently installed or suspicious plugins and themes, and then monitor the server's stability.
  5. Optimize WordPress:

    • Ensure your WordPress website is optimized for performance. Use caching plugins, optimize images, and minimize the use of resource-intensive plugins.
  6. Security Scanning:

    • Perform a security scan of your WordPress website to check for vulnerabilities or malware. Malicious activities can overload the server and lead to downtime.
  7. Monitoring and Alerts:

    • Set up server monitoring and alerts to be notified of resource spikes or server failures promptly. AWS CloudWatch can be used for this purpose.
  8. Auto Restart:

    • Consider setting up a script or a service that automatically restarts the Apache server if it goes down. While this may not address the root cause, it can provide temporary relief.
  9. Load Testing:

    • Perform load testing on your website to simulate high traffic scenarios and identify any performance bottlenecks. Tools like Apache JMeter or Loader.io can be used for this.
  10. AWS Support:

    • If the issue persists and you cannot identify the root cause, consider reaching out to AWS Support for assistance. They can help diagnose server issues specific to AWS Lightsail.
  11. Backup and Recovery:

    • Ensure you have regular backups of your website and server configurations. This will allow you to quickly restore your website in case of any major issues or data loss.
  12. Scaling:

    • If your website experiences frequent traffic spikes, consider scaling your AWS Lightsail instance horizontally or vertically to handle the increased load.

Remember to document any changes or actions you take during the troubleshooting process. This will help you track the effectiveness of your solutions and assist in further diagnostics if needed. Frequent server downtimes can be challenging to diagnose, but with a systematic approach, you can identify and resolve the underlying issues.

profile picture
answered 7 months ago
  • I have server with 2CPUs, 4GB ,80GB Plugins and theme are working properly I have installed Wordfence security and there is nothing wrong with that By following your steps to review the Apache log and examine the access log, I can not understand if it is possible can you tell me by looking at the screenshot, what is unusual? Screenshots of both files are here https://imgur.com/a/EOk7A3G

0
  • I have server with 2CPUs, 4GB ,80GB
  • Plugins and theme are working properly
  • I have installed Wordfence security and there is nothing wrong with that
  • By following your steps to review the Apache log and examine the access log, I can not understand if it is possible can you tell me by looking at the screenshot, what is unusual?

Screenshots of both files are here https://imgur.com/a/EOk7A3G

answered 7 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions