users@glassfish.java.net

Re: Glassfish and mod_jk not working / 404 error

From: <forums_at_java.net>
Date: Fri, 14 Dec 2012 10:30:15 -0600 (CST)

I have (mostly) fixed the problem. I used Apache's mod_proxy_ajp module (part
of Apache 2.2, so no need to download, compile, or install) in place of the
mod_jk module. I created a jk-enabled network listener in Glassfish in the
same way that I described in my original post. I edited
/etc/httpd/conf.d/glassfish.conf (the configuration file that I created) so
that it now looks like this: ProxyRequests off Order deny,allow Allow from
localhost ProxyPass ajp://localhost:8009/dynamic I was then able to able to
access my Web site's home page by typing www.eonsahead.com [1] in my
browser's address window and access Java Web applications by typing
www.eonsahead.com/dynamic/landscape [2] and
www.eonsahead.com/cellularautomata [3]. (I am still working on the site and
may change the location of these applications, so the links that I am
including in this post might not work for you.) At first, I saw many 404 and
503 errors from Apache. If I repeatedly hit the "reload page" button in my
browser, I sometimes got my Java application and sometimes a "page not found"
or "internal error message." Also, some of my applications that put
Servlet-generated images in pages gave me pages without the images. Forms on
applications did not work. It looks like I have fixed those problems by
logging onto the Glassfish administrator's console and adjusting the
parameters of the thread pool that my jk-connector network listener is using.
I found minimum = 2, maximum = 5, and idle = 900. I changed those numbers to
minimum = 4, maximum = 12, and idle = 4096. (I guessed at those numbers.) Now
I am working on finding the right mapping that will get Apache serving static
pages and PHP applications while Glassfish serves my Java applications. I
found many postings about how to use mod_jk to make Apache and Glassfish (or
Tomcat) work together (including instructions in the Oracle Glassfish 3.1
Administration Guide) but also found some suggestions on the Web that we
should now prefer mod_proxy_ajp. I'd like to hear from you if you know more
about this. Thanks to those read my posting!

[1] http://www.eonsahead.com
[2] http://www.eonsahead.com/dynamic/landscape
[3] http://www.eonsahead.com/dynamic/cellularautomata

--
[Message sent by forum member 'leontabak']
View Post: http://forums.java.net/node/893134