top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

AWS EC2 Connection refused for http port 80 for tomcat server

+1 vote
855 views

I had installed tomcat 8 port 80 on Amazon AWS EC2, but netstat, fuser does show me tomcat on port 80. Browser gives 404 error and connection refused. I wrote to Amazon support for the misery...

posted Mar 6, 2018 by Priya Ranjan Kumar

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button
Often if you are running Tomcat on port 80, you are proxying through a web server (Apache, nginx, etc.). It may be that your webserver failed, so crosscheck...
The issue was that in order to run Tomcat on a port below 1024 in Ubuntu/Unix, the service needs root privileges which is generally not recommended as running a process on port 80 with root privileges is an unnecessary security risk.

Solution is to use a port redirection via iptables :-

iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080

And it worked for me.

Similar Questions
+1 vote

In tomcat does the no . of open sockets on http port (netstat -anlp|grep 8080) is it equal to number of threads in use in tomcat .
Actually I want to understand how & when I can say that the all threads in a tomcat are fully utilized that why it is responding slow.

+1 vote

We have a set up like Apahce (80,443) redirects the request to Tomcat (8080) using mod_jk.

The new requirement is to route the request from the same apache to another tomcat (8090). Hence I made the different config file for apache with different ports (86,4444) and different worker for mod_jk which routes the request to tomcat.

Now the issue is when I hit the url http://:86 and after providing the credentials, it is redirecting to https://:86 and throwing the below error.

Error in browser:

Secure Connection Failed

An error occurred during a connection to x.x.x.x:86. SSL received a record that exceeded the maximum permissible length. (Error code: ssl_error_rx_record_too_long)

Error in logs:

"x16x03x01" 501

[Thu Jan 08 08:22:46 2015] [debug] ssl_engine_io.c(1523): OpenSSL: I/O error, 11 bytes expected to read on BIO#1bf568 [mem: 1f3930]
[Thu Jan 08 08:22:46 2015] [debug] ssl_engine_kernel.c(1806): OpenSSL: Exit: error in SSLv2/v3 read client hello A
[Thu Jan 08 08:22:46 2015] [info] (70014)End of file found: SSL handshake interrupted by system [Hint: Stop button pressed in browser?!]
[Thu Jan 08 08:22:46 2015] [info] Connection to child 3 closed with abortive shutdown(server pritoolvca1.sw.ericsson.se:443 [2], client 153.88.164.216)
[Thu Jan 08 08:23:53 2015] [error] [client 172.17.136.153] Invalid method in request x16x03x01

Could you please suggest where it might went wrong and the way forward..

0 votes

Using tomcat 6.I Always confused with connectionTimeout

The number of milliseconds this *Connector* will wait, after accepting a connection, for the request URI line to be presented. The default value is 60000 (i.e. 60 seconds).

Helpful if anyone can explain.?

Is there any connector parameter where i can set request timeout.?Rather than at application level timeout i want tomcat to timeout after certain period if request taking long time..

+1 vote

I use Ubuntu if that matters. I install Mongo like I would on any Linux server, make sure to open certain ports through security groups, etc. Are there any best practices or perhaps specific EC2 support for Mongo I can leverage?

AFAIK Amazon doesnt provide RDS-like managed Mongo instances.

...