Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change grails localhost port?

Tags:

grails

I'm using grails 2.0.4. And I want to use port:8090 instead of 8080 for localhost. So need help to change the port to 8090 permanently.

like image 373
Mamun Sardar Avatar asked Jun 08 '12 20:06

Mamun Sardar


People also ask

How do I run Grails application?

Running a Grails Application Using run-appGo to the application directory. For example, go to the as-install /grails/samples/helloworld directory. Run the grails run-app command. The grails run-app command starts the Enterprise Server in the background and runs the application in one step.


2 Answers

This solution adds to the answers http://stackoverflow.com/a/10956283/122457. In Grails 2.x, add the following to BuildConfig.groovy:

grails.server.port.http = 8090 

See http://forum.springsource.org/archive/index.php/t-97024.html for further details.

like image 184
Chris Avatar answered Oct 07 '22 13:10

Chris


There are two options:

  1. Change grails.serverURL in Config.groovy from "http://localhost:8080/${appName}" to "http://localhost:8090/${appName}".
  2. Launch grails with -Dgrails.server.port.http=8090 on the command line. Set the GRAILS_OPTS environment variable to -Dgrails.server.port.http=8090 to have it applied automatically.
like image 26
ataylor Avatar answered Oct 07 '22 15:10

ataylor