简体   繁体   English

无法连接到 AWS EC2 实例上的网络服务器

[英]Unable to connect to webserver on AWS EC2 instance

I'm unable to connect to my EC2 instance where I have an apache web server running (also running an Express.js server on a different port).我无法连接到运行 apache web 服务器的 EC2 实例(也在不同端口上运行 Express.js 服务器)。 I have updated the security group to allow incoming requests to http and https ports but I continue to get this response in the browser:我已更新安全组以允许对 http 和 https 端口的传入请求,但我继续在浏览器中收到此响应:

This site can’t provide a secure connection
*********** sent an invalid response.
ERR_SSL_PROTOCOL_ERROR

I am able to ssh into my EC2 instance.我能够 ssh 进入我的 EC2 实例。

Other than ensuring that the correct ports are open and that a service is listening on those ports, is there any configuration needed to setup simple web server on EC2?除了确保正确的端口打开并且服务正在侦听这些端口之外,是否需要任何配置才能在 EC2 上设置简单的 web 服务器?

  • Current security group settings:当前安全组设置:

安全组设置

  • Currently open ports (sudo lsof -i -P -n | grep LISTEN):当前打开的端口(sudo lsof -i -P -n | grep LISTEN):

开放端口

There are some similar questions posted but they are either vague or have been left for dead发布了一些类似的问题,但它们要么含糊不清,要么已被搁置

You need to install mod_ssl to tell apache to serve httpS connections.您需要安装 mod_ssl 来告诉 apache 为 httpS 连接提供服务。 You can use the default (or self signed certificate) to check the connectivity on port 443. If you need a valid ssl certificate, you can get one for free from Let's Encrypt: https://letsencrypt.org/ You can use CertBOT to auto renew certificates: https://letsencrypt.org/getting-started/您可以使用默认(或自签名证书)来检查端口 443 上的连接。如果您需要有效的 ssl 证书,您可以从 Let's Encrypt 免费获得一张: https://letsencrypt.org/您可以使用 CertBOT 来自动更新证书: https://letsencrypt.org/getting-started/

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

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