Beego在AWS上运行的问题

huangapple go评论103阅读模式
英文:

Beego running on AWS Issue

问题

我在AWS上尝试运行Beego,但无论我尝试了什么,似乎都无法连接到运行Beego的8080端口。我不确定是AWS还是Beego的问题,但我似乎也无法连接到80端口(我尝试更改安全组设置,包括添加一个新的安全组以允许访问这两个端口)。然而,当我使用curl命令访问127.0.0.1时,可以看到一个Beego模板,但在我的E2实例上却没有任何内容。我已将app.conf文件中的httpaddr更改为0.0.0.0,但似乎没有什么效果。我该如何解决这个问题?

英文:

I have tried running Beego on AWS, but no matter what I have tried, I can't seem to connect to port 8080, which is where Beego is running on. I'm not sure if it's an AWS or a Beego issue, but I can't seem to connect to port 80 either (I have tried to change the security group setting, including adding a new one to allow access to both ports). However, when I curl 127.0.0.1, a Beego template is there, but there is nothing at my E2 instance. I changed the app.conf file's httpaddr to 0.0.0.0, but that didn't seem to do much. How can I approach this problem?

答案1

得分: 2

请检查你的 conf/app.conf 文件:

httpaddr = localhost

默认情况下,beego可以配置为仅监听本地主机(如此答案中所述)。

其他问题包括(针对AWS部分):

  • 配置安全组以允许端口8080的入站访问。
  • 禁用任何应用程序防火墙,如Windows防火墙或Iptables,是否禁用了该端口?
  • 检查 netstat -anp|grep 80sudo iptables -L

对于Ubuntu,OP dtrinh100评论中提到需要:

> 通过禁用iptables使其工作,但由于我正在运行Ubuntu,所以稍有不同。
我使用了来自“如何在Ubuntu上启动/停止iptables?”的iptables命令,它允许我在Ubuntu中关闭iptables。

英文:

Check you conf/app.conf file:

httpaddr = localhost

By default, beego can be configured to listen to localhost only (as stated in this answer).

Other issues include (for the AWS part):

  • configuring security groups to permit inbound access on port 8080.
  • disabled any Application firewalls like Windows Firewall or Iptables for that port?
  • checking netstat -anp|grep 80 and sudo iptables -L

For ubuntu, the OP dtrinh100 mentions in the comments having to:

> get it to work by disabling iptables, but since I'm running Ubuntu, it was a little different.
I used the iptables command from "How to start/stop iptables on Ubuntu?", which allowed me to turn off iptables in Ubuntu.

huangapple
  • 本文由 发表于 2014年9月13日 15:00:20
  • 转载请务必保留本文链接:https://go.coder-hub.com/25820721.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定