aspose file tools*
The moose likes Java in General and the fly likes Help Running GlassFish bundled with Netbeans, what does Apache & IIS redirect have to do with this? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Help Running GlassFish bundled with Netbeans, what does Apache & IIS redirect have to do with this?" Watch "Help Running GlassFish bundled with Netbeans, what does Apache & IIS redirect have to do with this?" New topic
Author

Help Running GlassFish bundled with Netbeans, what does Apache & IIS redirect have to do with this?

Michele Smith
Ranch Hand

Joined: Oct 27, 2010
Posts: 421
Hello I am running Netbeans 6.7.1, bundled with GlassFish 2.1.1 on a Win 2008 32-bit server with SP2 installed.

The application has to be built with ant, and requires 4 gb of RAM

I am trying to build the application right now utilizing a deploy.bat script and an deploy.xml script.

My question is this: we want to use a different front end Apache with an IIS redirect. The reason why is for ease of application changes/edits. I am not sure how this figures into what I am doing. Please help me understand what to do.

I did check this website: http://docs.sun.com/app/docs/doc/819-3679/gchvt?a=view


Can you help me understand what I would do with the Apache and an IIS redirect? I don't understand very well.

Alan Hampson
Ranch Hand

Joined: Apr 10, 2009
Posts: 31
Apache httpd is a web server. In this context, IIS would be one as well. By default these run on port 80 and nothing special is required in a URL to access content from them. For example, you can go to http://httpd.apache.org/ and it will serve up a page. Normally, you'd be running one or the other of these, so I'm not sure what you mean by "use a different front end Apache with an IIS redirect." Are you referring to Apache Tomcat?

Glassfish is a web applications server. It can perform much of the functionality of a web server, but also adds the ability to serve up applications (usually written in Java). By default, Glassfish runs on port 8080, and the port number must be mentioned in the URL when you're accessing applications deployed on Glassfish. For example, http://localhost:8080 should bring up a default server page when glassfish is running. The problem is that for security, you try not to have port 8080 open on the internet.

You'd use an Apache httpd (or IIS) redirect in this case to make your application available through the http port (80). This owuld allow someone outside your firewall to access the application by using a URL like http://yoursite.com/your_application. Apache httpd would translate that to http://yoursite.com:8080/your_application.

The redirect also has applications for load balancing as you can configure Apache httpd to redirect to a number of application servers, which is used for load balancing.

You'll need to look into the httpd or IIS documentation to see what configuration to use.

Hope this helps. Post back if you have other questions.
Michele Smith
Ranch Hand

Joined: Oct 27, 2010
Posts: 421
http://www.iisadmin.co.uk/?p=72

Will this also work? This mentions Tomcat with Apache and IIS.

I am getting confused because I read an article that said that Glassfish does not need Tomcat.

Thank you, Michele
Alan Hampson
Ranch Hand

Joined: Apr 10, 2009
Posts: 31
Michele Smith wrote:http://www.iisadmin.co.uk/?p=72

Will this also work? This mentions Tomcat with Apache and IIS.


Yes, this should work. We need to clarify: What are you running as a web server? Apache httpd or IIS? All my comments about the differences between Glassfish and Apache httpd are also true for the difference between Glassfish and IIS, since IIS and httpd are both web servers.


I am getting confused because I read an article that said that Glassfish does not need Tomcat.

Thank you, Michele


The article you point to discusses Apache Tomcat, not Apache httpd. Think of them as different products from the same vendor. Tomcat is an application server like Glassfish. Since they are both application servers, the article you read is correct that you wouldn't need both of them. What you would do is combine Glassfish or Tomcat (application servers) with httpd or IIS (web servers).

Again, this is because the application server generally runs on Port 8080 and the web server runs on Port 80, so the web server redirects application requests to the application server address and port.

Hope this helps.
Michele Smith
Ranch Hand

Joined: Oct 27, 2010
Posts: 421
Hello I guess I need some guidance in terms of what to use as a webserver. Right now, of course, GlassFish 2.1.1. is using 8080 (listening) and is available (up and running) at http://localhost:4848.

I tried to install Apache Tomcat yesterday and it errored out, I think it is because port 8080 is listening.

The folks I work with have explained to me that for security reasons we have to have Apache Tomcat with the connector working with IIS 7.0 to enable GlassFish to work properly.

Can you please steer me in the right direction?

Do I need to install IIS 7.0, Tomcat 7.0 and the connector with GlassFish?

Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


I tried to install Apache Tomcat yesterday and it errored out, I think it is because port 8080 is listening.

Apache Tomcat is not just a web server (though it does act as one), it is a Servlet container. A Servlet container is something Glassfish will already include.

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Michele Smith
Ranch Hand

Joined: Oct 27, 2010
Posts: 421
Apache Tomcat is not just a web server (though it does act as one), it is a Servlet container. A Servlet container is something Glassfish will already include.


So IIS is the webserver?

I mean I guess I am asking what should I do with all this software, IIS, Apache Tomcat, the Connector, and GlassFish? Do they even belong together?
Michele Smith
Ranch Hand

Joined: Oct 27, 2010
Posts: 421
I am looking at this:

http://www.iisadmin.co.uk/?p=326

Alan Hampson
Ranch Hand

Joined: Apr 10, 2009
Posts: 31
I tried to install Apache Tomcat yesterday and it errored out, I think it is because port 8080 is listening.


That's probably correct. If Glassfish is already using port 8080, Tomcat won't be able to start. It's probably installed, but can't run due to the port. If you stop Glassfish, you can probably run Tomcat.

The folks I work with have explained to me that for security reasons we have to have Apache Tomcat with the connector working with IIS 7.0 to enable GlassFish to work properly.


I'm not sure I understand this. Glassfish and Apache Tomcat are two types of application server (or servlet container as Paul says). I don't think you'd want or need to run both of them to make a single web app work. They may have been talking about using Tomcat and the IIS connector to get your Glassfish applications working correctly. You should ask for clarification to be certain that they meant you'd be using both Tomcat and Glassfish.

So IIS is the webserver?


Correct. Usually, your web server is your outward (internet) facing product. Then it would forward requests for your application to Tomcat or Glassfish, whichever you're using. Tomcat and/or Glassfish are not usually directly connected to the internet as your web server is. That's the security aspect coming into play.

Michele Smith
Ranch Hand

Joined: Oct 27, 2010
Posts: 421
Does this article look like we are on the right track?

httphttp://www.albeesonline.com/blog/2008/10/14/integrating-glassfish-application-server-with-apache-web-server/

Also I asked the questions in your last email to the others I am working with. Thank you so much for pointing me in the right direction, I sincerely appreciate it!
Michele Smith
Ranch Hand

Joined: Oct 27, 2010
Posts: 421
The URL is I was talking about in the previous post is as follows:

http://www.albeesonline.com/blog/2008/10/14/integrating-glassfish-application-server-with-apache-web-server/

For some reason it is not updating when I edit it.

Thanks,
Michele
Alan Hampson
Ranch Hand

Joined: Apr 10, 2009
Posts: 31
Also I asked the questions in your last email to the others I am working with.

So they told you Apache httpd web server and Glassfish application server? If so, you would be on the right track with the Glassfish/Apache article.

Michele Smith
Ranch Hand

Joined: Oct 27, 2010
Posts: 421
Hello I know we have been talking a lot about this but I am still sorta confused. Every time I go out to the internet to research these items I get more confused. I guess you could say I am really confused!!!

Okay, so I am a visual person. I am attaching a diagram of what I think they want me to do. Can you look at it and tell me if this is doable?

In particular, where it talks about the Tomcat Apache and the IIS connected to the GlassFish JVM.

If this is not what I need to do, can you just change it around and send it back to me?

Thanks Alan! You are the greatest!

Thanks again! Michele



[Thumbnail for schematic.JPG]

Alan Hampson
Ranch Hand

Joined: Apr 10, 2009
Posts: 31
More like this. What do you think?



[Thumbnail for WebApplicationSvr.png]

Michele Smith
Ranch Hand

Joined: Oct 27, 2010
Posts: 421
Hi this is really more helpful than anything we have talked about for me. Thanks so much!

I wondered, do you mean Apache Tomcat when you say Web Server as well as the JVM. The reason why I ask is that you have listed Apache under Web Server and Apache Tomcat under JVM.

Since we already are into GlassFish, maybe we will not need Apache at all.

Thanks,
Michele
Alan Hampson
Ranch Hand

Joined: Apr 10, 2009
Posts: 31
Michele Smith wrote:Hi this is really more helpful than anything we have talked about for me. Thanks so much!

You're welcome!

I wondered, do you mean Apache Tomcat when you say Web Server as well as the JVM. The reason why I ask is that you have listed Apache under Web Server and Apache Tomcat under JVM.

No, when I say web server, I mean Apache httpd. Completely different from Tomcat. Apache httpd is similar to IIS. Tomcat is an application server.

JVM is the Java virtual machine. It is used by Glassfish and Tomcat both to make them run and by them to execute your application code. I included the JVM on the diagram because it was on your diagram, so I felt it was important to you. The correct terminology for Tomcat or Glassfish is "Application Server"

So, you have your web server which talks to clients via the internet and to your application server via (usually) a local intranet connection. The Application server does work and sends the results back to the web server, which sends them back to the client.


Since we already are into GlassFish, maybe we will not need Apache at all.

Thanks,
Michele


Remember that you need IIS or Apache httpd as a web server to face the internet. Without them, you'll have to expose Glassfish or Tomcat directly to the internet, which your security people are probably not going to like. But, yes you can use Glassfish in place of Tomcat, as they are both application servers.

Michele Smith
Ranch Hand

Joined: Oct 27, 2010
Posts: 421
Okay, they came back with something like the attached.

I have instructions on how to do everything concerning Tomcat and IIS but not connecting Glassfish to Tomcat. Although I don't think this is that hard.

Could you please tell me your thoughts?




[Thumbnail for revised schema.JPG]

Alan Hampson
Ranch Hand

Joined: Apr 10, 2009
Posts: 31
I'm not sure why you would want to connect Tomcat to Glassfish. As I've said before, they are both application servers, so you'd have a duplication of functionality there.

What you probably want to do is deploy the Java application code you developed in Netbeans running under Glassfish to Tomcat, so it will run there.

Michele Smith
Ranch Hand

Joined: Oct 27, 2010
Posts: 421
As it turns out we were able to configure a redirect from Glassfish to IIS, so the situation is a moot point now.

I agree with you, though, it was terribly confusing there for a while.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Help Running GlassFish bundled with Netbeans, what does Apache & IIS redirect have to do with this?