Reputation: 2482
I'm an IIS guy and know its as simple as just using the http://[computername]/path to webapp.. however, I can't seem to figure out how to make this possible for a JSP application I'm writing that runs under Tomcat. Is there a configuration setting I need to set somewhere?
Upvotes: 22
Views: 87432
Reputation: 179
`Step 1: Go to directory where tomcat is installed and look for server.xml file.Usually the path is
C:\Program Files\Apache Software Foundation\Tomcat 9.0\conf\server.xml
Open it with editor and look for connector block.It will be like
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443"/>
Add address="0.0.0.0" to it
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443"
address="0.0.0.0" />
save the file.
step 2: Go to the firewall and network protection setting of the pc and turn off the public network firewall.
step 3: Start the tomcat server.Then use the local ip address of pc and port 8080 (used by tomcat server as default unless you have changed it) form other device to connect with the tomcat server on the pc.
eg - http://192.168.8.137:8080/ (replace 192.168.8.137 with your pc's local ip address)
Upvotes: 0
Reputation: 110
this works fine simply write http://your_ipaddress:8080(tomcat server port)/project name
and make sure you are connected to same network and project is deployed on tomcat.
Upvotes: 0
Reputation: 330
Step 1: Add a firewall exception to inbound connections to the port that you use for your hosts (the Host
tags in CATALINA_HOME(Tomcat dir)/conf/server.xml
).
Step 2: At least in Windows 10, allow Tomcat to communicate through the firewall. One way would be Control Panel -> System and Security -> Windows Firewall -> "Allow an app or feature through Windows Firewall" -> "Change settings" -> Enable Private and Public for "Commons Daemon Service Runner" (if not present: "Allow another app..." -> Chose tomcat#.exe
in Tomcat bin directory, where #
will be the tomcat version number)
Step 3: Add a firewall exception for javaw
. In Windows 10, that is the steps above up to "Change settings", followed by: Find Java(TM) Platform SE binary with a path to javaw
(add as above if not present) -> Enable Private and Public for it.
Let me know if that does not work. :)
Upvotes: 4
Reputation: 181
As well as blocking the port (see AirSource Ltd's answer), your firewall may have restrictions on the Tomcat service. For example, Mcafee Firewall restricts Tomcat to "outgoing only".
If using Mcafee, under Change Settings > Firewall, expand Internet Connections for Programs and find Commons Daemon Service Runner (aka tomcat*.exe). Edit it and change Access from Outgoing Only to Incoming and outgoing - Use designated ports (recommended).
Upvotes: 0
Reputation: 31
if your ip were 192.122.11.22 you have to write http://192.122.11.22:8080/proyectname (if dont, then look your firewall)
Upvotes: 3
Reputation: 32622
Have you created an exception in your firewall?
Assuming that Tomcat is running on port 8080 and this is a Windows XP machine, the the firewall will block that port (not the case on Windows Server 2003).
The firewall can be configured by: choosing the Windows Firewall from the Control Panel, then click on Exceptions -> Add Port and enter name and number: Tomcat, 8080 and leave transport protocol as TCP
Upvotes: 19
Reputation: 14643
you can use your ip address instead of localhost
http://10.4.0.1:8080/YourProject
Upvotes: 2
Reputation: 13317
Tomcat uses port 8080 by default so you have to provide the port number in the URL to see anything. If it is running http://yourcomputer:8080/app should do the trick.
Upvotes: 1
Reputation: 2600
You need to use the Port of Tomcat which is by default 8080. So you might want to access you localhost on machine A from machine B as http://A:8080/YourProject And Remember Unlike IIS , it is case sensitive.
Upvotes: 21