Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the http port for play framework 2.4.1?

I come from a play 1.2.7 application and currently getting started with play framework 2.4.1 and scala. For a start I use the activator web ui to manage applications and there I cannot get the application to use a different http port.

I changed the http.port setting in conf/application.conf, but still play 2.4.1 tries to bind to port 9000, which is already in use. The setting I tried is:

http.port=7000

Any suggestion on how to change the port for a play framework 2.4.1 application that is run via the activator web ui?

Note that as suggested in the linked question I can use

./activator "run 7000"

in the application itself to have it bind to port 7000. Still my question is how can I get the same behaviour via the activator web ui?

like image 955
TeTeT Avatar asked Dec 04 '25 09:12

TeTeT


1 Answers

Through the application.conf in production:

play.server.http.port = 80

When you run the application with SBT:

PlayKeys.devSettings := Seq("play.server.http.port" -> "80")

Using run command:

$ run 80

For more details please refer the below links:

documentation-Config File

documentation-Server configuration options

like image 113
Sriram Avatar answered Dec 06 '25 01:12

Sriram



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!