Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't access Tomcat using IP address

I'm running a Tomcat 5.5 instance (port 8089) on Windows 7.

The server runs correctly if I open http://localhost:8089/ but it gives me an error (Connection refused) on http://192.168.1.100:8089/

I thought it was a firewall issue, so I disabled it, but I still have no luck.

like image 879
francesco Avatar asked Jun 05 '11 21:06

francesco


People also ask

How do I access Tomcat on localhost?

Use a browser to check whether Tomcat is running on URL http://localhost:8080 , where 8080 is the Tomcat port specified in conf/server. xml. If Tomcat is running properly and you specified the correct port, the browser displays the Tomcat homepage.

How do I allow Tomcat through firewall?

Navigate to C:\Program Files (x86)\ADInstruments\LabTutor Server\tomcat\bin and select tomcat6.exe (If 32-bit, navigate to C:\Program Files\ADInstruments\LabTutor Server\tomcat\bin) Click Open, Next and then Allow the connection. Click Next and select the checkboxes for Domain, Private and Public, then click Next.

How do I access Tomcat server?

Access the Apache Tomcat console by browsing to http://localhost:8080/ (if installed as a non-root user) or http://localhost/ (if installed as the root user).

How do I access Tomcat from another computer?

Goto Windows Firewall->Advanced Settings->Inbound Rules. In the Right side click on New Rule->Then select Port from dialog box and Next->Then type port "8080" (As by default Tomcat run on this port) and Next->Then select "Allow the connection"->Next->Give a Name ->Finish.


2 Answers

You need allow ip based access for tomcat in server.xml, by default its disabled. Open server.xml search for "

<Connector port="8080" protocol="HTTP/1.1"             connectionTimeout="20000"             URIEncoding="UTF-8"            redirectPort="8443" /> 

Here add a new attribute useIPVHosts="true" so it looks like this,

<Connector port="8080" protocol="HTTP/1.1"             connectionTimeout="20000"             URIEncoding="UTF-8"            redirectPort="8443"            useIPVHosts="true" /> 

Now restart tomcat, it should work

like image 159
Anto Binish Kaspar Avatar answered Nov 18 '22 05:11

Anto Binish Kaspar


You need to make Tomcat listen to 192.168.1.100 address also.

If you want it to listen to all interfaces (IP-s) just remove "address=" from Connector string in your configuration file and restart Tomcat.

Or just use your IP to listen to that address address=192.168.1.100 in the Connector string

like image 37
McKracken Avatar answered Nov 18 '22 06:11

McKracken