The Source for Java Technology Collaboration
Webmaster Alert: Posting to Jive Forums is currently not working. Estimated time for fix is unknown.

Home » java.net Forums » GlassFish » GlassFish

Thread: [Feedback]: Officially supporting Apache in GlassFish?

Welcome, Guest Help
Login Login
Guest Settings Guest Settings
Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 23 - Last Post: Jul 2, 2009 1:36 PM by: sjabele
jfarcand

Posts: 74
[Feedback]: Officially supporting Apache in GlassFish?
Posted: Oct 3, 2006 9:24 AM
  Click to reply to this thread Reply

Hi,

we are thinking having official support for Apache + mod_jk. Until recently, the support was not official and prone to regression (see https://glassfish.dev.java.net/issues/show_bug.cgi?id=1205).

By official support, I mean having our SQE team to run tests on several configurations|platform every weeks, write tests, admin|admin-gui supports, etc. Our next SJSAS official release (9.1) will also have documentation about how to do it, which version is supported, etc.

Now let use this thread to gather feedbacks about what we need to support (mod_jk, mod_proxy?, etc.). Feel free to gives recommendations|configuration|etc. The more information we have, the better the support will be.

Merci!

-- Jeanfrancois

dharrigan

Posts: 76
Re: [Feedback]: Officially supporting Apache in GlassFish?
Posted: Oct 17, 2006 12:35 AM   in response to: jfarcand
  Click to reply to this thread Reply

Hi,

I would welcome support for Apache with GF. As for the way of support, I don't know enough to comment on whether mod_jk or whether mod_proxy would be better, I leave that to more informed members.

IMHO, having support for Apache helps to separate the often found scenario where static content (HTML, images etc..) are served up using Apache, whereas the dynamic content is served up using, say GF or Tomcat or other containers. This separation is vital to allow a system to be designed to be load tolerant, resistant and performant and having official support for this using Apache + ? + GF would be amazing!

I would be happy to try out a few things if required since I'm interested in getting this configuration to work for me.

-=david=-

phenderson

Posts: 86
Re: [Feedback]: Officially supporting Apache in GlassFish?
Posted: Oct 17, 2006 3:25 AM   in response to: jfarcand
  Click to reply to this thread Reply

I think Apache support is a must have feature!!


Then we'll be well on the way to replace LAMP with

LAGP

Linux
Apache
Glassfish
Postgresql

Or maybe name it GLiPs, will need a catchy acronym.



I would choose mod_jk, BUT I've never used mod_proxy so I have no idea if it is better or when it would be used.


my 0.002 credits worth.

Peter.

rradutiu

Posts: 1
Re: [Feedback]: Officially supporting Apache in GlassFish?
Posted: Oct 17, 2006 3:37 AM   in response to: jfarcand
  Click to reply to this thread Reply

Hi,

I think that supporting AJP13 is a good idea.
Is there a differece in glassfish in supporting mod_jk and/or mod_proxy_ajp? I thought that if the AJP connector is supported then any HTTP server plugin that understands AJP could be used (mod_jk and mod_proxy_ajp for Apache, isapi_redirect.dll for IIS, nsapi_redirect.dll for iPlanet and Sun One web server).
Many sites have restrictions on the type of web server facing the internet and supporting AJP will give the option of integrating glassfish with almost any HTTP server.
Btw we have tested the AJP connector in glassfish with Apache + mod_jk and mod_proxy_ajp and IIS + isapi_redirect.dll and is working fine for both HTTP and HTTPS traffic (including SSL client authentication).

Radu

dharrigan

Posts: 76
Re: [Feedback]: Officially supporting Apache in GlassFish?
Posted: Oct 17, 2006 4:13 AM   in response to: rradutiu
  Click to reply to this thread Reply

Hi,

My only experience is of using mod_jk / AJP13 with GF and managed to get it working for me after help here in these forums.

-=david=-

jfarcand

Posts: 74
Re: [Feedback]: Officially supporting Apache in GlassFish?
Posted: Oct 17, 2006 8:16 AM   in response to: rradutiu
  Click to reply to this thread Reply

Hi Radu,

> Is there a differece in glassfish in supporting mod_jk and/or mod_proxy_ajp?

No, there isn't. Both use the AJP protocol. Hence both can be used :-)

Wow thanks for the feedback about IIS + isapi_redirect.dll :-) :-) If you can blog about it, that would be very good If you cannot, maybe you can send me the configuration you are using and I can blog about it. I'm sure a lot of win32 users will be interested about how this can be done.

Thanks!!!

-- Jeanfrancois

chainy

Posts: 15
Re: [Feedback]: Officially supporting Apache in GlassFish?
Posted: Oct 20, 2006 3:52 AM   in response to: rradutiu
  Click to reply to this thread Reply

> Btw we have tested the AJP connector in glassfish
> with Apache + mod_jk and mod_proxy_ajp and IIS +
> isapi_redirect.dll and is working fine for both HTTP
> and HTTPS traffic (including SSL client
> authentication).
>
> Radu

HI Radu do you have any pointers or setup configuration you used for the isapi_redirect.dll with IIS 6, because i have been trying to get this to work without success. I would gratefull for any advise you could give me on this to get it to work.
Thanks chainy

hktgan

Posts: 4
Re: [Feedback]: Officially supporting Apache in GlassFish?
Posted: Dec 6, 2006 7:10 AM   in response to: chainy
  Click to reply to this thread Reply

Glassfish+IIS installation. Do you have an installation description ?

Thanks !

tore.gard.andersen@linjeods.no

snies00

Posts: 12
Re: [Feedback]: Officially supporting Apache in GlassFish?
Posted: Oct 17, 2006 4:45 AM   in response to: jfarcand
  Click to reply to this thread Reply

IMO adding Apache support would be very beneficial for the following reasons:

- Apache is a mature and robust product (i.e., why reinvent the wheel, or in this case, HTTP server? :-)
- Apache has been thoroughly examined for security issues
- There is a large development community supporting Apache add-on modules for special purpose needs
- There is less risk to an organization to use Apache vs a different HTTP server (technical and non-technical issues)
- Apache has a large body of high-quality documentation already available

IMO if Apache support is added a key need that we have is the ability to support multiple virtual hosts such that each virtual host runs in its own JVM. This issue is very important for us (i.e., a show stopper) for various security and operational reasons. While I'm on the subject, I (and I am sure many others) would find it extremely helpful if someone would create a "how-to" article on configuring GlassFish + Apache for this type of configuration (TIA!)

zambizzi

Posts: 231
Re: [Feedback]: Officially supporting Apache in GlassFish?
Posted: Oct 17, 2006 7:28 AM   in response to: jfarcand
  Click to reply to this thread Reply

Not only is this a good idea, it just makes sense.

Apache is the biggest, best-known, most powerful http server on the planet and probably will be for the foreseeable future.

"Official" support for Apache in Glassfish would give it an instant boost over other app servers such as JBoss. Even though you *can* get other app servers working w/ Apache it isn't always easy and performance is known to suffer.

Great idea, when will it be ready? ;P

jfarcand

Posts: 74
Re: [Feedback]: Officially supporting Apache in GlassFish?
Posted: Oct 17, 2006 8:13 AM   in response to: zambizzi
  Click to reply to this thread Reply

Hi Zambizzi,

this is already supported in GlassFish here and described here:

http://weblogs.java.net/blog/jfarcand/archive/2006/03/running_glassfi_1.html

and here

http://weblogs.java.net/blog/amyroh/archive/2006/08/glassfish_suppo.html

Now this is so popular :-) we need to make sure we don't break the support (which I've unfortunately did recently). Having our QE team to run it every weeks will be good.

Thanks

-- Jeanfrancois

zambizzi

Posts: 231
Re: [Feedback]: Officially supporting Apache in GlassFish?
Posted: Oct 17, 2006 8:39 AM   in response to: jfarcand
  Click to reply to this thread Reply

Excellent...what are the performance implications? I remember doing this w/ Tomcat some time ago and experiencing some overhead due to mod_jk.

It'd also be nice to see an example of it done w/ IIS 6.0, if it works?

This would be a great piece to have in the wiki!

Thanks Jeanfrancois!

zambizzi

Posts: 231
Re: [Feedback]: Officially supporting Apache in GlassFish?
Posted: Oct 22, 2006 8:41 AM   in response to: jfarcand
  Click to reply to this thread Reply

Is this supported in the latest V1 UR1 builds? I'd rather be using those in production.

Thanks!

jfarcand

Posts: 74
Re: [Feedback]: Officially supporting Apache in GlassFish?
Posted: Oct 23, 2006 6:35 AM   in response to: zambizzi
  Click to reply to this thread Reply

Yes, this is supported in V1 UR1 (and SJSAS 8.x)

-- Jeanfrancois

tcmjr

Posts: 1
Re: [Feedback]: Officially supporting Apache in GlassFish?
Posted: Nov 2, 2006 6:48 AM   in response to: jfarcand
  Click to reply to this thread Reply

I am having a heck of a time getting this to work. I'm trying to get apache virtual hosts to map to glassfish virtual hosts through ajp. I think the problem may be how I define the DocumentRoot in apache. I have it set to $GLASSFISH_HOME/domains/domain1, but the default webapp for my domain is in a subdirectory.

I have read and reread your blog many times and still the missing pieces are not coming to me. Would it be possible to provide a slightly more complex example involving virtual hosts and the config/set up in both apache and glassfish. I'm sure that many folks would find that extremely useful besides myself.

Thanks,
Thomas

snies00

Posts: 12
Re: [Feedback]: Officially supporting Apache in GlassFish?
Posted: Dec 9, 2006 3:10 PM   in response to: zambizzi
  Click to reply to this thread Reply

I have been using UR1 with Apache front-end successfully on linux (fedora) - seems to work great! Using apache was the only way I could find to support multiple virtual hosts where each virtual host is configured differently (e.g., different database instances per host).

FYI

Steve

drewmca

Posts: 1
Re: [Feedback]: Officially supporting Apache in GlassFish?
Posted: Oct 17, 2006 6:36 PM   in response to: jfarcand
  Click to reply to this thread Reply

I think one of the biggest reasons for supporting Apache is that without it, on Linux you can't run the glassfish user as a non-root user if you want to run on standard ports. Non-root users in Linux don't have access to ports like 443 and 80, so the only way to get glassfish to run on those ports is to run as root, which is a big security risk. The only solution we had was to run Apache as a front end. Apache can somehow manage to run on those ports by doing some native level trickery but as far as I can tell there's no way to set that up in glassfish (or JSAS). Therefore I'd consider this a highly important feature.

If anyone knows differently about this, please let me know.

robdaemon

Posts: 4
Re: [Feedback]: Officially supporting Apache in GlassFish?
Posted: Oct 18, 2006 1:13 PM   in response to: drewmca
  Click to reply to this thread Reply

You don't need Apache to run Glassfish on port 80.

Go ahead and allow Glassfish on port 8080 and 8443, then use iptables to forward port 8080 to 80, and port 443 to 8443.

zambizzi

Posts: 231
Re: [Feedback]: Officially supporting Apache in GlassFish?
Posted: Oct 18, 2006 1:17 PM   in response to: robdaemon
  Click to reply to this thread Reply

We use this strategy as well for public-facing applications. It works well for the security issue (and sharing a piece of hardware w/ another web server) but poses some annoyances of its own depending on what type of firewall is being used and how the network is configured.

volga

Posts: 2
Re: [Feedback]: Officially supporting Apache in GlassFish?
Posted: Nov 21, 2006 7:22 AM   in response to: jfarcand
  Click to reply to this thread Reply

Supporting Apache is a must because many sites can't do without Apache, for many reasons. No choice, Apache is there listeing to port 80. I have the choice to use any other port, but nobody will find the server.

For now, configuring Glassfish behind Apache seems to be very problematic. Typical use case would be several web apps corresponding to several virtual hosts's root contexts.

According to my experiments, it seems that it is not possible to use a single worker for several virtual hosts, because HTTP listeners in Glassfish must have different adresses OR different port numbers (which seems to me very strange since virtual hosting is generally about sharing a single address/port combination, which is what we can do easyly with other Tomcat based app servers).

The main problem I found, however, is that it seems to be impossible to configure several virtual hosts corresponding to several app's root context.

One virtual server is OK. With two virtual servers, strange problems occur. The worst is this :

[#|2006-11-21T15:22:49.328+0100|WARNING|sun-appserver-pe9.1|org.apache.jk.common.ChannelSocket|_ThreadID=11;_ThreadName=TP-Processor4;_RequestID=63692cf8-ddae-4d08-8263-1e7b2976a0ef;|Exception executing accept
java.nio.channels.IllegalBlockingModeException
at sun.nio.ch.ServerSocketAdaptor.accept(ServerSocketAdaptor.java:86)
at com.sun.enterprise.server.ss.provider.ASServerSocket.acceptSocket(ASServerSocket.java:174)
at com.sun.enterprise.server.ss.provider.ASServerSocket.accept(ASServerSocket.java:154)
at com.sun.enterprise.server.ss.provider.ASServerSocketImpl.accept(ASServerSocketImpl.java:161)
at java.net.ServerSocket.implAccept(ServerSocket.java:450)
at java.net.ServerSocket.accept(ServerSocket.java:421)
at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:306)
at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:660)
at org.apache.jk.common.ChannelSocket$SocketAcceptor.runIt(ChannelSocket.java:870)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:653)
at java.lang.Thread.run(Thread.java:595)
|#]

This exception occurs more than 3000 times every seconds. Within a short time, the log files reach several hundred Gigabytes and crashes the sytem.

Not sure if I will continue my experiments !

jfarcand

Posts: 74
Re: [Feedback]: Officially supporting Apache in GlassFish?
Posted: Nov 21, 2006 8:11 AM   in response to: volga
  Click to reply to this thread Reply

Hi,

I've filled:

https://glassfish.dev.java.net/issues/show_bug.cgi?id=1553

for you issue. The workaround is to add, in domain.xml:

<jvm-options>-Dcom.sun.enterprise.server.ss.ASQuickStartup=false</jvm-options>

Can you try it and update the bug with your finding?

Thanks!

volga

Posts: 2
Re: [Feedback]: Officially supporting Apache in GlassFish?
Posted: Nov 21, 2006 9:23 AM   in response to: jfarcand
  Click to reply to this thread Reply

This seems to solve the log problem. However, I could not find a way to update the bug report !

Thanks

Pierre-Yves

snies00

Posts: 12
Re: [Feedback]: Officially supporting Apache in GlassFish?
Posted: Dec 9, 2006 3:14 PM   in response to: volga
  Click to reply to this thread Reply

Volga - did you find the answer to your question? If not let me know and I will create a short writeup describing how our setup works.

sjabele

Posts: 2
deleted by user
Posted: May 8, 2007 12:10 PM   in response to: jfarcand
  Click to reply to this thread Reply

deleted by user

deleted by user


Message was edited by: sjabele




 XML java.net RSS