Cómo cambiar el puerto de grails localhost?


Estoy usando grails 2.0.4. Y quiero usar port:8090 en lugar de 8080 para localhost. Así que necesita ayuda para cambiar el puerto a 8090 de forma permanente.

 86
Author: lifeisfoo, 2012-06-09

11 answers

Hay dos opciones:

  1. Cambie grails.serverURL en Config.groovy de "http://localhost:8080/${appName}" a "http://localhost:8090/${appName}".
  2. Inicie grails con -Dgrails.server.port.http=8090 en la línea de comandos. Establezca la variable de entorno GRAILS_OPTS en -Dgrails.server.port.http=8090 para que se aplique automáticamente.
 102
Author: ataylor,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-08-21 22:10:29

Agregue lo siguiente a BuildConfig.groovy:

grails.server.port.http = 8090

Véase http://forum.springsource.org/archive/index.php/t-97024.html para más detalles.

 120
Author: Chris,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-05-03 12:27:34

Si está utilizando Netbeans IDE, establezca lo siguiente:

Config: -> BuildConfig.groovy: - > grails.servidor.portuario.http = 8090 y reinicie el servidor.

Sin IDE, escriba en el símbolo del sistema -:

grails -Dserver.port 8090 run-app

O

grails -Dserver.port=8090 run-app
 36
Author: Gautam,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-01-08 09:35:24

Para griales 3 puede poner esto en su solicitud.yml

server:
    port: 9999
 13
Author: user738048,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-06-30 23:18:40

Si está utilizando IntelliJ IDE entonces

Desde el menú de la aplicación, haga clic en Ejecutar >> Editar configuraciones... > > Opciones de VM: - Dgrails.servidor.portuario.http = 8180

 5
Author: Jason Heithoff,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-01-07 21:20:54

Grails run-app-Dserver.puerto = 8090

O utilice otro número de puerto

En Intellij: Ctrl + Alt + G (teclado genérico); Cmd + Alt + G (teclado Mac) y utilizar solamente:

Run-app-Dserver.puerto = 8090

 5
Author: Samuel Ivan,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-08-25 22:27:14

Línea de comandos: grails run-app -port 8090

 4
Author: Cad,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-05-18 01:14:05

Ejecute el comando (Ctrl + Alt + g)

  1. Hasta grails versión 2.x: run-app -Dserver.port=8090
  2. Para grails versión 3.x: run-app --port=8090
 3
Author: ujjwol shrestha,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-12-21 06:07:47

No dijiste qué IDE estás usando. Si está utilizando Netbeans, simplemente haga clic con el botón derecho en el nombre del proyecto y elija Propiedades. Desde la categoría Configuración General, puede cambiar fácilmente el puerto del servidor a lo que desee.

 0
Author: Universitas,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-06-11 20:57:04

Puede ejecutar la aplicación grails utilizando el siguiente comando en el terminal. el puerto de ejecución predeterminado es 8080.

Grails run-app-Dserver.puerto = 9090

Esto ejecutará la aplicación en el puerto 9090.

 0
Author: Satish Kale,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-03-27 04:47:32

Escriba lo siguiente en la línea de comandos:

grails -Dserver.port=8090 run-app
 0
Author: Yaseen Mohamed,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-08-04 05:39:01