Can not bind the domain to AWS EC2

93 Views Asked by At

I use EC2. So far I have been using Elastic IP to get a static IP. And I was able to bind the Htttp server to an AWS prepared domain like ec2-xx-xxx-xxx-xxx.ap-northeast-1.compute.amazonaws.com and run it.

This time, I got a domain from an external site and set the direction of that domain to Elastic IP. And I was able to confirm that the IP was actually switched.

However, the HTTP server running on EC2 stopped starting. This server is made in Java, and it raises the exception java.net.BindException: Cannot assign requested address.

This Http server specifies the host and port to bind to when it starts, but this time I had made a change to make the host a new domain obtained from the dive site.

(from ec2-xx-xxx-xxx-xxx.ap-northeast-1.compute.amazonaws.com to xxxxxxx.com)

Why does this exception occur? (BTW, the Http server uses the NanoHTTPD library)

0

There are 0 best solutions below