users@glassfish.java.net

Re: How to redirect to another port

From: <glassfish_at_javadesktop.org>
Date: Thu, 23 Sep 2010 14:08:09 PDT

See here for a solution with iptables:
http://dominikdorn.com/2010/04/tomcat-glassfish-jetty-port-80-iptables-nat/

Or use authbind, which is what I prefer, assuming you're on Linux and your Glassfish server is running under a user named "glassfish":

touch /etc/authbind/byport/80
chmod 500 /etc/authbind/byport/80
chown glassfish /etc/authbind/byport/80

Add the following to your domain.xml:
<jvm-options>-Djava.net.preferIPv4Stack=true</jvm-options>

Finally, start Glassfish like this:
authbind --deep asadmin start-domain domain1

That takes care of the port.

To get rid of the MY_APP part of the URL, simply set the root context to "/" when deploying your application.

HTH,
Harald
[Message sent by forum member 'hwellmann']

http://forums.java.net/jive/thread.jspa?messageID=483511