deploying WT web app on google cloud

126 views Asked by At

I have build a wt (witty) hello world example and I am trying to deploy this on a Google Cloud instance. It seems to run fine locally (hence it has all the necessary library dependencies). However, I am not able to it to deploy on the server.

I am trying (using my actual http address which is different from the example below)

./hello --docroot . --http-address 105.150.47.754 --http-port 80

but it responds with

Error (asio): bind : cannot assign requested address

It seems to work fine using (0.0.0.0/0)

The cloud instance allows HTTP tcp/80 traffic.

I have tried

setcap 'cap_net_bind_service=+ep' ~/hello

to allow non-root users to publish on ports below 1024, but also to no avail.

Any suggestions?

Cheers, Mike

1

There are 1 answers

5
Wes On BEST ANSWER

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.