Scala spray 无法绑定到 EC2 Public DNS

Scala spray failing to bind to EC2 Public DNS

我刚刚停止 运行在 EC2 Ubuntu 实例上运行 Scala Spray 可执行文件以启动更新版本的应用程序。当我尝试 运行 新的可执行文件时,出现以下错误:

ubuntu@ip-172-32-92:~/suredbits-dfs$ ./target/universal/stage/bin/suredbits-dfs [WARN] [08/14/2015 03:22:30.314] [NflDbApiActorSystemConfig-akka.actor.default-dispatcher-5] [akka://NflDbApiActorSystemConfig/user/IO-HTTP/listener-0] 绑定到 ec2-52-116-195.us-west-2.compute.amazonaws.com/172.32.92:80 失败

我已通过 运行 执行此命令检查以确保端口 80 已打开且可用:

netstat -anp | grep 80

没有 return 任何东西。看来我的端口是打开的,Scala Spray 只是再次绑定失败。以下是我尝试在可执行文件中启动服务器的方式:

package com.suredbits.dfs

/**
 * Created by chris on 8/9/15.
 */

import akka.actor.ActorSystem
import com.github.nfldb.config.{NflDbApiActorSystemConfig, NflDbApiDbConfig}
import com.suredbits.dfs.nfl.scoring.NflPlayerScoringService
import spray.routing.SimpleRoutingApp

object Main extends App with SimpleRoutingApp with NflPlayerScoringService
  with NflDbApiDbConfig with NflDbApiActorSystemConfig {

  import actorSystem._

/*  startServer(interface = "localhost", port = 80) {
    path("hello") {
      get {
        complete {
          <h1>Say hello to spray</h1>
        }
      }
    } ~ nflPlayerScoringServiceRoutes
  }*/

  startServer(interface = "ec2-52-116-195.us-west-2.compute.amazonaws.com", port = 80) {
    path("hello") {
      get {
        complete {
          <h1>Say hello to spray</h1>
        }
      }
    } ~ nflPlayerScoringServiceRoutes
  }
}

sudo 开始进程:

sudo ./target/universal/stage/bin/suredbits-dfs

为什么? You are trying to use a privileged port(1024以下的端口)。只有 root 可以访问这些端口。提示我的线索是您检查了 netstat 并且端口 80 上没有其他任何东西。