Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set a IP address to the tomcat? [closed]

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?

like image 748
silvia_aut Avatar asked Jan 23 '14 09:01

silvia_aut


People also ask

How do I change my IP address from localhost to Tomcat?

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

How do I make Tomcat server accessible from outside?

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 .

What is Tomcat shutdown port?

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.


1 Answers

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.

like image 159
Peter Svensson Avatar answered Sep 22 '22 02:09

Peter Svensson