0

I am running my Grails 3.1.3 application as standalone JAR using the embedded Tomcat servlet container and start the WAR by the following command:

java -jar -server -Dserver.host=127.0.0.1 -Dserver.port=50000 -Dgrails.env=prod -Xmx768M myApp.war

By using the server.port I successfully managed to set the Tomcat listening port to 50000. But the server.host does not seem to set Tomcats bind address to 127.0.0.1 since it is visible from the Internet.

Is there a way to successfully set the bind address?

saw303
  • 8,051
  • 7
  • 50
  • 90

2 Answers2

1

The question has been answered here. Simply use the property server.address to set the bind address.

Community
  • 1
  • 1
saw303
  • 8,051
  • 7
  • 50
  • 90
1

In application.yml, i set my urls and ports as

    grails.serverURL: 'http://localhost:8080/appname'
    server:
      port: 8080
      contextPath: '/appname'
Arjang
  • 731
  • 1
  • 10
  • 19
  • Thanks for your answer. I don't think that will work. `grails.serverURL` does not set Tomcats bind address. It is used for link generation. But according to the Spring Boot documentation my answer above solves the problem. – saw303 Mar 06 '16 at 20:38