简体   繁体   English

为什么ec2实例不显示我的网站? 使用nodejs

[英]Why does ec2 instance not display my website? Using nodejs

I am running a m1.microinstance of aws, using CentOS. 我正在使用CentOS运行a1的a1.microinstance aws。 I downloaded Yeoman, git, npm and all of the dependencies are present. 我下载了Yeoman,git,npm,并且所有依赖项都存在。 I am trying to run a MEAN stack on this server, so, mongo, express, angular and node. 我正在尝试在此服务器上运行MEAN堆栈,因此是mongo,express,angular和node。 However, when I visit my public DNS, my site gives me this error: "Oops! Google Chrome could not connect to ec2-54-191-0-63.us-west-2.compute.amazonaws.com". 但是,当我访问公共DNS时,我的网站给了我这个错误:“糟糕!Google Chrome无法连接到ec2-54-191-0-63.us-west-2.compute.amazonaws.com”。 On my admin control panel, I see my instance status, and it says it is running. 在管理控制台上,我可以看到实例状态,并表示实例正在运行。 I understand that if I had used apache, the page that displays is in the /var/www/html directory.. So, how do I get a directory similar to apaches, to display my html files, or whatever I would like the public to see? 我了解如果我使用过apache,则显示的页面位于/ var / www / html目录中。因此,如何获得类似于apache的目录,显示我的html文件或任何我希望公众使用的目录查看? I have my security groups configured, for inbound, to listen to SSH port 22, for everyone, as well as HTTP port 80, for everyone. 我为入站配置了我的安全组,以监听所有人的SSH端口22,以及所有人的HTTP端口80。

Yeoman set up a nice app folder for me, but for some reason it does not display. Yeoman为我设置了一个不错的应用程序文件夹,但是由于某种原因它没有显示。 I thought maybe I was missing a server.js, but that does not seem to have fixed anything when I added it. 我以为也许我错过了server.js,但是在添加时似乎并没有修复任何问题。 Any advice? 有什么建议吗? Thanks! 谢谢!

Make sure you are matching the port all the way through - your browsers URL:PORT, the EC2 routing rules and your NodeJS settings. 确保完全匹配端口-浏览器的URL:PORT,EC2路由规则和NodeJS设置。 It looks like you might be listening to a port higher than 80 on the server. 看起来您可能正在侦听服务器上高于80的端口。

As you mentioned in your comment, if you want to listen on a port below 1024 you will need to run the command as a privileged user. 正如您在评论中提到的那样,如果要在1024以下的端口上进行侦听,则需要以特权用户身份运行命令。

I didn't run node as root on my AWS server, so it was not setting up my nicely built app that Yeoman made for me. 我没有以root用户身份在我的AWS服务器上运行节点,因此它没有设置Yeoman为我创建的构建良好的应用程序。

http://www.stackoverflow.com/questions/9164915 was where I realized my mistake. http://www.stackoverflow.com/questions/9164915是我意识到我的错误的地方。 I am new to linux OS soo, I am learning. 我对Linux OS还是陌生的,正在学习。 :) :)

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

相关问题 为什么我在 AWS EC2 实例上的 nodejs 应用程序的大文件上传失败并显示状态 413? - Why does large file upload fail with status 413 for my nodejs app on AWS EC2 instance? 无法通过 NodeJs 连接到我的 MongoDB EC2 实例 - Can't connect to my MongoDB EC2 instance via NodeJs 将Amazon EC2 Node.js实例重定向到HTTPS - Redirecting amazon ec2 nodejs instance to HTTPS 为什么我在 AWS EC2 上的 Nginx 设置不起作用? - Why does my setup of Nginx on AWS EC2 is not working? 您如何从本地计算机上的nodejs项目在Amazon EC2实例中运行Shell脚本? - How can you run a shell script in Amazon EC2 Instance from nodejs project in my local machine? 无法在Amazon EC2实例中为我的Node.js应用安装Java模块 - Cannot install java module for my nodejs app in amazon ec2 instance Cloudfront 分发不适用于 EC2 实例 - Cloudfront distribution does not work with for an EC2 instance 如何使用nodejs google api从没有浏览器的EC2实例获取OAuth2令牌 - How to get OAuth2 token from an EC2 instance with no browser using nodejs google api 如何使用最新版本的 NodeJS AWS SDK 启动 EC2 实例? - How do I start an EC2 instance using the latest version of the NodeJS AWS SDK? 无法使用 AWS EC2 实例上的端口 25 从 nodejs nodemailer 发送 gmail 地址的邮件 - Cannot send mails for gmail address from nodejs nodemailer using port 25 on AWS EC2 instance
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM