Specifying the Play 2.0 port with the "dist" parameter

I am creating a batch project using dist and trying to modify the generated start script to start the application on port 9001 .

Here is what is generated:

 exec java $* -cp "`dirname $0`/lib/*" play.core.server.NettyServer `dirname $0` 

Here is what I tried, which does not seem to work.

 exec java $* -Dhttp.port=9001 -cp "`dirname $0`/lib/*" play.core.server.NettyServer `dirname $0` 

Any ideas?

I also tried specifying http.port=9001 in application.conf no avail. It was very simple to do it in Play 1.2.X, it seems a step back.

+6
source share
1 answer

After running play dist and then extracting the generated package, you can run Play 2 on a different port by running:

 ./start -Dhttp.port=5432 

Or, if you prefer to edit the start script, you can update it:

 #!/usr/bin/env sh exec java $* -Dhttp.port=5432 -cp "`dirname $0`/lib/*" play.core.server.NettyServer `dirname $0` 

And then run:

 ./start 
+7
source

All Articles