【发布时间】:2016-04-17 16:10:41
【问题描述】:
在服务器配置之后,我有一个 IIS 服务器在我的 EC2 实例的端口 80 上进行监听。我可以从我的弹性 IP 访问它。 但我关闭了 IIS 服务器,希望在端口 80 上启动我的节点服务器。
现在,两者都不起作用!我的节点应用程序侦听端口 80,但无法通过弹性 IP 从外部访问。 我试图在 IIS 管理器中启动 IIS 服务器,它看起来像打开了。但它无法在实例内部(使用私有 IP)或从外部访问。
我能做些什么来解决它?
谢谢
服务器.js
/*******************************************************************************************/
/*CREATE AND START SERVER*/
/*******************************************************************************************/
var fs = require('fs');
var html = fs.readFileSync('./public/index.html');
var server=http.createServer(function(req,res){
//res.write(html); // load the single view file (angular will handle the page changes on the front-end)
//res.end();
// application -------------------------------------------------------------
app.get('*', function(req, res) {
res.sendfile('./public/index.html'); // load the single view file (angular will handle the page changes on the front-end)
});
});
server.listen(80,'localhost');
【问题讨论】:
-
您是否尝试通过公共/弹性 IP 或私有 IP 上的 ssh 访问服务器?此外,就架构而言,IIS 和 Node 有点跨越了很多线路。我显然会建议将来运行一个或另一个,但听起来你可能有两件事在端口 80 上启动一个侦听器。与“不工作/运行”相反,你是否尝试过完全卸载 Node?span>
-
我无法通过 telnet 建立连接。我一直在使用 RDP。
-
我只想运行 Node 服务器。我使用 IIS 服务器只是为了测试端口 80。我不需要它。
标签: node.js amazon-web-services express amazon-ec2 aws-ec2