Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How Are Static Files Served in a Web-App Server Setup

Status
Not open for further replies.

ASheriff

Technical User
Aug 19, 2000
19
US
If I have seperate m/c for app and web servers and my static content is on the web server then in my jsp program the refernce to this static content is done through a mapping of the mount point/drive of the where the static content is stored to a local drive on the app server.
I thought that my static content gets served by the web server and the dynamic content by my app server. I was happy, then all of a sudden I get this question -

If the jsp page is converted to a html page by the jsp/servlet engine on the appserver and the statis contents are also included on to the html page after which it is sent as a response to the browser then the statis content also goes through the web-app bridge!. I am confused now.

I need to know if my thinking in wrong if no please explain. If yes then how is the statis content served through a web server in this type of a set up and how does the jsp page refer to it?

Cheers
Aejaz

 
I don't really understand your question. Please explain your setup in more detail. Do you have two servers, one for static HTML and one for the dynamic JSP and Servlets? Wushutwist
 
Well I have 1 Web Server having the static content and 2 app servers. The Web and App Servers are on separate boxes. The question is very simple if a JSP page or for that matter any page served through a "Web Handler" of the Web Server refers to a static resource on the web server. The "Dynamic Page" in this case the JSP page will get parsed by the servlet/jsp compiler converted to an HTML page and sent back to the web server.

My Question is my above assumption right or wrong? If it were right then the only purpose of having a separate Box for Web Server would be disk storage!

I have a feeling that I should be ridiculously wrong! . But I need reason for it.

Cheers
Aejaz

 
Yes the Web Server will serve all static content (depending on the setup). For example, at the site I work at now we have a Web Server and an Application Server. The Web Server contains all static content (html and image files). It proxies requests for dynamic content to the App Server and the App responds with HTML. Ultimately the Web Server is serving all static content directly to the user.

There are two main advantages. One, the setup is more secure. You don't need to make you Application Server public accessible, only privately accessible to the Web Server. Of course, if your Web Server is compromised then you will still have problems. Two, proxing thru a Web Server is faster. Most Application Servers aren't terribly good at serving static content so you leave that job to the software that is optimizing for that, the Web Server.

Overall I can understand where you may think that the addition of a Web Server is just added complexity but it really does make sense for High Volume, Secure Web Applications. Wushutwist
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top