Forum Moderators: phranque

Message Too Old, No Replies

Apache ProxyPass with Glassfish 3

Proxying requests to Glassfish from Apache

         

apachegf3

10:10 pm on Dec 22, 2010 (gmt 0)

10+ Year Member



Hi,

I have a Apache 2.2 web server on port 80 and a Glassfish 3.0.1 application server running a web application on port 8080.

I'm trying to proxy requests to the Glassfish server, by using Apache with mod_proxy.

The problem is, I am only getting the static content in the browser. No Javascript, no CSS or images.

This is my apache config:

<VirtualHost *>
ServerAdmin webmaster@example.net
ServerName example.com
ServerAlias www.example.com

<Proxy *>
Order deny,allow
Allow from all
</Proxy>


#I have also tried skipping this
ProxyRequests Off

#I have also tried skipping this
ProxyPreserveHost On
#I have also tried skipping this
proxyPassReverseCookiePath / /

#I have also tried using the domain name instead of localhost
ProxyPassReverse / http://localhost:8080/<Web_App_Context>/
ProxyPass / http://localhost:8080/<Web_App_Context>/



The logs show nothing unusual.

This configuration seems to be what everyone suggests doing according to what I read on the web.

If you can help, please reply.

Thanks.

jdMorgan

1:35 am on Dec 23, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What do you see in your error log files (both Apache Glassfish front-end and back-end) when you load a page that includes css of JS files? What do you see when using a server headers checker (See "Live HTTP Headers" add-on, for example) to monitor such a page-load?

Look for 404, 403, or other error codes on requests for these included objects, and note the requested URLs and what filepaths they are being resolved to (either or both possibly incorrect).

Jim

apachegf3

8:59 am on Dec 23, 2010 (gmt 0)

10+ Year Member



Hi,

Thanks for your reply.

The logs show nothing particular:

Glassfish logs show nothing unusual:
Apache shows: [Thu Dec 23 03:52:09 2010] [warn] [client myip] No usable charset infor
mation; using configuration default, referer: [mydomain.com...]

Using FireBug in Firefox, when I load the page I get:

PrimeFaces is not defined
JQuery is not defined

Many times.

PrimeFaces is my Java Server Faces component library.

I'm not sure what to make of this.

jdMorgan

7:50 pm on Dec 31, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Looks like you have a configuration error. You'll need to dig into the config files, and look for the places where PrimeFaces and JQuery are to be defined -- Make sure that those lines are not commented out.

Having done that, set the default character set using mod_mime AddCharSet if you are still getting the "No usable charset" warning.

Since this forum focuses on Apache, that's all I know about this. You might want to see if there is a dedicated Glassfish forum you can ask more questions on.

Jim