让Grails的监听外部IP地址 [英] Make Grails listen on external IP address

查看:386
本文介绍了让Grails的监听外部IP地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始一个Grails应用程序监听默认端口8080,以及运行作为Grails的根在80端口监听:

I started a Grails app listening to the default port 8080, as well as running grails as root to listen at port 80:

#grails -Dserver.port=80 run-app

这工作得很好在本地主机上,但是当我从一个外部IP地址访问它,它只是无法工作。为了保险起见,我也有同样的服务器上运行的Apache,我可以访问它完美的罚款在互联网上。

This works perfectly well on localhost, but when I access it from an external IP address, it just fails to work. Just to be sure, I have Apache running on the same server and I can access it perfectly fine over the Internet.

有一些配置选项,我很想念这里问Grails的所有IP地址听?

Is there some configuration option I am missing here to ask Grails to listen on all IP addresses?

我甚至试过,但无济于事:

I even tried this but to no avail:

#grails -Dserver.host=0.0.0.0 -Dserver.port=80 run-app

我使用Grails 1.4.0M1在Ubuntu 10.04上一个EC2实例。

I am using Grails 1.4.0M1 on Ubuntu 10.04 on an EC2 instance.

在此先感谢。

Hanxue

推荐答案

如果你真的想与运行应用程序运行时,在命令行中输入服务器的IP地址,就像这样:

If you really want to run it with run-app, the enter your servers IP address in your command-line, like this:

#grails -Dserver.host=xx.xx.xx.xx -Dserver.port=80 run-app

不过,你可能会发现,你得到冲突与在同一个IP上运行Apache服务器。

But you will probably find that you get a conflict with your Apache server running on the same IP.

我想你应该考虑使用mod_proxy和mod_proxy_apj为隐藏你的Grails服务器beghind Apache服务器

I think you should look into using mod_proxy and mod_proxy_apj to "hide" your grails server beghind your Apache server

这篇关于让Grails的监听外部IP地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆