سؤال

Using Amazon EC2 I have successfully launched a Windows Server 2012 instance and configured it to run a Tomcat webserver.

From within the VPS itself, I know the webserver is working because I see the Tomcat page in a web browser when I type http://localhost:8080.

However, I am unable to access it externally even though I've created a rule in the security group to allow incoming traffic on port 8080 from all addresses (0.0.0.0/0).

Typing 'curl -v http://ec2-54-194-6-178.eu-west-1.compute.amazonaws.com:8080' returns:

  • About to connect() to ec2-54-194-6-178.eu-west-1.compute.amazonaws.com port 8080 (#0)
  • Trying 54.194.6.178...
  • Operation timed out
  • couldn't connect to host
  • Closing connection #0 curl: (7) couldn't connect to host

I also have a Linux instance running that is using the same security group. I am able to connect to that just fine.

I don't know much about configuring Tomcat but I also added address="0.0.0.0" to the config file, server.xml just in case that was a potential cause.

<Connector port="8080" protocol="HTTP/1.1"
           connectionTimeout="20000"
           redirectPort="8443"
           address="0.0.0.0" />

Any ideas how to resolve this would be greatly appreciated.

Update

I figured it out eventually. I was able to connect to the Tomcat web-server by turning off the Windows firewall.

هل كانت مفيدة؟

المحلول

I figured it out eventually. I was able to connect to the Tomcat web-server by turning off the Windows firewall.

نصائح أخرى

This problem is more related to tomcat rather than the curl. You can do the following things to make your server to respond against the remote requests.

Enabling IPV hosts inside the <Connector ...

useIPVHosts="true"

Also, you can try using fixed ip address instead of 0.0.0.0

address="192.89.90.100"
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top