微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

AWS:创建新环境tomcat-single-instance:.ebextensions with SSL 证书 - 无法启动

如何解决AWS:创建新环境tomcat-single-instance:.ebextensions with SSL 证书 - 无法启动

Elastic Beanstalk:创建新环境:.ebextensions with SSL 证书无法启动(tomcat-single-instance

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

新实例部署失败并显示“绿色”状态。我们最初按照此示例创建 .ebextensions (https://s3.amazonaws.com/elasticbeanstalk-single-instance-ssl-demo/tomcat-single-instance.zip) 并按此处所述进行扩展 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 上发布了这个问题。请帮忙。

解决方法

AWS documentation 中所示:

从随 Java with Tomcat platform update on May 24,2018 发布的 Tomcat 平台 3.0.0 版配置开始,Apache 2.4 是 Tomcat 平台的默认代理。

在深入研究问题后,从评论和同伴聊天中可以看出,问题的实际解决方案是创建或克隆现有环境,其想法是能够为亚马逊使用全新的 beanstalk 环境Linux 3.4.2,无任何定制。

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

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

,

省去自己的痛苦。请勿在 Tomcat 服务器中配置 SSL,请在 AWS 弹性负载均衡器 ELB 上进行。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?