Force Grails to listen on an external IP address

I started the Grails application by listening to port 8080 by default, and also runs grails as root to listen on port 80:

#grails -Dserver.port=80 run-app 

This works fine on the local host, but when I access it from an external IP address, it just doesn't work. To be sure, I have Apache running on the same server, and I can access it perfectly perfectly over the Internet.

Is there some kind of configuration that I skipped 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 

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

Thanks in advance.

Hanxue

+7
source share
3 answers

If you really want to run it using run-app, enter the IP address of your server at the command line, for example:

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

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

I think you should study mod_proxy and mod_proxy_apj to β€œhide” your grails server in order to return the Apache server

+2
source

As cjstehno noted, in production you must run the application as a war deployed in AppServer (Tomcat, TCServer, etc.). And ideally, this works for WebServer (Apache) to route traffic.

See β†’ http://grails.org/doc/latest/guide/17.%20Deployment.html

0
source

if you are on ec2, make sure that the firewall has opened port 80 in the world (or any ip address you are connecting from). this is not the default and disables many ec2 users for the first time.

0
source

All Articles