Reputation: 2012
I am using PerfSONAR a network measurement tool, which has a UI that depends on tomcat7. I installed the perfsonar-ui on an Ubuntu 14.04 server, and to test my installation I pointed my browser (on a windows 7 machine) to the address http://my_server_address:8080/perfsonar-ui/
. The connection failed.
What I tried so far:
curl -X GET http://localhost:8080/perfsonar-ui/
, response status OK (200)on other servers, curl -X GET http://my_server_address:8080/perfsonar-ui/
results in:
curl: (7) Failed to connect to my_server_address port 8080: Connection refused
allowed port 8080 on the server sudo ufw allow 8080
sudo ufw disable
i am binding to 0.0.0.0
, so the connector from my /etc/tomcat7/server.xml
file looks like:
<Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443" address="0.0.0.0" />
netstat -ntlp | grep LISTEN
result:
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN -
Still not working! :(
Can someone help me troubleshoot the issue, please? Thanks.
Upvotes: 2
Views: 2674
Reputation: 31
I have found a alternate solution just replacing the port 8080 with the port 80 in server.xml in tomcat conf. Then stop and start the tomcat server again. It is tested on Ubuntu 16.4 server.
ORIGINAL: Connector port="8080" protocol="HTTP/1.1"
MODIFIED: Connector port="80" protocol="HTTP/1.1"
It works for me when i access remote tomcat sever using CURL from my website.
API URL should be "http://xxx.xxx.xxx.xxx/api/24" in place of "http://xxx.xxx.xxx.xxx:8080/api/24"
Upvotes: 0
Reputation: 2012
I am closing this. It had nothing to do with tomcat. It was an iptables issue, I had to allow incoming connections to destination port 8080. It worked!
Upvotes: 2