2012-04-04 64 views
1

因此,我对于设置服务器有点新鲜。我一直在努力解决各种SQL问题。我认为,我和一个成功运行的游戏应用程序之间唯一的一件事是:错误在Heroku上部署Play 2.0应用程序

Starting process with command `target/start -Dhttp.port=80 ` 
2012-04-04T05:58:52+00:00 app[web.1]: Play server process ID is 1 
2012-04-04T05:58:53+00:00 app[web.1]: [info] play - database [default] connected at jdbc:mysql://us-cdbr-east.cleardb.com/heroku_cd914b667dae168 
2012-04-04T05:58:56+00:00 app[web.1]: [info] play - Application started (Prod) 
2012-04-04T05:58:56+00:00 app[web.1]: Oops, cannot start the server. 
2012-04-04T05:58:56+00:00 app[web.1]: org.jboss.netty.channel.ChannelException: Failed to bind to: /0.0.0.0:80 
... more errors 

有没有人发现任何问题?我需要任何java选项参数吗?

我试图在Procfile指定一个用户端口,并得到了不同的错误信息:

2012-04-04T07:01:36+00:00 heroku[web.1]: Starting process with command `target/start -Dhttp.port=2000` 
2012-04-04T07:01:37+00:00 app[web.1]: Play server process ID is 1 
2012-04-04T07:01:40+00:00 app[web.1]: [info] play - database [default] connected at jdbc:mysql://us-cdbr-east.cleardb.com/heroku_cd914b667dae168 
2012-04-04T07:01:45+00:00 app[web.1]: [info] play - Application started (Prod) 
2012-04-04T07:01:45+00:00 app[web.1]: [info] play - Listening for HTTP on port 2000... 
2012-04-04T07:01:46+00:00 heroku[web.1]: Error R11 (Bad bind) -> Process bound to port 2000, should be 47248 (see environment variable PORT) 
2012-04-04T07:01:46+00:00 heroku[web.1]: Stopping process with SIGKILL 
2012-04-04T07:01:47+00:00 heroku[web.1]: Process exited with status 137 
2012-04-04T07:01:47+00:00 heroku[web.1]: State changed from starting to crashed 

我不知道发生了什么。我该如何改变这个环境变量?这个heroku过程模型对我来说非常混乱。

回答

5

我认为问题在于你不允许Heroku指定端口。的https://devcenter.heroku.com/articles/error-codes#r11__bad_bind

所以不是这样:谷歌搜索你的错误,我觉得

网:目标/启动-Dhttp.port = 80

做这个

网站: target/start -Dhttp.port = $ PORT

James对于获得部署更高级的Play 2.0应用程序here进行了很好的写作。

+0

谢谢!!!!!!!!! – wbarksdale 2012-04-04 15:49:46