grails

Change the Default Port On Grails Application

Grails applications by default run on 8080 port.But sometimes  other applications may use the same port ,to solve this problem you need to do some simple console work while starting your application.Let say you want to run your application on port 9090 insted of default one.

grails -Dserver = 9090 run-app

Making changes on default port is simple like that , but if you wanna make this change permanent you can create BuildConfig.groovy file under directory “/grails-app/conf”

"grails-app/conf/BuildConfig.groovy"

How To Install Grails on MacOsX

In order to setup grails and use it form terminal you have to do some work but not much.(If you want to use grails directly you can get Netbeans or IntelliJ IDE and just show where is grails package and you are ready to go)

First you need to download grails then apply to following command from terminal

  • $sudo mv ~/downloads/grails-1.0.1 /usr/share (move it to usr/share)
  • $cd /usr/share (change to that directory)
  • $sudo chmod 755 grails-1.0.1/bin/* (give permission to grails/bin )
  • $ln -s grails-1.0.1 grails (create symbol link)
  • open ~/.profile to edit( vi ~/.profile ) (open profile file to edit)
  • add the following path and home declerations to profile
  • GRAILS_HOME=/usr/share/grails; export GRAILS_HOME (add)
  • PATH=$GRAILS_HOME/bin:$PATH; export PATH (then add this without spaces around = )