当我午餐其中一个示例时,我在运行 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 的关联起作用了。我可以用腻子连接到 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但没有帮助。