在网络主机上设置一个简单的Go服务器。

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

Set up a simple go server in a webhost

问题

我想在一个网络主机上设置一个简单的Go服务器。我购买了一个域名mydomain.com,并使用Bluehost进行托管。现在,我正在按照Go教程进行学习,我通过这个例子http://tour.golang.org/#59,它在我的机器上运行良好。现在,我想让HelloWorldServer在我调用mydomain.com:4000或其他端口时也能工作。

我所做的是通过ssh连接到我的Bluehost服务器,然后在那里安装Go,编译服务器并运行。但是当我尝试访问mydomain.com:4000时,它显示未找到。我还尝试将"localhost:4000"更改为":4000",有什么办法可以让它工作吗?

非常感谢任何帮助或指导。(一些更多的细节:这是一个共享托管账户)

英文:

I wanted to set up a simple go server in a webhost. I acquired a domain mydomain.com and hosted it using Bluehost. Now, going through the Go tutorial, I went through this example http://tour.golang.org/#59 and it works fine on my machine. Now, instead, I want to make the HelloWorldServer work when I call mydomain.com:4000 or some other port.

What I did was ssh to my server at bluehost, install go there, then compile the server and run. But then I try to access mydomain.com:4000 and it is not found. I also tried to change "localhost:4000" to just ":4000". any ideas how to make it work ?

Any help or pointers are appreciated. (some more details: it is a shared-hosting account)

答案1

得分: 2

这是因为你的BlueHost服务器上的防火墙在共享托管账户上没有打开端口(包括4000端口),防火墙端口限制

如果你想进行一些简单(或者不那么简单)的网页托管,为什么不考虑一下Google App Engine呢?

英文:

This is due to the firewall on your BlueHost server not having ports (including 4000) open on a shared hosting account, Firewall Port Restrictions

If you want to do some simple (and not so simple) web hosting, why don't you look at Google App Engine

huangapple
  • 本文由 发表于 2014年1月19日 09:18:44
  • 转载请务必保留本文链接:https://go.coder-hub.com/21212073.html
匿名

发表评论

匿名网友

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

确定