Deploying Web Applications to Tomcat Server Chun Guo

Slides:



Advertisements
Similar presentations
Object-Oriented Enterprise Application Development Tomcat 3.2 Configuration Last Updated: 03/30/2001.
Advertisements

Configuring web servers and web applications 1. 2 Server configuration vs. application configuration A web server may run several web application Server.
1 Running Web Applications with Tomcat CS , Winter 2007/8.
1 Build a Web Application on J2EE. 2 J2EE Scenario Client – Web Server – EIS Resources Client – Web Server – EIS Resources Client – Application Server.
Apache Tomcat Representation and Management of Data on the Web.
DT211/3 Internet Application Development Web Servers.
1 Software Testing and Quality Assurance Lecture 32 – SWE 205 Course Objective: Basics of Programming Languages & Software Construction Techniques.
Topics in this presentation: The Web and how it works Difference between Web pages and web sites Web browsers and Web servers HTML purpose and structure.
Tomcat Configuration A Very, Very, Very Brief Overview.
Building and Deploying a Simple Web Application. Tomcat and JSP Tomcat is an application server, commonly used to host JSP applications Applications are.
Web Applications Basics. Introduction to Web Web features Clent/Server HTTP HyperText Markup Language URL addresses Web server - a computer program that.
Julien Thibault / Phil Brewster / Kristina Doing-Harris
Java Servlets and JSP.
Java Enterprise Edition Java Web Development Structure of a web project Introduction to Web Applications The first project Introduction to Java Web Development.
Softsmith Infotech Installing and Configuring Tomcat.
WebServer & Tomcat By B. Venkateswarlu M.Tech Assoc Prof IT(Dept) Newton’s Institute of Engineering.
Tomcat Celsina Bignoli History of Tomcat Tomcat is the result of the integration of two groups of developers. – JServ, an open source.
Creating a Hello App Using Google App Engine. What are Google apps? Apps is an abbreviation for application. An app is a piece of software. It can run.
Linux Operations and Administration
DAT602 Database Application Development Lecture 15 Java Server Pages Part 1.
Web Server Configuration Alokes Chattopadhyay Computer & Informatics Centre IIT Kharagpur.
Installing and Configuring Tomcat A quick guide to getting things set up on Windows.
Apache Tomcat Web Server SNU OOPSLA Lab. October 2005.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 29.1 Multi-Tier Architecture 29.2 Web Servers.
Internet Basics Dr. Norm Friesen June 22, Questions What is the Internet? What is the Web? How are they different? How do they work? How do they.
Apache Tomcat Representation and Management of Data on the Web.
How Web Servers and the Internet Work by by: Marshall Brainby: Marshall Brain
Java Servlets CS-422. Application Mapping Your servlet application will be mapped to a directory structure: –“myapp” maps to some directory C:/docs/apps/myapp.
Apache + Tomcat. Apache + Tomcat Download mod_webapp.so:
SchwartzGBIF Nodes III29 April 2003 DiGIR Portal Installation And Configuration.
CS441 CURRENT TOPICS IN PROGRAMMING LANGUAGES LECTURE 5_1 George Koutsogiannakis/ Summer
AN OVERVIEW OF SERVLET TECHNOLOGY SERVER SETUP AND CONFIGURATION WEB APPLICATION STRUCTURE BASIC SERVLET EXAMPLE Java Servlets - Compiled By Nitin Pai.
Functionality of a web server What does the web server do? Let a user request a resource Find the resource Return something to the user The resource can.
111 Java Servlets Dynamic Web Pages (Program Files) Servlets versus Java Server Pages Implementing Servlets Example: F15 Warranty Registration Tomcat Configuration.
CS-4220 Dr. Mark L. Hornick1 Servlet configuration and deployment.
Tomcat Setup BCIS 3680 Enterprise Programming. Getting Web Apps to Work  Verify that Tomcat works.  Understand how context works.  Create folders/files.
Application Block Diagram III. SOFTWARE PLATFORM Figure above shows a network protocol stack for a computer that connects to an Ethernet network and.
C HAPTER 11 D EPLOYING YOUR WEB APP. WAR FILE A WAR file is simply a snapshot of your web app structure, in a nice portable, compressed form (it is really.
Topic Java EE installation (Eclipse, glassfish, etc.) Eclipse configuration for EE Creating a Java Web Dynamic Project Creating your first servlet.
Web Servers: The Engines that Drive the World Wide Web Dr. William Farmer Reza Sherafat McMaster University May 3, 2006.
Module: Software Engineering of Web Applications Chapter 2: Technologies 1.
CSI 3125, Preliminaries, page 1 Networking. CSI 3125, Preliminaries, page 2 Networking A network represents interconnection of computers that is capable.
The Internet, Fourth Edition-- Illustrated 1 The Internet – Illustrated Introductory, Fourth Edition Unit B Understanding Browser Basics.
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
Tomcat Setup BCIS 3680 Enterprise Programming. One-Click Tomcat Setup 2  This semester we’ll try to set up Tomcat with a PowerShell script.  Preparation.
Topics to be covered (ni) Client side validation JSF (free tools as well) Webservices Tell Resources e.g. sites Packaging and deploying web applications.
1 Web Programming with Servlets & JSPs WEB APPLICATIONS – AN OVERVIEW.
A Presentation Presentation On JSP On JSP & Online Shopping Cart Online Shopping Cart.
4.01 How Web Pages Work.
4.01 How Web Pages Work.
APACHE TOMCAT WEB SERVER
Chapter Objectives In this chapter, you will learn:
Understanding Web Server Programming
4.01 How Web Pages Work.
Tomcat Celsina Bignoli
Course Outcomes of Advanced Java Programming AJP (17625, C603)
E-commerce | WWW World Wide Web - Concepts
E-commerce | WWW World Wide Web - Concepts
Introduction to Struts
Installing and Configuring Tomcat
Apache Tomcat Web Server
Introduction to JBoss application server
ESIS Consulting LLC (C) ESIS Consulting LLC. All rights reserved
Java Servlets and JSP.
AbbottLink™ - IP Address Overview
Installing Tomcat.
4.01 How Web Pages Work.
Web Servers (IIS and Apache)
4.01 How Web Pages Work.
Q/ Compare between HTTP & HTTPS? HTTP HTTPS
Presentation transcript:

Deploying Web Applications to Tomcat Server Chun Guo

Deployment vs. Development Development Create the web application Deployment Make the web application available to use (publically accessible through URL). Publish your application on the server!

IP address, URL and DNS IP address – An Internet Protocol address (IP address) is a numerical label assigned to each device (e.g., computer, printer) participating in a computer network that uses the Internet Protocol for communication. – IP addresses are represented in dot-decimal notation, which consists of four decimal numbers, each ranging from 0 to 255, separated by dots – e.g. IP address for ILS website is

IP address, URL and DNS URL and DNS – The Domain Name System (DNS) is a hierarchical distributed naming system that translates easily remembered domain names (URL) to the numerical IP addresses. – It serves as the phone book for the Internet by translating human-friendly computer hostnames into IP addresses.

Look up IP address Check the IP address for a given domain – ping “domain name”

Check your own IP Address Windows – ipconfig Mac – ifconfig

The Large Picture

Outline Tomcat Basics Tomcat Administration Deploy web applications to Tomcat server – WAR file – Deployment folder

Outline Tomcat Basics Tomcat Administration Deploy web applications to Tomcat server – WAR file – Deployment folder

Server Hardware Software Database Server Web Server

Tomcat Basics What is Tomcat? Web container – Manage Java Servlets HTTP Web server – Deliver web pages on the request to clients. – Receive content from clients. – Create HTML documents dynamically ("on-the- fly")

Install Tomcat Windows – Installer (apache-tomcat exe) Mac – Unzip

Outline Tomcat Basics Tomcat Administration Deploy web applications to Tomcat server – WAR file – Deployment folder

Look inside the Tomcat directory /tomcat /bin startup.sh shutdown.sh /conf server.xml /lib/logs/webapps /ROOT/deployedApp1 /WEB-INF web.xml /lib /classes /META-INF /deployedApp2 /work

Start Tomcat Server Windows > startup.bat Mac $ cd “TOMCAT_HOME”/bin $./startup.sh Test –

Shut Down Tomcat Server Windows > shutdown.bat Mac $ cd “TOMCAT_HOME”/bin $./shutdown.sh Test –

Look inside the Tomcat directory /tomcat /bin startup.sh shutdown.sh /conf server.xml /lib/logs/webapps /ROOT/deployedApp1 /WEB-INF web.xml /lib /classes /META-INF /deployedApp2 /work

Tomcat Architecture Connector HTTP 1.1 Connector HTTP 1.1 Web application A Connector AJP 1.3 Connector AJP 1.3 Web application B Web application C Web application D HTTP Request HTTP Response AJP Response AJP Request TOMCAT Engine Host Context More about server.xml:

Host, Context Host Context

Tomcat configuration file (server.xml) <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/> <Host name="localhost" appBase="webapps” unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">

Change Default Port In “server.xml” … <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> … <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> …

Change Default Port In “server.xml” … <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> … <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> …

Outline Tomcat Basics Tomcat Administration Deploy web applications to Tomcat server – WAR file – Deployment folder

Package your web application Export your project to as a WAR file. – A WAR file (or Web application ARchive) is a JAR file used to distribute a collection of JavaServer Pages, Java Servlets, Java classes, XML files, tag libraries, static web pages (HTML and related files) and other resources that together constitute a web application.

Package your web application In Eclipse, right click on your project name; go to “Export”, and click “WAR file ”.

Package your web application Click “Browse” to select a location to store your WAR file, and click “Finish”.

Deploy your web application Copy your WAR file to the TOMCAT_HOME/webapps directory. Restart Tomcat. –./shutdown.sh –./startup.sh Test Check the TOMCAT_HOME/webapps directory. A new directory named “myApp” is created.

Look inside your application directory /myApp /WEB-INF /classes /lib web.xml Index.html/img

Look inside your application directory /myApp /WEB-INF /classes /lib web.xml Index.html/img This is the root directory of the web application. All static content (e.g. HTML files, images) are stored here.

Look inside your application directory /myApp /WEB-INF /classes /lib web.xml Index.html/img WEB-INF directory is not part of the public document.

Look inside your application directory /myApp /WEB-INF /classes /lib web.xml Index.html/img This directory is where servlet and utility classes are located.

Look inside your application directory /myApp /WEB-INF /classes /lib web.xml Index.html/img This directory contains Java Archive files that the web application depends upon. For example, this is where you would place a JAR file that contained a JDBC driver.

Look inside your application directory /myApp /WEB-INF /classes /lib web.xml Index.html/img web application deployment descriptor

Web Application Deployment Descriptor: web.xml myApp index.html index.htm index.jsp default.html default.htm default.jsp Web_compute Web_compute /Web_compute

Welcome page The welcome-file-list element contains a list of file names When the URL request is a directory name, Tomcat automatically brings the first file on the list If that file is not found, the server then tries the next file in the list, and so on This file can be of any type, e.g., HTML, JSP, image, etc. index.html index.htm index.jsp default.html default.htm default.jsp index.html index.htm index.jsp default.html default.htm default.jsp

Welcome page The welcome-file-list element contains a list of file names When the URL request is a directory name, Tomcat automatically brings the first file on the list If that file is not found, the server then tries the next file in the list, and so on This file can be of any type, e.g., HTML, JSP, image, etc. Web_compute index.htm index.jsp default.html default.htm default.jsp Web_compute index.htm index.jsp default.html default.htm default.jsp

Servlet Declaration and Mapping The element declares a Servlet The element maps a URL to a specific Servlet – The URL is relative to the application’s base URL ( ) Web_compute Web_compute /Web_compute Web_compute Web_compute /Web_compute

Servlet Declaration and Mapping The element declares a Servlet The element maps a URL to a specific Servlet – The URL is relative to the application’s base URL ( ) Web_compute Web_compute /Web_compute Web_compute Web_compute /Web_compute

Work Flow The user submits an HTTP request Tomcat finds the servlet based on the URL and the deployment descriptor ( web.xml ) and passes the request to the servlet The servlet writes an HTML page containing the response Tomcat returns the HTML page to the user

References step-step-guide#.URM9VlqWkSg /Lectures/26-tomcat.ppt /Lectures/26-tomcat.ppt step-step-guide#.URM9VlqWkSg step-step-guide#.URM9VlqWkSg ing/howto/Tomcat_HowTo.html

Questions?