我已经构建了一个wt(诙谐)hello world示例,我正在尝试在Google Cloud实例上部署它。它似乎在本地运行良好(因此它具有所有必要的库依赖性)。但是,我无法在服务器上部署它。
我正在尝试(使用我的实际http地址,这与下面的示例不同)
./hello --docroot . --http-address 105.150.47.754 --http-port 80
但它以
响应Error (asio): bind : cannot assign requested address
使用(0.0.0.0/0)
似乎工作正常云实例允许HTTP tcp / 80流量。
我试过了
setcap 'cap_net_bind_service=+ep' ~/hello
允许非root用户在1024以下的端口上发布,但也无济于事。
有什么建议吗?
干杯,迈克
答案 0 :(得分:1)
If you are unable to listen on the specified IP address, one of the following is likely true:
1) Something (such as a web server) is already listening at that address on port 80, or
2) The IP address you are using is not assigned to one of the machine's network interfaces.
Using (0.0.0.0/0) with port 80 tells the Wt web server (wthttpd) to listen on all available local interfaces. Therefore, using that address will work with any available network interface assigned any IP address with port 80 available.