简体   繁体   English

AWS elastic beanstalk 100.0% 的请求出错 HTTP 4xx

[英]AWS elastic beanstalk 100.0 % of the requests are erroring with HTTP 4xx

My AWS Elastic Beanstalk account keeps getting down with the error: "Environment health has transitioned from Ok to Severe. 100.0 % of the requests are erroring with HTTP 4xx" On a daily basis.我的 AWS Elastic Beanstalk 账户不断出现以下错误:“环境健康状况已从正常转变为严重。100.0% 的请求出现错误,错误代码为 HTTP 4xx” 每天。

When looking at the server logs, it keeps getting down after access to several odd web pages (which do not exist).查看服务器日志时,它在访问几个奇怪的 web 页(不存在)后不断下降。 Part of the log:部分日志:

/var/log/httpd/error_log-XXX
[XXX] [:error] [pid XXX] [client XXXX] script '/var/www/html/w.php' not found or unable to stat
[XXX] [:error] [pid XXX] [client XXX] script '/var/www/html/sheep.php' not found or unable to stat
[XXX] [:error] [pid XXX] [client XXX] script '/var/www/html/qaq.php' not found or unable to stat
[XXX] [:error] [pid XXX] [client XXX] script '/var/www/html/db.init.php' not found or unable to stat
[XXX] [:error] [pid XXX] [client XXX] script '/var/www/html/db_session.init.php' not found or unable to stat
[XXX] [:error] [pid XXX] [client XXX] script '/var/www/html/db__.init.php' not found or unable to stat
[XXX] [:error] [pid XXX] [client XXX] script '/var/www/html/wp-admins.php' not found or unable to stat
[XXX] [:error] [pid XXX] [client XXX] script '/var/www/html/m.php' not found or unable to stat
[XXX] [:error] [pid XXX] [XXX] script '/var/www/html/db_dataml.php' not found or unable to stat
...
[XXX] [XXX] [pid XXX] XXX: Graceful restart requested, doing restart

Does anyone know whats going on?有谁知道发生了什么事? Thanks!谢谢!

Same thing happenend to me.同样的事情也发生在我身上。 AWS Elastic Beanstalk was checking if a root query was working. AWS Elastic Beanstalk 正在检查根查询是否正常工作。 This means that a request at the root "/" must respond with a HTTP code 200.这意味着根“/”的请求必须以 HTTP 代码 200 响应。

You maybe just need to fix that.你可能只需要解决这个问题。

I suspect it's some kind of attack (DDoS).我怀疑这是某种攻击(DDoS)。

Maybe someone is scanning your website on different ports and looking for a specific file (w.php) which could be a backdoor or something similar.也许有人正在不同端口上扫描您的网站并寻找可能是后门或类似文件的特定文件 (w.php)。 As the file does not exist it throws errors.由于该文件不存在,因此会引发错误。

I recommend the following steps:我推荐以下步骤:

  1. Ensure all of your data is backed up on the server.确保您的所有数据都备份在服务器上。
  2. Re-install the instance from scratch.从头开始重新安装实例。
  3. Ensure the instance is secured per any CIS benchmark.确保根据任何 CIS 基准测试实例是安全的。
  4. Ensure Apache is secured per any Apache CIS benchmark.确保 Apache 符合任何 Apache CIS 基准测试。
  5. Ensure the VPS provider is using an IPS/IDS to monitor your instances, if not find another provider that does.确保 VPS 提供商正在使用 IPS/IDS 来监控您的实例,如果没有找到另一个这样做的提供商。
  6. Ensure that all relevant logs are sent to a central syslog server that is not the same as the web server instance.确保将所有相关日志发送到与 Web 服务器实例不同的中央系统日志服务器。 This will improve the integrity of the logs.这将提高日志的完整性。
  7. You might want to install the Snort IPS/IDS solution just to see if another attack is launched.您可能想安装 Snort IPS/IDS 解决方案只是为了查看是否发起了另一次攻击。
  8. Install a file integrity monitoring solution such as AIDE and monitor config files for changes.安装文件完整性监控解决方案,例如 AIDE 并监控配置文件的更改。

https://benchmarks.cisecurity.org/downloads/multiform/ https://benchmarks.cisecurity.org/downloads/multiform/

Change the Target group -> Health check settings-> Path to a valid api endpoint of your service更改目标组 -> 健康检查设置 -> 服务的有效 api 端点的路径

在此处输入图像描述

I got the same error.我得到了同样的错误。 Changing the Health check configurations in the elastic beanstalk to a valid API solved it.将弹性 beantalk 中的健康检查配置更改为有效的 API 解决了它。

You can find the Health check configurations in the elastic beanstalk environment's configurations -> Load balancer -> in the Processes section mark and edit your process -> scroll to the Health check section.您可以在弹性 beantalk 环境的配置中找到健康检查配置 -> 负载均衡器 -> 在进程部分标记并编辑你的进程 -> 滚动到健康检查部分。

截屏

默认情况下,从 EBS 创建的 EC2 上的目标组是 http,如果您添加了证书,则在运行状况检查协议中将其更改为 https

I was having the same issue when I was deploying my spring boot application to elasticbeans talk.当我将我的 Spring Boot 应用程序部署到 ElasticBeans Talk 时,我遇到了同样的问题。 I was getting "4xx" errors.我收到“4xx”错误。 I fixed it by updating the security groups inside the ec2-instance created by this.我通过更新由此创建的 ec2-instance 中的安全组来修复它。 it was due to permission issue not accessible from local machine这是由于本地计算机无法访问权限问题

In my case my application had outgrown the instance type that was defined during the initial setup.在我的情况下,我的应用程序已经超出了初始设置期间定义的实例类型。

I upgraded my EB environment's instance type from t3.medium to t3.large and that resolved the issue.我将我的 EB 环境的实例类型从t3.mediumt3.large并解决了这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM