node.js CentOs 中 aws 中的应用程序部署不工作
node.js application deployment in aws in CentOs not working
当我 运行 在 AWS 中使用 CentOs 6.5 中的 node.js 应用程序时
var sys = require( "sys" );
var http = require( "http" );
// Create our HTTP server.
var server = http.createServer(
function( request, response ){
// Create a SUPER SIMPLE response.
response.writeHead( 200, {"content-type": "text/plain"} );
response.write( "Hellow world from AWS!\n" );
response.end();
}
);
// Point the HTTP server to port 8080.
server.listen( 3000 );
// For logging....
console.log( "Server is running on 3000" );
它 运行s 并在控制台上显示:
服务器 运行正在 3000
上运行
但是当我打开浏览器并且 运行
public 亚马逊提供的DNS
:http://ec2-54-152-55-189.compute-1.amazonaws.com:3000/, it shows webpage not available ,but in terminal of CentOs in aws ,when I run command :curl http://ec2-54-152-55-189.compute-1.amazonaws.com:3000/ 它显示
来自 AWS 的世界您好!
1) 入站规则是
HTTP -- 任何地方
SSH -- 任何地方
自定义 TCP 规则 (PORT-3000)-- 任何地方
HTTPS-- 任何地方
自定义 UDP 规则 (PORT-3000)-- 任何地方
2)出站规则为
所有流量|所有协议 |所有端口|任何地方
感谢任何帮助。非常感谢。
问题已解决,入站规则设置如下:
HTTP -- 任何地方
SSH -- 任何地方
自定义 TCP 规则 (PORT-3000)-- 任何地方
HTTPS-- 任何地方
自定义 UDP 规则 (PORT-3000)-- 任何地方
在 centOS 6.5 实例中,防火墙不允许来自端口 (HTTP)80、(CUSTOM)3000、(HTTPS)443.Therefore 的任何连接,我允许所需的端口号。在 iptables 中
看:
http://www.cyberciti.biz/faq/howto-rhel-linux-open-port-using-iptables/ 编辑 iptables 并重启防火墙
https://www.digitalocean.com/community/tutorials/how-to-set-up-a-basic-iptables-firewall-on-centos-6 允许防火墙中的特定端口
当我 运行 在 AWS 中使用 CentOs 6.5 中的 node.js 应用程序时
var sys = require( "sys" );
var http = require( "http" );
// Create our HTTP server.
var server = http.createServer(
function( request, response ){
// Create a SUPER SIMPLE response.
response.writeHead( 200, {"content-type": "text/plain"} );
response.write( "Hellow world from AWS!\n" );
response.end();
}
);
// Point the HTTP server to port 8080.
server.listen( 3000 );
// For logging....
console.log( "Server is running on 3000" );
它 运行s 并在控制台上显示:
服务器 运行正在 3000
但是当我打开浏览器并且 运行 public 亚马逊提供的DNS :http://ec2-54-152-55-189.compute-1.amazonaws.com:3000/, it shows webpage not available ,but in terminal of CentOs in aws ,when I run command :curl http://ec2-54-152-55-189.compute-1.amazonaws.com:3000/ 它显示 来自 AWS 的世界您好!
1) 入站规则是
HTTP -- 任何地方
SSH -- 任何地方
自定义 TCP 规则 (PORT-3000)-- 任何地方
HTTPS-- 任何地方
自定义 UDP 规则 (PORT-3000)-- 任何地方
2)出站规则为
所有流量|所有协议 |所有端口|任何地方
感谢任何帮助。非常感谢。
问题已解决,入站规则设置如下:
HTTP -- 任何地方
SSH -- 任何地方
自定义 TCP 规则 (PORT-3000)-- 任何地方
HTTPS-- 任何地方
自定义 UDP 规则 (PORT-3000)-- 任何地方
在 centOS 6.5 实例中,防火墙不允许来自端口 (HTTP)80、(CUSTOM)3000、(HTTPS)443.Therefore 的任何连接,我允许所需的端口号。在 iptables 中 看: http://www.cyberciti.biz/faq/howto-rhel-linux-open-port-using-iptables/ 编辑 iptables 并重启防火墙 https://www.digitalocean.com/community/tutorials/how-to-set-up-a-basic-iptables-firewall-on-centos-6 允许防火墙中的特定端口