[英]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.