How do I change the default port (9000) that Play uses when I execute the "run" command?

Related searches

How can I change the default port used by the play framework in development mode when issueing the "run" command on the play console.

This is for playframework 2.0 beta.

Using the http.port configuration parameter either on the command line or in the application.conf seems to have no effect:

C:\dev\prototype\activiti-preso>play run --http.port=8080
[info] Loading project definition from C:\dev\prototype\activiti-preso\project
[info] Set current project to activiti-preso (in build file:/C:/dev/prototype/activiti-preso/)


Windows, really? Ok, disabling colors.

--- (Running the application from SBT, auto-reloading is enabled) ---

[error] org.jboss.netty.channel.ChannelException: Failed to bind to: 0.0.0.0/0.0.0.0:9000
[error] Use 'last' for the full log.
Play 2.x

In Play 2, these are implemented with an sbt plugin, so the following instructions are really just sbt tasks. You can use any sbt runner (e In Play 2, these are implemented with an sbt plugin, so the following are really just sbt tasks. You can use any sbt runner (e.g. sbt, play, or activator). Below the sbt runner is used, but you can substitute it for your sbt runner of choice.

Play 2.x - Dev Mode

For browser-reload mode:

sbt "run 8080"

For continuous-reload mode:

sbt "~run 8080"
Play 2.x - Debug Mode

To run in debug mode with the http listener on port 8080, run:

sbt -jvm-debug 9999 "run 8080"
Play 2.x - Prod Mode

Start in Prod mode:

sbt "start -Dhttp.port=8080"
Play 2.x - Staged Distribution

Create a staged distribution:

sbt stage

For Play 2.0.x and 2.1.x use the target/start script (Unix Only):

target/start -Dhttp.port=8080

For Play 2.2.x & 2.3.x use the appropriate start script in the target/universal/stage/bin directory:

target/universal/stage/bin/[appname] -Dhttp.port=8080

With Play 2.2.x & 2.3.x on Windows:

target\universal\stage\bin\[appname].bat -Dhttp.port=8080
Play 2.x - Zip Distribution

To create a zip distribution:

sbt dist

For Play 2.0.x and 2.1.x use the start script (Unix Only) in the extracted zip:

start -Dhttp.port=8080

For Play 2.2.x use the appropriate script in the [appname]-[version]/bin directory:

[appname]-[version]/bin/[appname] -Dhttp.port=8080

With Play 2.2.x on Windows:

[appname]-[version]\bin\[appname].bat -Dhttp.port=8080
Play 1.x

Change the http.port value in the conf/application.conf file or pass it command line:

play run --http.port=8080

How do I change the default port (9000) that Play uses - html, Play FAQ: How do I run the Play Framework web server on a different port than the default port (9000)?. Solution: At the Play console, instead of just typing " run " to run the server, type " run 8080 " to run the server on port 8080. (Server started, use Ctrl+D to stop and go back to the console) scala. Play 1.x. Change the http.port value in the conf/application.conf file or pass it command line: play run --http.port=8080 Play 2.x. Play 2.x is an sbt plugin so the following commands are really just sbt commands. You can use any sbt launcher (e.g. sbt, play, or activator).

Play 2.0-RC4

It is important to include quotes around the play command you want to run. In my case without the quotes play would still run on port 9000.

play "run 8080"

Alternatively you could run the following from the play console (type 'play' to get to the console)

run 8080

Changing the default port number(9000) of a Play Application, The main configuration file that you'll use is the application.conf file. properties and environment variables to change settings when you run the application in The default is to listen on port 9000 at the 0.0.0.0 address (all addresses). 5 How do I change the default port (9000) that Play uses when I execute the “run” command? Jan 20 '14 5 IntelliJ not resolving Play's build.sbt libraryDependencies Feb 20 '14

Hope this helps someone.

via sbt settings:

...
.settings(PlayKeys.playDefaultPort := 8855)
...

Running the Play Framework on a different port than the default port , The answer is nowhere: Play doesn't use any class files but reads the Scala Just return to the command line, go to the newly-created helloworld/ directory and type play run. Play will now load the application and start a Web server on port 9000. #{extends 'main.html' /} #{set title:'Home' /} <form action="@{Application. sequence: The sequence of ports someone must access to open or close port 22. The default ports are 7000, 8000, and 9000 to open it, and 9000, 8000, and 7000 to close it. You can change these or add more ports to the list. For our purposes, we’ll stick with the defaults.

Production Configuration - 2.8.x, Recently started using play 2.1.x. I wonder what is the best way of executing a raw sql query once per request? I use postgres and need to specify what schema - "set search_path to"-type of quer

For Play 2.2.x on Windows with a distributable tar file I created a file in the distributable root directory called: {PROJECT_NAME}_config.txt and added:

-Dhttp.port=8080

Where {PROJECT_NAME} should be replaced with the name of your project. Then started the {PROJECT_NAME}.bat script as usual in the bin\ directory.

Your first Play Scala application, This line defines Apache to listen on port 80. All you have to do is change that port 80 to any port that you want to use. Make sure that the port that you will use is a free port and not already taken by other services. Read our guide about a free port scanner if you are not sure. Once you have edited the file, save it and restart Apache.

If configured to do so, the bottom panel will change to provide configuration options as shown in the following screenshot. You can now specify the IP address or name of a proxy server, as well as the appropriate port number. If a proxy is in use, the name and port number must be specified by the person who controls access to the proxy server.

I have installed Windows 10. My PC has a built in webcamera, but I don't want that set as my default webcam. I want to set my logitech usb webcam as the default. How do I do this? Note I don't want to uninstall or disable the internal webcam, I simply don't want it as the default.

Linux Cockpit (Fedora 21, Arch Linux, CentOS, RHEL) - browser-based server administration platform, listens on port 9090 tcp by default (both HTTP and HTTPS connections). Symantec Endpoint Protection Manager (SEPM) uses this port for initial HTTP communication between a remote management console and the SEPM to display the login screen.

Comments
  • @PereVillega it's hilarious because it's true: github.com/playframework/playframework/blob/…
  • After I saw the "Windows, really?" I had to ask my Windows using colleague to check if it still does that. We are using 2.2.0, and it no longer displays that message, but it does disable colors. I suspect that it was only in the beta version.
  • put PlayKeys.devSettings := Seq("play.server.http.port" -> "9001") in build.sbt
  • playframework.com/documentation/2.5.x/…
  • Interestingly enough that doesn't actually work. But perhaps that is just a bug or an issue with my system.
  • I believe right now this is only for 1.x, not yet implemented in 2.0 beta
  • I'm running Play 2.0. When i try play run 8080 it still runs on 9000. I'm on a Mac. What gives? EDIT: play "run 8080" works!
  • @StefanK. You can't put the port in a Play config file because the config isn't read until after Play is listening on the port. You can use an env var and set the port to that.
  • @James I've submitted the following issue with a workaround: github.com/sbt/sbt-native-packager/issues/155. Thanks!
  • For people running on Windows, the second option worked for me (Play 2.0.4 final).
  • This is the correct answer! Thank you! (For the other SBT and Play novices like me, add the .settings line to your build.sbt file, after lazy val root = (project in file(".")). For more details on SBT settings, see here: scala-sbt.org/1.0/docs/Custom-Settings.html )
  • This is the only solution I've found that works in play 2.7.x
  • in windows (using dist and zip options), passing command line arguments doesn't work (play 2.2.0). But providing the same arguments in config file works like a charm.