How can I browse my Tomcat localhost from another computer on the network?

半城伤御伤魂 提交于 2019-11-30 11:03:29

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.

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

you can use your ip address instead of localhost

http://10.4.0.1:8080/YourProject

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)

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.

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. :)

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).

You must write your machine's IP instead of using "localhost"

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.

`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)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!