users@glassfish.java.net

Re: Glassfish production url

From: Kristian Rink <kawazu_at_zimmer428.net>
Date: Wed, 06 Aug 2008 12:00:18 +0200

Hi there;
glassfish_at_javadesktop.org schrieb:

> http://localhost:9080/<contextroot>/test.jsp. But in our production
> environment we want something like http://localhost/test.jsp. We have
> some php code which is already developed and we would like to use it. So
> I understand that we need to integrate our GlassFish server with Apache.

We do something like this using apache2 mod_proxy and rules like

ProxyPass /<contextroot> http://<backend-server>:8082/<contextroot>
ProxyPassReverse /<contextroot> http://<backend-server>:8082/<contextroot>

by slightly following the apache2 reverse proxy tutorial (see [2] for a
starting point). Though I haven't tried this, you might as well be able to
dump /<contextroot> here altogether doin' something like


ProxyPass / http://<backend-server>:8082/<contextroot>/
ProxyPassReverse / http://<backend-server>:8082/<contextroot>/

but this however will get you into trouble dealing with your PHP scripts.
Where do they live on the apache2 installation, and how do they have to be
accessed? Easiest way, in my opinion, would be dumping them to a "context
root" of their own on apache2, to have them out of the way, and use your
glassfish context root for proxying your glassfish hosted application.

If not, you might want to try the "ProxyPass / " thing and play with
excluding things from being proxied (see [2] for a short intro on that),
which might or might not get you where you want (untested, as well, but
seems a reasonable way to go...).

Good luck and best regards,
Kristian


[1] http://www.apachetutor.org/admin/reverseproxies
[2] http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypass


-- 
Kristian Rink
cell    :  +49 176 2447 2771
business: http://www.planconnect.de
personal: http://pictorial.zimmer428.net
"we command the system. calling all recievers.
we are noisy people for a better living".
(covenant - "monochrome")