|
Replies:
6
-
Last Post:
Jul 20, 2008 6:00 PM
by: Gabe Wong
|
|
|
|
|
|
|
Glassfish on port 80 on alternate IP - pointers?
Posted:
Jul 16, 2008 8:08 PM
|
|
|
I'm running a server which hosts a number of websites, using Apache 2's virtual hosting features.
I would now like to start adding Glassfish applications as virtual hosts. I've done a basic install of Glassfish and brought it up on the default port 8080.
What I'd really like to do is to give the Glassfish-based sites their own IP, and have Glassfish listen on port 80. I currently have three IPs configured on the box, so I'd like to have something like:
domain1.com --> ip1:80 (Apache) domain2.com --> ip1:80 (Apache) domain3.com --> ip2:80 (Glassfish) domain4.com --> ip2:80 (Glassfish)
i.e. port 80 on ip1 will be handled by Apache, and port 80 on ip2 will be handled by Glassfish, with various domains mapped to one or the other.
I've been assuming that having multiple IPs available meant that I could do this without proxying requests destined for the Glassfish server through Apache, but if mod_proxy is the easiest way to go and doesn't have any major negatives, then I'm open to that idea.
Can anyone point me at documentation that would guide me through getting this set up?
Thanks, Angus
|
|
|
|
|
|
|
Re: Glassfish on port 80 on alternate IP - pointers?
Posted:
Jul 17, 2008 10:21 PM
in response to: angusm
|
|
|
Hi Angus, Is it Apache 2 or Apache 2.2. mod_proxy is very easy to setup with 2.2. Please let me know. Regards
glassfish@javadesktop.org wrote: > I'm running a server which hosts a number of websites, using Apache 2's virtual hosting features. > > I would now like to start adding Glassfish applications as virtual hosts. I've done a basic install of Glassfish and brought it up on the default port 8080. > > What I'd really like to do is to give the Glassfish-based sites their own IP, and have Glassfish listen on port 80. I currently have three IPs configured on the box, so I'd like to have something like: > > domain1.com --> ip1:80 (Apache) > domain2.com --> ip1:80 (Apache) > domain3.com --> ip2:80 (Glassfish) > domain4.com --> ip2:80 (Glassfish) > > i.e. port 80 on ip1 will be handled by Apache, and port 80 on ip2 will be handled by Glassfish, with various domains mapped to one or the other. > > I've been assuming that having multiple IPs available meant that I could do this without proxying requests destined for the Glassfish server through Apache, but if mod_proxy is the easiest way to go and doesn't have any major negatives, then I'm open to that idea. > > Can anyone point me at documentation that would guide me through getting this set up? > > Thanks, Angus > [Message sent by forum member 'angusm' (angusm)] > > http://forums.java.net/jive/thread.jspa?messageID=287193 > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net > For additional commands, e-mail: users-help@glassfish.dev.java.net > > > >
-- Regards
Gabe Wong NGASI AppServer Manager JAVA AUTOMATION and SaaS Enablement http://www.ngasi.com NEW! 8.1 - Centrally manage Application Servers across multiple physical servers
--------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net For additional commands, e-mail: users-help@glassfish.dev.java.net
|
|
|
|
|
|
|
|
Re: Glassfish on port 80 on alternate IP - pointers?
Posted:
Jul 18, 2008 4:12 AM
in response to: Gabe Wong
|
|
|
It's Apache 2.2.8.
My original thinking was that if I could get Glassfish listening on port 80 a specific IP, then I needn't involve Apache at all, but if you think mod_proxy would be the easiest way to go, then I'll follow your advice.
I've just managed to persuade Apache not to listen on all the available IPs, so I have one free for Glassfish's use.
|
|
|
|
|
|
|
|
Re: Glassfish on port 80 on alternate IP - pointers?
Posted:
Jul 18, 2008 4:12 AM
in response to: angusm
|
|
|
glassfish@javadesktop.org schrieb: > My original thinking was that if I could get Glassfish listening on port > 80 a specific IP, then I needn't involve Apache at all, but if you think > mod_proxy would be the easiest way to go, then I'll follow your advice.
Generally I'd strongly vote for running apache 2.2 in front of glassfish for a rather simple reason: Given extensions like mod_security, mod_evasive and friends, apache2 does offer a wide range of features to harden your service in terms of any attacks likely to be lead against servers exposed to "the internet" these days, including (D)DoS and related pains. This way you add one more line of defense which you surely will learn to love in times of need. Another good reason: Maybe you're planning to use a clustered Glassfish environment, you might easily throw in the apache mod_proxy load balancer to take care of, as the name implies, load balancing across several backend hosts, failover and the like.
If you need hints / help on how to get goin', just feel free to ask; we've been using this kind of setup in a productive environment for quite a while now, and without a few minor issues yet unresolved (involving mainly the transfer of large binary files with certain clients), things work rather well. Clustering is still on the todo-list however. 
Cheers, Kristian
-- Kristian Rink cell : +49 176 2447 2771 business: http://www.planconnect.de personal: http://pictorial.zimmer428.net "we command the system. calling all recievers. we are noisy people for a better living". (covenant - "monochrome")
--------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net For additional commands, e-mail: users-help@glassfish.dev.java.net
|
|
|
|
|
|
|
|
Re: Glassfish on port 80 on alternate IP - pointers?
Posted:
Jul 18, 2008 9:28 AM
in response to: angusm
|
|
|
OK, first lets see if mod_proxy is available with your Apache install. Do a "httpd -l" or "apache2 -l". Look for mod_proxy_http.c or mod_proxy_ajp.c (preferably) if not check the Apache ./modules directory for mod_proxy_http.so or mod_proxy_ajp.so glassfish@javadesktop.org wrote: > It's Apache 2.2.8. > > My original thinking was that if I could get Glassfish listening on port 80 a specific IP, then I needn't involve Apache at all, but if you think mod_proxy would be the easiest way to go, then I'll follow your advice. > > I've just managed to persuade Apache not to listen on all the available IPs, so I have one free for Glassfish's use. > [Message sent by forum member 'angusm' (angusm)] > > http://forums.java.net/jive/thread.jspa?messageID=287533 > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net > For additional commands, e-mail: users-help@glassfish.dev.java.net > > > >
-- Regards
Gabe Wong NGASI AppServer Manager JAVA AUTOMATION and SaaS Enablement http://www.ngasi.com NEW! 8.1 - Centrally manage Application Servers across multiple physical servers
--------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net For additional commands, e-mail: users-help@glassfish.dev.java.net
|
|
|
|
|
|
|
|
|
|
Re: Glassfish on port 80 on alternate IP - pointers?
Posted:
Jul 20, 2008 6:00 PM
in response to: angusm
|
|
|
Hi, From my experience the main difference is that AJP makes it appear as if Apache is a listener directly attached to the Application Server, while mod_proxy (which uses the HTTP protocol), mimics Apache as a client. So depending on the sensitivity of your application, that may or may not be an issue. For instance, if your application directly relies on the servername and port number in the request headers you would have to perform some work arounds. Also you cannot directly use the remodaddr value in the request as the IP address will be that of Apache. for remodaddr you would need to use the x-forwarded-for header value. and for the web port you would need to configure the ajp connector with the proxyport option.
There may be a few other things as well. I am not sure there is a performance difference though.
glassfish@javadesktop.org wrote: > Thank you. > > I actually managed to get something going using mod_proxy, and it seems to be working well. I found http://blogs.steeplesoft.com/virtual-hosting-using-apache-and-glassfish/ and http://www.apachetutor.org/admin/reverseproxies very helpful. > > Out of curiosity, is there an advantage in using mod_proxy_ajp over mod_proxy? > [Message sent by forum member 'angusm' (angusm)] > > http://forums.java.net/jive/thread.jspa?messageID=287942 > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net > For additional commands, e-mail: users-help@glassfish.dev.java.net > > > >
-- Regards
Gabe Wong NGASI AppServer Manager JAVA AUTOMATION and SaaS Enablement for Cloud Computing http://www.ngasi.com NEW! FREE Developer account for Hosted version on Amazon EC2
--------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net For additional commands, e-mail: users-help@glassfish.dev.java.net
|
|
|
|
|