在端口80上运行beego和apache。

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

running beego in port 80 and apache

问题

我正在尝试在Google Compute Engine实例中运行我的beego应用。我已经将其运行在8080端口上。但是当我尝试将其更改为80端口时,会出现"ListenAndServe Permission denied"错误。我应该怎么做才能让它在80端口上运行?另外,我可以使用Apache2来提供beego项目吗?这样我就可以在不执行"bee run"命令的情况下运行项目了。

英文:

I was trying to run my beego in google compute engine instances. I have it running on port 8080. But when I tried to change it to port 80, it will have an ListenAndServe Permission denied error. What shall I do to make it run on port 80. Also can I serve the beego project using Apache2 so that I can run the project without doing bee run?

答案1

得分: 1

1024以下的端口是特权端口,因此您需要root访问权限才能运行监听任何这些端口的进程。

对于您的第二个问题:您可以使用Apache或任何其他反向代理来托管您的应用程序。这基本上意味着您运行两个独立的进程(一个用于Apache,一个用于您的应用程序)。Apache监听端口80并转发给您的应用程序的请求。您可以很容易地为您的虚拟主机设置反向代理

英文:

Ports under 1024 are privileged, so you need root access to run a process that listens on any of them.

For your second question: you can use apache or any other reverse proxy to host your application. This basically means that you run two separate processes (one for apache and one for your application). Apache listens on port 80 and forwards the request that are meant for your application. It is quite easy to set up a the reverse proxy for your vhost.

huangapple
  • 本文由 发表于 2015年1月24日 02:31:04
  • 转载请务必保留本文链接:https://go.coder-hub.com/28116428.html
匿名

发表评论

匿名网友

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

确定