title: How to setup spring-boot to allow access to the webserver from outside IP addresses
body: <p>I have been looking into how to setup <code>tomcat</code> within <code>spring-boot</code> to allow access from outside IP addresses.  Currently I can view the UI from locahost:port but I can not access this from other systems.</p>
  <pre><code>http://localhost:8081 
  </code></pre>
  <p>When I am logged into the local computer it works.</p>
  <pre><code>http://192.168.0.93:8081
  </code></pre>
  <p>When I am logged into the local computer and try <a href="http://192.168.0.93:8081" rel="noreferrer">http://192.168.0.93:8081</a> it does not work.</p>
  <p>I want to access the UI from another computer via its IP address it does not work.</p>
  <pre><code>http://192.168.0.93:8081
  </code></pre>
  <p>When I got to <code>springs</code> documentation I found you can add the IP address on which you want tomcat to set the webserver for using server.address.  This should then allow the server to be accessed via this IP address by outside systems.</p>
  <pre><code>server.port=8082
  server.address=192.168.0.93
  </code></pre>
  <p>The port works fine if I do not supply the address but when I supply the address and try to run it I run into an issue for binding to that address.  It looks like <code>spring-boot</code> has already assigned locahost:8082.</p>
  <h1>Question:</h1>
  <p>How do I correctly setup <code>spring-boot</code> to allow tomact to be accessed by outside addresses and recognize its own IP when accessed locally?</p>
  <p>Thank you</p>
  <h1>Stack Trace:</h1>
  <pre><code>java.net.BindException: Cannot assign requested address
    at sun.nio.ch.Net.bind0(Native Method)
    at sun.nio.ch.Net.bind(Net.java:433)
    at sun.nio.ch.Net.bind(Net.java:425)
    at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
    at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
    at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:340)
    at org.apache.tomcat.util.net.AbstractEndpoint.start(AbstractEndpoint.java:765)
    at org.apache.coyote.AbstractProtocol.start(AbstractProtocol.java:473)
    at org.apache.catalina.connector.Connector.startInternal(Connector.java:986)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
    at org.apache.catalina.core.StandardService.addConnector(StandardService.java:239)
    at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.addPreviouslyRemovedConnectors(TomcatEmbeddedServletContainer.java:194)
    at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.start(TomcatEmbeddedServletContainer.java:151)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.startEmbeddedServletContainer(EmbeddedWebApplicationContext.java:293)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:141)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766)
    at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1191)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1180)
    at com.miw.mcb.server.ReactAndSpringDataRestApplication.main(ReactAndSpringDataRestApplication.java:18)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.boot.maven.AbstractRunMojo$LaunchRunner.run(AbstractRunMojo.java:478)
    at java.lang.Thread.run(Thread.java:745)
  2016-05-25 11:24:30 - Failed to start connector [Connector[HTTP/1.1-8081]]
  org.apache.catalina.LifecycleException: Failed to start component [Connector[HTTP/1.1-8081]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:153)
    at org.apache.catalina.core.StandardService.addConnector(StandardService.java:239)
    at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.addPreviouslyRemovedConnectors(TomcatEmbeddedServletContainer.java:194)
    at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.start(TomcatEmbeddedServletContainer.java:151)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.startEmbeddedServletContainer(EmbeddedWebApplicationContext.java:293)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:141)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766)
    at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1191)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1180)
    at com.miw.mcb.server.ReactAndSpringDataRestApplication.main(ReactAndSpringDataRestApplication.java:18)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.boot.maven.AbstractRunMojo$LaunchRunner.run(AbstractRunMojo.java:478)
    at java.lang.Thread.run(Thread.java:745)
  Caused by: org.apache.catalina.LifecycleException: service.getName(): &quot;Tomcat&quot;;  Protocol handler start failed
    at org.apache.catalina.connector.Connector.startInternal(Connector.java:993)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
    ... 19 common frames omitted
  Caused by: java.net.BindException: Cannot assign requested address
    at sun.nio.ch.Net.bind0(Native Method)
    at sun.nio.ch.Net.bind(Net.java:433)
    at sun.nio.ch.Net.bind(Net.java:425)
    at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
    at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
    at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:340)
    at org.apache.tomcat.util.net.AbstractEndpoint.start(AbstractEndpoint.java:765)
    at org.apache.coyote.AbstractProtocol.start(AbstractProtocol.java:473)
    at org.apache.catalina.connector.Connector.startInternal(Connector.java:986)
    ... 20 common frames omitted
  2016-05-25 11:24:30 - Pausing ProtocolHandler [&quot;http-nio-192.168.0.93-8081&quot;]
  2016-05-25 11:24:30 - Stopping service Tomcat
  2016-05-25 11:24:30 - The stop() method was called on component [StandardServer[-1]] after stop() had already been called. The second call will be ignored.
  2016-05-25 11:24:30 - Stopping ProtocolHandler [&quot;http-nio-192.168.0.93-8081&quot;]
  2016-05-25 11:24:30 - Destroying ProtocolHandler [&quot;http-nio-192.168.0.93-8081&quot;]
  2016-05-25 11:24:30 - Application startup failed
  org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to start embedded Tomcat servlet container
    at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.start(TomcatEmbeddedServletContainer.java:165)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.startEmbeddedServletContainer(EmbeddedWebApplicationContext.java:293)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:141)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766)
    at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1191)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1180)
    at com.miw.mcb.server.ReactAndSpringDataRestApplication.main(ReactAndSpringDataRestApplication.java:18)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.boot.maven.AbstractRunMojo$LaunchRunner.run(AbstractRunMojo.java:478)
    at java.lang.Thread.run(Thread.java:745)
  Caused by: java.lang.IllegalStateException: Tomcat connector in failed state
    at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.start(TomcatEmbeddedServletContainer.java:159)
    ... 16 common frames omitted
  </code></pre>