I have a Tomcat Server where a .war file is running.
I can run the .war file when typing localhost:8080/.. in the browser.
But I have to reach this .war file over network. So I have a external IP with a domain name on it.
And i should reach this .war file when typing xx.xxx.xxx.xxx:8080/.. in browser.
So this IP address should point to its localhost and further to the .war file.
How can I achieve this?
You need to edit server.In between port="8080" maxHttpHeaderSize="8192" type address="0.0. 0.0" (Line will look like port="8080" address="0.0. 0.0" maxHttpHeaderSize="8192").
To access the server, use its external IP address (found on the hands-on lab overview page) in the URL bar of a web browser, then append :8080 to it. Test to ensure you are unable to access the Host Manager App on the Tomcat GUI. Note: Tomcat is installed under /usr/local/tomcat9 .
Tomcat listens on TCP port 8005 to accept shutdown requests. By connecting to this port and sending the SHUTDOWN command, all applications within Tomcat are halted.
Basically you configure your connector with the optional "address" attribute containing the ip address that you want to bind to.
tomcat/conf/server.xml
<Connector port="8080" protocol="HTTP/1.1" address="xxx.xxx.xxx.xxx" connectionTimeout="20000" redirectPort="8443" />
Information available at Tomcat homepage http://tomcat.apache.org/tomcat-7.0-doc/config/http.html and http://wiki.apache.org/tomcat/FAQ/Connectors#Q6.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With