doujiangqu2823 2013-10-01 00:03
浏览 84
已采纳

Go Revel框架端口9000已在使用中

I'm following along with the Go Revel framework nicely until I go to run the test app:

$ revel run myapp

which gives me the all the correct output but also gives the following error:

ERROR 2013/09/30 19:51:41 harness.go:167: Failed to start reverse proxy: listen tcp 
<nil>:9000: address already in use

When I run this:

$ sudo lsof -n -i4TCP:9000 | grep LISTEN

I get this:

COMMAND   PID USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
php-fpm 11007 root   11u  IPv4 0xffffff801441dde0      0t0  TCP localhost:cslistener (LISTEN)
php-fpm 11008 _www    0u  IPv4 0xffffff801441dde0      0t0  TCP localhost:cslistener (LISTEN)
php-fpm 11009 _www    0u  IPv4 0xffffff801441dde0      0t0  TCP localhost:cslistener (LISTEN)
php-fpm 11010 _www    0u  IPv4 0xffffff801441dde0      0t0  TCP localhost:cslistener (LISTEN)

I have a PHP-NGINX app running on port 80 and don't want to lose that but have no idea whether this means this PHP app is blocking my Go app from running.

Can anyone chime in?

I'm running on MacOS X 10.7.5.

  • 写回答

4条回答 默认 最新

  • doutian4046 2013-10-01 01:17
    关注

    You can change the port of a revel application with either:

    1. Editing the config/app.conf file and setting

      http.port = 8888
      
    2. Running your revel application with a parameter specifying the port. You'll also need to specify either dev or prod to state your environment:

      revel run myapp dev 8888
      
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误