AWS部署经常出现故障(AWS deployment goes down frequently)

编程入门 行业动态 更新时间:2024-10-24 03:20:40
AWS部署经常出现故障(AWS deployment goes down frequently)

所以,我在EC2实例上有一个非常基本的部署,除了几个大问题之外,它在很大程度上有效。 现在我只是匆匆走进盒子里跑步

python -m SimpleHTTPServer 80

我在安全组上有一个框,允许在端口80上输入http请求。

这似乎有效,但如果我一个人呆了一段时间(通常1-2小时),我的弹性ip将开始返回404s。 我真的需要这台服务器来挽留第三方的演示。 关于如何确保它保持运转的任何想法?

此外,当我关闭ssh进入我的盒子的终端时它会关闭,这是非常不理想的,因为我希望这个演示即使我的电脑关闭也能保持正常状态。 这是一个不太紧急的问题,但任何有关这方面的建议也将受到赞赏。

So, I've got a very basic deployment on an EC2 instance that largely works, except for a couple of large issues. Right now I'm just ssh'ing into the box and running

python -m SimpleHTTPServer 80

and I have the box on a security group that allows http requests in on Port 80.

This seems to work, but if I leave it alone for a while (1-2 hours usually) my elastic ip will start returning 404s. I really need this server to stay up for demos to third parties. Any ideas on how to make sure it stays up?

Additionally it goes down when I close the terminal that's ssh'd into my box, which is extremely non-ideal as I would like this demo to stay up even if my computer is off. That's a less urgent matter, but any advice on that would also be appreciated.

最满意答案

SimpleHTTPServer只在端口80上提供静态页面,主要用于开发期间。

对于生产用途(如果你想使用EC2),我建议你阅读Apache或nginx 。 基本上你需要一个在Linux上运行的Web服务器。

如果您认为您的站点将保留静态文件(HTML,CSS,JS),我建议您在Amazon S3上托管它们。 S3更便宜,更可靠。 请查看此答案以获取相关说明: Amazon S3上的静态托管 - DNS配置

请享用!

SimpleHTTPServer just serves static pages on port 80, mainly for use during development.

For production usage (if you want to use EC2) I recommend you read up on Apache or nginx. Basically you want a web server that runs on Linux.

If you think your site will remain static files (HTML, CSS, JS) I recommend you host them on Amazon S3 instead. S3 is cheaper and way more reliable. Take a look at this answer for instructions: Static hosting on Amazon S3 - DNS Configuration

Enjoy!

更多推荐

box,关闭,问题,电脑培训,计算机培训,IT培训"/> <meta name="description" c

本文发布于:2023-07-05 08:59:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1035482.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:出现故障   AWS   frequently   deployment

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!