Monday, March 10, 2008

How to change the default port number of Grails server

Grails use Jetty as its server,and run port 8080 by default.for some reason,we should change it ,for example 9090,how to do?There are two ways:
1) when you do run-app,add command -Dserver.port=9090.for example
>>grails -Dserver.port=9090 run-app
2) if you want to change the port to 9090 as default value,then Edit the file GRAILS_HOME/scripts/Init.groovy and change the phrase 8080 to another port number like 9090 .

1 comment:

Bill Comer said...

In grails 1.3.5 at least the file to change is _GrailsSettings.groovy