19

Instead of deploying my app to

http://localhost:8080/myApp

I want to deploy it to

http://localhost
Dónal
  • 185,044
  • 174
  • 569
  • 824
Nandita
  • 307
  • 1
  • 6
  • 11

3 Answers3

30

To change the run-app port, edit grails-app/conf/BuildConfig.groovy and add the line

grails.server.port.http = 80

To remove the context (the 'myApp' part) edit application.properties and add the line

app.context=/
Burt Beckwith
  • 75,342
  • 5
  • 143
  • 156
  • 9
    or to remove the 'myApp' part, add the following code block to `Config.groovy`: `grails.app.context="/"`. Not sure but application.properties is auto generated file, so it is safe to add in `Config.groovy` – mj.scintilla May 14 '11 at 11:17
5

deploy your app to a tomcat server with the war name as ROOT.war. Because war names describe contexts... papa.war will be available through [root_domain]/papa

Grooveek
  • 10,046
  • 1
  • 27
  • 37
  • i got one more solution by googling i.e if i write grails.app.context="/" in conf.groovy file ill get url with out app name.but i when i run with -Dserver.port=80 run-app it won work as before and app name will display. – Nandita May 13 '11 at 09:49
  • i am still in development mode not deployed yet..and i am using 80 apache port bcz i don want to display any port number in URL – Nandita May 13 '11 at 09:51
  • SO in development how can i achieve it with default port? – Nandita May 13 '11 at 09:52
  • 1
    but what if I have more than one Application running. I could not run them all using ROOT.war!? – skurt Nov 27 '11 at 11:25
4

To remove the port, use:

grails -Dserver.port=80 run-app
Dónal
  • 185,044
  • 174
  • 569
  • 824