使用弹性ip访问亚马逊ec2上的wt

时间:2012-10-25 01:35:13

标签: amazon-ec2 wt

我使用ubuntu运行源代码编译了ec2的微实例上的最新wt 当我在其中一个例子吃午餐时:

1:23:15.~/progs/wt-3.2.3-rc1/examples/widgetgallery
>../../build/examples/widgetgallery/widgetgallery.wt --docroot . --http-address localhost --http-port 8080
[2012-Oct-25 01:23:16.898953] 969 - [info] "config: reading Wt config file: /etc/wt/wt_config.xml (location = '../../build/examples/widgetgallery/widgetgallery.wt')"
[2012-Oct-25 01:23:16.901653] 969 - [info] "WServer/wthttp: initializing built-in wthttpd"
[2012-Oct-25 01:23:16.902948] 969 - [info] "wthttp: started server: http://localhost:8080"

当我将http://54.243.50.12:8080/http://54.243.50.12/放入Chrome的地址栏时,我无法访问它。它不断加载,永远找不到它。

弹性IP的关联起作用。我可以用putty连接到54.243.50.12。

如果我在启动wt时尝试指定弹性IP,则wt服务器无法启动:

1:31:45.~/progs/wt-3.2.3-rc1/examples/widgetgallery
>../../build/examples/widgetgallery/widgetgallery.wt --docroot . --http-address 54.243.50.12 --http-port 8080
[2012-Oct-25 01:31:53.696951] 1056 - [info] "config: reading Wt config file: /etc/wt/wt_config.xml (location = '../../build/examples/widgetgallery/widgetgallery.wt')"
[2012-Oct-25 01:31:53.699035] 1056 - [info] "WServer/wthttp: initializing built-in wthttpd"
[2012-Oct-25 01:31:53.699968] 1056 - [error] "wthttp: Error occurred when binding to 54.243.50.12:8080
bind: Cannot assign requested address"
[2012-Oct-25 01:31:53.700614] 1056 - [info] "WServer/wthttp: fatal: Error (asio): bind: Cannot assign requested address"
1:31:53.~/progs/wt-3.2.3-rc1/examples/widgetgallery
>

如果没有弹性IP,那就是同一个故事。

8080端口已打开:

>netstat -an | grep "LISTEN "
tcp        0      0 0.0.0.0:8080            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:5432          0.0.0.0:*               LISTEN
tcp6       0      0 :::22                   :::*                    LISTEN

我做了http://redmine.webtoolkit.eu/boards/2/topics/4484#message-4516中的所有内容,但没有帮助。

1 个答案:

答案 0 :(得分:2)

我需要在安全组中打开一个端口>入站