AWS:创建新环境(tomcat-单实例):带有 SSL 证书的 .ebextensions - 无法启动

AWS: Create a new environment (tomcat-single-instance): .ebextensions with SSL certificate - fails to start

Elastic Beanstalk:创建新环境:带有 SSL 证书的 .ebextensions 无法启动(tomcat-单实例)

我正在尝试使用当前生产 WAR 包创建一个新环境。

新实例部署失败并显示“绿色”状态。我们最初是按照这个示例来创建 .ebextensions (https://s3.amazonaws.com/elasticbeanstalk-single-instance-ssl-demo/tomcat-single-instance.zip) and extended as described here https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/https-singleinstance-tomcat.html .

New Platform: Managed, Tomcat 8.5 with Java 8 on 64bit Amazon Linux
Platform version: 3.4.1(Recommended)

错误:

httpd24-tools conflicts with httpd-tools-2.2.34-1.16.amzn1.x86_64
mod24_ssl conflicts with 1:mod_ssl-2.2.34-1.16.amzn1.x86_64
httpd24 conflicts with httpd-2.2.34-1.16.amzn1.x86_64

为了解决这个错误,我更换了

packages:
  yum:
    mod_ssl : []

packages:
  yum:
    mod24_ssl.x86_64 : []

但这导致了这个错误:

Httpd configuration detected in the '.ebextensions/httpd' directory. AWS Elastic Beanstalk will no longer manage the httpd configuration for this environment.
Executing: /usr/sbin/apachectl -t -f /var/elasticbeanstalk/staging/httpd/conf/httpd.conf
httpd: Syntax error on line 21 of /var/elasticbeanstalk/staging/httpd/conf/httpd.conf: Include/IncludeOptional: No matches for the wildcard '*.conf' in '/etc/httpd/conf.d/elasticbeanstalk', failing
Failed to execute '/usr/sbin/apachectl -t -f /var/elasticbeanstalk/staging/httpd/conf/httpd.conf'
Failed to execute '/usr/sbin/apachectl -t -f /var/elasticbeanstalk/staging/httpd/conf/httpd.conf' (Executor::NonZeroExitStatus)

AWS 要求立即更换当前的生产服务器 (Amazon Linux/2.3.1),因为它已“退役”。我也在 AWS Forum 上发布了这个问题。请帮忙。

免去痛苦。不要在您的 Tomcat 服务器中配置 SSL,在 AWS Elastic Load Balancer ELB 上配置。

AWS documentation所示:

Starting with Tomcat platform version 3.0.0 configurations, which were released with the Java with Tomcat platform update on May 24, 2018, Apache 2.4 is the default proxy of the Tomcat platform.

在深入研究问题之后,从评论和同伴聊天中可以看出,问题的实际解决方案是创建或克隆现有环境,以便能够使用新的 beantalk 环境对于 Amazon Linux 3.4.2,没有任何定制。

然后,为了避免提到的 SSL 问题,.ebextensions 目录应该只包含方便的 ssl.conf 和示例 zip 文件中提供的 environment.config 脚本这个问题,没有 packages 部分,因为 mod_ssl 已经安装在 beantalk 图像中。

在这种特定情况下,还有一些与创建日志记录所需文件相关的其他问题。将路径调整为应用程序可以写入的路径后,在 Beanstalk 中默认为 Tomcat,/var/logs/tomcat8,一切似乎都正常。