By using AWS re:Post, you agree to the AWS re:Post Terms of Use

Elastic Beanstalk error 100.0 % of the requests are erroring with HTTP 4xx

0

I was able to deploy my application successfully with no errors before but after I made some configurations to access my private EC2 through EIC and my private RDS through MySQL Workbench, this error "100.0 % of the requests are erroring with HTTP 4xx. Insufficient request rate (6.0 requests/min) to determine application health." on my Elastic Beanstalk environment occurred.

I tried switching back from Internet Gateway to NAT Gateway in the Route Table, but it didn't show any changes. I tried editing the Health Check path to "/wordpress/" as what I did in the past in this link : https://repost.aws/questions/QUHY7zaB3mTWay1YBWvNCEAg/http-4xx-error-in-wordpress-deployed-in-elastic-beanstalk but no change happened. I checked further and I can see that the Health status of of the Target Group under Load Balancing in EC2 is "Request timed out" and health status is unhealthy. But when I checked my EC2 instance it is running and the system as well as the instance check is passed. Any idea how to fix this error. Thank you.

profile picture
asked a year ago1.3K views
1 Answer
0

Hello.
First, make sure you have WordPress content in the document root of your web server.
For example, is index.php placed directly under the document root?
I would also need to check the permissions for WordPress content.
As for the other part to check, please check if the EC2 security group allows access from the ALB.

profile picture
EXPERT
answered a year ago
  • Thank you for looking into this Riku. I checked through command prompt and the location of WordPress files is /var/app/current/ after I ran /usr/share/nginx/html/ since I chose Nginx as the web server. I'm confused because when I deployed the WordPress files in zip file, I made sure that the files are in the document root. Maybe it's the Elastic Beanstalk was the one who transferred the files. I can also confirm that the security group of my EC2 instance allows http in port 80 from ALB.

    Below are the permissions: -rw-r--r--. 1 webapp webapp 405 Feb 6 2020 index.php -rw-r--r--. 1 webapp webapp 19915 Jan 1 2023 license.txt -rw-r--r--. 1 webapp webapp 7402 Mar 5 00:52 readme.html -rw-r--r--. 1 webapp webapp 7205 Sep 16 2022 wp-activate.php drwxr-xr-x. 9 webapp webapp 16384 Aug 17 09:42 wp-admin -rw-r--r--. 1 webapp webapp 351 Feb 6 2020 wp-blog-header.php -rw-r--r--. 1 webapp webapp 2338 Nov 9 2021 wp-comments-post.php -rw-rw-rw-. 1 webapp webapp 3497 Aug 19 17:00 wp-config.php -rw-r--r--. 1 webapp webapp 3013 Feb 23 10:38 wp-config-sample.php drwxr-xr-x. 4 webapp webapp 52 Aug 17 12:00 wp-content -rw-r--r--. 1 webapp webapp 5536 Nov 23 2022 wp-cron.php drwxr-xr-x. 28 webapp webapp 16384 Aug 17 09:42 wp-includes -rw-r--r--. 1 webapp webapp 2502 Nov 26 2022 wp-links-opml.php -rw-r--r--. 1 webapp webapp 3792 Feb 23 10:38 wp-load.php -rw-r--r--. 1 webapp webapp 49330 Feb 23 10:38 wp-login.php -rw-r--r--. 1 webapp webapp 8541 Feb 3 2023

  • Thanks for sharing. Would it improve if I run the following command to change the permissions on WordPress content?

    sudo chmod -R 755 ./
    
  • The error is still the same. Below are the changes in permissions: -rwxr-xr-x. 1 webapp webapp 405 Feb 6 2020 index.php -rwxr-xr-x. 1 webapp webapp 19915 Jan 1 2023 license.txt -rwxr-xr-x. 1 webapp webapp 7402 Mar 5 00:52 readme.html -rwxr-xr-x. 1 webapp webapp 7205 Sep 16 2022 wp-activate.php drwxr-xr-x. 9 webapp webapp 16384 Aug 17 09:42 wp-admin -rwxr-xr-x. 1 webapp webapp 351 Feb 6 2020 wp-blog-header.php -rwxr-xr-x. 1 webapp webapp 2338 Nov 9 2021 wp-comments-post.php -rwxr-xr-x. 1 webapp webapp 3497 Aug 19 17:00 wp-config.php -rwxr-xr-x. 1 webapp webapp 3013 Feb 23 10:38 wp-config-sample.php drwxr-xr-x. 4 webapp webapp 52 Aug 17 12:00 wp-content -rwxr-xr-x. 1 webapp webapp 5536 Nov 23 2022 wp-cron.php drwxr-xr-x. 28 webapp webapp 16384 Aug 17 09:42 wp-includes -rwxr-xr-x. 1 webapp webapp 2502 Nov 26 2022 wp-links-opml.php -rwxr-xr-x. 1 webapp webapp 3792 Feb 23 10:38 wp-load.php -rwxr-xr-x. 1 webapp webapp 49330 Feb 23 10:38 wp-login.php -rwxr-xr-x. 1 webapp webapp 8541 Feb 3 2023 wp-mail.php -rwxr-xr-x. 1 webapp webapp 24993 Mar 1 15:05 wp-settings.php -rwxr-xr-x. 1 webapp webapp 34350 Sep 17 2022 wp-signup.php -rwxr-xr-x. 1 webapp webapp 4889 Nov 23 2022 wp-trackback.php -rwxr-xr-x. 1 webapp webapp 3238 Nov 29 2022 xmlrpc.php

  • Can you check the Nginx config file to see the exact document root location?

  • It is under /var/app/current of nginx as shown below in the command prompt: [ec2-user@ip-10-0-148-48 ~]$ cd /usr/share/nginx/html [ec2-user@ip-10-0-148-48 html]$ cd /var/app/current [ec2-user@ip-10-0-148-48 current]$ ls index.php wp-admin wp-config-sample.php wp-links-opml.php wp-settings.php license.txt wp-blog-header.php wp-content wp-load.php wp-signup.php readme.html wp-comments-post.php wp-cron.php wp-login.php wp-trackback.php wp-activate.php wp-config.php wp-includes wp-mail.php xmlrpc.php

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