Notes 16 - tomcat

Notes 16 - tomcat - Web Servers and Java - Tomcat Copyright...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
Tomcat Copyright © 2010 Ellis Horowitz and Marco Papa 1 Web Servers and Java - Tomcat
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Tomcat Copyright © 2010 Ellis Horowitz and Marco Papa 2 Executing Java on the Server Side Java is an object-oriented programming language developed by Sun Microsystems • It includes extensions to simplify the writing of server-side web-based programs; these include – Java Server Pages – Java Servlets • To execute JSP or Java Servlets one needs to install a Java Virtual Machine (JVM) and then configure the web server so it can pass requests to the JVM and get output from the JVM – we can either use an augmented form of Apache or an entirely different web server such as Tomcat
Background image of page 2
Tomcat Copyright © 2010 Ellis Horowitz and Marco Papa 3 Running Java with Apache • A Java servlet is compiled into bytecode and needs a Java Virtual Machine to execute • Starting a complete JVM for each client request would be terribly inefficient • Attaching a JVM to an already running Web server makes the server a lot heavier The Java solution for Apache – The servlet engine is not part of the web server, but a separate application – the web server acts as a client to the servlet engine using a protocol known as AJP (Apache Jserv Protocol) – the three tiers are: clients, web server, and servlet engine
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Tomcat Copyright © 2010 Ellis Horowitz and Marco Papa 4 Apache Jserv 3-Tier Operation Client Browser Web Server mod_jserv HTTP Requests HTTP Responses Servlet-Request Servlet-Response AJP Requests AJP Responses Servlet/JSP Engine 1. Client calls Apache Web Server requesting a Java servlet 2. Apache handles HTTP request to mod_jserv 3. mod_jserv translates request into an AJP request and contacts Apache Jserv servlet engine using TCP/IP 4. Apache Jserv has already performed its initialization and is ready to handle AJP requests 5. Apache Jserv translates AJP request into ServletRequest object, then creates ServletResponse object to return data 6. During execution, all data passed to ServletResponse is converted to an AJP response and sent back to mod_jserv 7. mod_jserv translates AJP response into HTTP response and sends it back to the client
Background image of page 4
Tomcat Copyright © 2010 Ellis Horowitz and Marco Papa 5 Apache Jserv 3-Tier Model Explanation • There are two main parts to Apache Jserv – one is placed in the web server that acts as an AJP client – another is placed in the JVM and acts as a AJP server • mod_jserv is a C language plug-in module compiled with Apache source code – it forwards HTTP requests to the servlet engine using AJP and converts results back to HTTP • Apache Jserv is the servlet engine, written in Java, that processes AJP requests and returns back to the client (the web server) output See http://en.wikipedia.org/wiki/Apache_JServ_Protocol Note: recently Jserv has been replaced by a newer version called mod_jk, see http://tomcat.apache.org/tomcat-3.3- doc/mod_jk-howto.html
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Tomcat Copyright © 2010 Ellis Horowitz and Marco Papa 6
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/12/2011 for the course CSCI 571 taught by Professor Papa during the Fall '07 term at USC.

Page1 / 48

Notes 16 - tomcat - Web Servers and Java - Tomcat Copyright...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online