users@glassfish.java.net

[gf-users] Re: [3.1.2.2] Protecting from 404 during startup

From: Martin Gainty <mgainty_at_hotmail.com>
Date: Thu, 5 Jun 2014 10:43:52 -0400

i havent seen this thus far so I'll suggest here

/etc/modules/mod_jk.so is installed
http://localhost/URILandingZoneToPassToAJP/etc/httpd/conf/workers.properties contains association of 8009 as AJP port e.g.
worker.list=worker1
worker.worker1.port=8009
worker.worker1.host=localhost
worker.worker1.type=ajp13
#worker.list=ajp13
#worker.ajp13.port=9008
#worker.ajp13.host=localhost
#worker.ajp13.type=ajp13/etc/httpd/conf.d/glassfish.conf # where to find workers.properties
#warning JKWorkerdFile should only be included ONCE
#if the *server.include file below exists.. then comment out the JkWorkersFile
#/usr/local/psa/admin/conf/generated/13439510590.54764400_server.include
#JkWorkersFile /etc/httpd/conf/workers.properties

# where to put jk logs
JkLogFile /var/log/httpd/mod_jk.log
# set the jk log level [debug/error/info]
JkLogLevel info
# select the log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
# JkOptions indicate to send SSL KEY SIZE,
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
# jkRequestLogFormat set the request format
jkRequestLogFormat "%w %V %T"
# send everything for context /dynamic to worker named worker1 (ajp13)
jkMount /URILandingZoneToPassToAJP/* worker1
jkMount /landscape worker1
ProxyRequests off

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

<Location /dynamic >
ProxyPass ajp://localhost:8009/URILandingZoneToPassToAJP
</Location>

#create the ajp listener to listen on 8009
asadmin create-network-listener --protocol http-listener-1 --listenerport 8009 --jkenabled true jk-connector

#restart glassfish
https://www.stagejava.net/forum/topic/glassfish/glassfish/glassfish-and-modjk-not-working-404-error

Martin

From: pawel.veselov_at_gmail.com
Date: Wed, 4 Jun 2014 15:38:43 -0700
To: users_at_glassfish.java.net
Subject: [gf-users] Re: [3.1.2.2] Protecting from 404 during startup

On Wed, Jun 4, 2014 at 2:53 PM, Oleksiy Stashok <oleksiy.stashok_at_oracle.com> wrote:


Hi Pawel,



unfortunately it's not possible to do in general, but AFAIR it should work fine for AJP listener (not HTTP).

So if you put Apache as a front-end and redirect requests to Glassfish via AJP protocol - it should not report 404 error during startup.

Unfortunately, we had serious performance issues with Apache HTTPD, and ha-proxy doesn't speak AJP....

I'll just have to manually exclude the instance from ha-proxy then, until it fully starts-up...
Thank you.




Thanks.



WBR,

Alexey.





On 04.06.14 13:27, Pawel Veselov wrote:


Hi.



Is there a way to avoid the GF server open it's HTTP listener until all of the applications have been started? Otherwise, the request bounce back with 404, until the start-up phase finishes...



Thank you,

  Pawel.