I hope here are some cracks around that can easily solve the issue I am struggling with even after searching in several forums: I need to place a Glassfish v3 application server behind an Apache 2.2.x webserver as some pieces my webhoster provides, such as webmail, are running on the webserver (so I cannot shut this down). Consequently, I have decided to use the newer solution “mod_proxy_ajp” (which ships with Apache out of the box) instead of more complex “mod_jk” to pass requests through Apache to Glassfish. What I did until now is this:
Apache includes “/etc/httpd/conf.d/proxy_ajp.conf” which contains:
- LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
- ProxyPass /mail !
- ProxyPass / ajp://localhost:8080/
- ProxyPassReverse / ajp://localhost:8080/
Glassfish:
- http-listener-1 is listening on 8080 with “JK listener” enabled
- http-listener-2 is listening on 8181 and has security enabled using my SSL-certificate
But what I would like to do is this:
- Route all requests for “https://webmail.mydomain.com” to Apache (webhoster email web-frontend)
- Route all other requests HTTP and HTTPS to Glassfish. For HTTP to my Glassfish http-listener-1 on 8080 or 8009, for HTTPS using my SSL-certificate registered with my Glassfish http-listener-2 on 8181 (in both directions, pass and reverse these ports should not be visible to the user)
- Either force all requests to Glassfish to be redirected/switched to HTTPS, or based on web.xml security configuration for specific resources (somefile.html) force to switch from HTTP to HTTPS (or any another solution to do this)
If someone could provide a short description for solving these 3 tasks I would be really happy as I am not this deep into Java web administration.
Thanks in advance and cheers
~limubai