Search code examples
tomcatlan

Ping Tomcat from another machine


I have a little issue.

I run Tomcat on my machine and calling it at localhost:8080 works fine.

Now I want to send a request (e.g. http://mytomcatserver/myapp) from another machine on my own LAN.

How can I do this?

I tried to request an http://myMachineIP:8080/myapp but it doesn't work. Sorry for my English, I hope you can help me!


Solution

  • For this, you need two things:

    • A DNS server who can tell your other machine what mytomcatserver means
    • A proxy that connects mytomcatserver:80 with localhost:8080

    For the latter, there are pretty simply ones like netcat or you can configure Apache for this (use the proxy module) or you can configure Tomcat to use port 80 instead (but then, you need to run Tomcat as root).