Softsmith Infotech Installing and Configuring Tomcat.

Slides:



Advertisements
Similar presentations
1 Copyright © 2005, Oracle. All rights reserved. Introducing the Java and Oracle Platforms.
Advertisements

FIRST SESSION - XAMPP Jeongmin Lee.  Jeongmin Lee  CS  PHD  Machine Learning, AI  Web System Development.
Web Application Server Apache Tomcat Downloading and Deployment Guide.
DT228/3 Web Development Introduction to Java Server Pages (JSP)
Introduction to Java The objectives of this chapter are: To describe the key aspects of Java To describe the Java software development kit (SDK) To explain.
Object-Oriented Enterprise Application Development Tomcat 3.2 Configuration Last Updated: 03/30/2001.
Installing JDK and Tomcat Vijayan Sugumaran Department of DIS Oakland University.
Servlets and a little bit of Web Services Russell Beale.
Installing JDK and Tomcat Vijayan Sugumaran Department of DIS Oakland University.
1 Running Web Applications with Tomcat CS , Winter 2007/8.
CS115 HOW TO INSTALL THE JAVA DEVELOPMENT KIT (JDK)
1 Build a Web Application on J2EE. 2 J2EE Scenario Client – Web Server – EIS Resources Client – Web Server – EIS Resources Client – Application Server.
DT211/3 Internet Application Development Web Servers.
Java Server Team 8. Overview What is a Java Server? History Architecture Advantages Disadvantages Current Technologies Conclusion.
Lab 1 Instructor: Jolanta Soltis.
Tomcat Configuration A Very, Very, Very Brief Overview.
Web Applications Basics. Introduction to Web Web features Clent/Server HTTP HyperText Markup Language URL addresses Web server - a computer program that.
Java web development Servlet & Java server pages.
Java Servlets and JSP.
Marlene Galea.  The JDK (Java Development Kit)  An IDE (Integrated Development Environment) ◦ Different IDEs include:  JCreator  NetBeans  BlueJ.
SERVLETS.
Configuring Apache tomcat Specifying the server port NOTE: Edit the install_dir/conf/server.xml and change the port attribute of the connector element.
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.
Intro to Servlets Lec 26. Web-Based Enterprise Applications in Java Figure shows a simplified view of one application and its layers.
Linux Operations and Administration
DAT602 Database Application Development Lecture 15 Java Server Pages Part 1.
INTRODUCTION TO WEB DATABASE PROGRAMMING
Installing and Configuring Tomcat A quick guide to getting things set up on Windows.
Apache Tomcat Web Server SNU OOPSLA Lab. October 2005.
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
Applets & Servlets.
Servlets Environment Setup. Agenda:  Setting up Java Development Kit  Setting up Web Server: Tomcat  Setting up CLASSPATH.
Basics of Web Databases With the advent of Web database technology, Web pages are no longer static, but dynamic with connection to a back-end database.
Apache Tomcat Representation and Management of Data on the Web.
Application Servers: Tomcat. What is an application server? Servlets are Java’s answer to server-side programming. Servlets are a special type of Java.
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.
Course Business This week: –Today we will go over getting Web Service installation stuff. –Wednesday we will look at UDDI, a way for finding and binding.
Guidelines for Homework 6. Getting Started Homework 6 requires that you complete Homework 5. –All of HW5 must run on the GridFarm. –HW6 may run elsewhere.
Installing Apache Axis Setting up your Tomcat server to use Web Services.
© 2005 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Data Structures for Java William H. Ford William R. Topp Appendix E The EZJava.
Open Source Server Side Scripting ECA 236 Open Source Server Side Scripting Installation and Testing.
POS 406 Java Technology And Beginning Java Code
National Taiwan University Department of Computer Science and Information Engineering National Taiwan University Department of Computer Science and Information.
Oracle Data Integrator Agents. 8-2 Understanding Agents.
WAMP Windows Apache MySQL and PHP i.e. “WAMP”. Why WAMP? WampServer is a Windows web development environment. It allows you to create and test web pages.
Using This PowerPoint This PowerPoint presentation assumes your Computer Science teacher has provided you with the InstallingJava folder, which contains.
Installing and Configuring Tomcat SSE. Downloading Tomcat l Download url: 4.0/release/v4.1.24/bin/
1 Installing Java on Your PC. Installing Java To develop Java programs on your PC: Install JDK (Java Development Kit) Add the directory where JDK was.
1 G52IWS: Example Web-services Chris Greenhalgh. 2 Contents Software requirements AXIS web service run-time components Getting started with Jetty & AXIS.
Java Programming: Advanced Topics1 Introduction to Advanced Java Programming Chapter 1.
NJIT 1 Apache Tomcat (Version 6.0) THETOPPERSWAY.COM.
Glink for Java: applet, application and an API for integrating access to Bull, IBM, UNIX and Minitel systems with your Java based e-business applications.
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.
INTERNET APPLICATIONS CPIT405 Install a web server and analyze packets.
Deploying Web Applications to Tomcat Server Chun Guo
Labs: Create, deploy and test a simple web service
Introduction to Advanced Java Programming
Tomcat Celsina Bignoli
Course Outcomes of Advanced Java Programming AJP (17625, C603)
Installing and Configuring Tomcat
Apache Tomcat Web Server
Introduction to JBoss application server
CS115 HOW TO INSTALL THE JAVA DEVELOPMENT KIT (JDK)
Representation and Management of Data on the Web
Java Servlets and JSP.
Installing Tomcat.
Review of Previous Lesson
Presentation transcript:

Softsmith Infotech Installing and Configuring Tomcat

Softsmith Infotech Architecture Architecture.

Softsmith Infotech client 1. requests URL for html page server 2. retrieves html page 3. sends html page to client 4. browser interprets html page & displays Typical html Request/Response cycle

Softsmith Infotech The Apache Jakarta Project The Apache Jakarta Project “creates and maintains open source solutions on the Java platform for distribution to the public at no charge” Apache Jakarta Tomcat--or just “Tomcat”--is one of those projects Tomcat is a container for servlets Tomcat can act as a simple standalone server for Web applications that use HTML, servlets, and JSP Apache is an industrial-strength, highly optimized server that can be extended with Tomcat

Softsmith Infotech Traditionally, source code had to be compiled for the target hardware and OS platform: The Java Virtual Machine. Source.cpp i386 binary SPARC binary PPC binary Windows Compiler Solaris Compiler Mac Compiler

Softsmith Infotech Java source files (.java) are compiled to Java bytecode (.class) Bytecode is interpreted on the target platform within a Java Virtual Machine The Java Virtual Machine. Source.java i386 VM SPARC VM PPC VM Java Compiler Java Bytecode Source.class

Softsmith Infotech The Java VM does more than interpret bytecode: The class loader loads appropriate java classes. Possibly from the network. All classes are verified to contain only legal bytecodes and not permitted any illegal stack or register usage. A SecurityManager can limit access to resources such as the local file system or the network. Any unreferenced memory (Objects) are returned to the system by the Garbage Collector thread. Many database servers, application servers, web servers and browsers contain a Java virtual machine eg: Oracle, Tomcat (web server), WebSphere (app server), BEA Weblogic (app server), and Netscape and IE. Java VM Responsibilities

Softsmith Infotech The Java SDK comes in three versions: J2ME - Micro Edition (for handheld and portable devices) J2SE - Standard Edition (PC development) J2EE - Enterprise Edition (Distributed and Enterprise Computing) The SDK is a set of command line tools for developing Java applications: javac - Java Compiler java - Java Interpreter (Java VM) appletviewer - Run applets without a browser javadoc - automated documentation generator jdb - Java debugger The SDK is NOT and IDE (Integrated Development Environment) Command line only. No GUI. The Java Software Development Kit (SDK)

Softsmith Infotech Setup Environment I will assume everyone will be using Windows. Also make sure you have the Java SDK installed on your PC. –The SDK includes the java compiler and some other tools as well as the runtime environment. –You need the compiler to run tomcat.

Softsmith Infotech Installing Tomcat Go to the Jakarta binaries web site: – inindex.cgihttp://jakarta.apache.org/site/b inindex.cgi Click the link for zip. –Right click and save to your desktop

Softsmith Infotech Save to Desktop and Extract You should have jakarta-tomcat- 5.x.zip as a zip icon on your desktop. Right click and choose “Extract All”. This will create a jakarta-tomcat- 5.x folder also on your desktop.

Softsmith Infotech Running Tomcat In the Tomcat folder, open the bin folder. Click the startup.bat icon. You should see a black and white Java command window. –You should not see any obvious java error messages. Open your browser and point to –You should see the Tomcat welcome page. Note startup.bat actually calls other scripts in the same directory (catalina.bat, particularly). The.sh files are for running Tomcat on Linux/Unix –Maybe Mac also.

Softsmith Infotech Run Some Examples From Tomcat’s welcome page, click the examples link and run some examples to make sure everything is OK.

Softsmith Infotech Problems Tomcat failures to start correctly if –you either do not have the Java SDK installed on, or – your JAVA_HOME environment variable is set incorrectly. You must have the Java SDK installed, since you need javac.

Softsmith Infotech Setting JAVA_HOME on Windows XP From “Start” at the bottom left of your screen, open the control panel. Select “System” to edit System properties and choose the “Advanced” tab. Click the “Environment Variables” Button. Edit or add the JAVA_HOME variable –It should point to the top folder of your Java installation. –C:\j2sdk1.4.1_02, for example. –Check “My Computer” to get the actual name.

Softsmith Infotech Shutting Down Tomcat You can do this in at least two ways: –By closing the black and white java command window. –By executing shutdown.bat in Tomcat’s bin directory Same place as startup.bat. Running shutdown.sh is probably best.

Softsmith Infotech Running Two Tomcat Servers Web services often are applied to allow two Tomcat (or other) servers communicate –One does display, the other runs commands. So to really test things out and to understand what is going on, you should set up and run two web servers. –Preferably on two different machines. Installing a second server on the same host follows all of the same steps as before, with one additional step. –You must modify server.xml

Softsmith Infotech Finding server.xml The file server.xml has all of the server configuration information. This is located in the folder jakarta- tomcat /conf. You only need to edit it in two places. –See next slide Double click it to open it with your favorite text editor. Make a backup copy of server.xml before you change things.

Softsmith Infotech Tomcat Ports Tomcat 5’s default settings listen to three ports: 8080, 8005, –8080 is the http port number. –8005 is the shutdown port. You can contact this to shutdown Tomcat from another process. –8009 is the AJP port for running Tomcat behind an Apache server. Not needed here, but port opened Tomcat can use other ports –8443 for SSL connections Commented out by default. Requires some additional configuration –8082 is for proxy connections Redirecting HTTP to other servers. Commented out by default. –You don’t have to edit these. For reference, use 9090, 9005, and 9009.

Softsmith Infotech Changing Ports Only one server at a time can accept connections on ports 8080, 8005, and If you want run a second Tomcat server, you must change the values of these ports for the second server. Just edit server.xml to change these ports. –Shutdown the server first. –Values don’t matter –For Linux/Unix, values <1024 are owned by root processes so you normally can’t use these values. Now restart the server. Point your browser at the new port number to check. – for example.

Softsmith Infotech Editing server.xml The following slides show the config settings that you need to change the shutdown, http, and ajp ports. You can freely change other parameters if you want. Note of course you are taking advantage of your basic XML knowledge.

Softsmith Infotech Shutdown port <!-- A "Server" is a singleton element that represents the entire JVM, which may contain one or more "Service" instances. The Server listens for a shutdown command on the indicated port. Note: A "Server" is not itself a "Container", so you may not define subcomponents such as "Valves" or "Loggers" at this level. -->

Softsmith Infotech HTTP Connector <Connector port="9090" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" redirectPort="8443" acceptCount="100" debug="0" connectionTimeout="20000" disableUploadTimeout="true" />

Softsmith Infotech AJP Port <Connector port="9009" enableLookups="false" redirectPort="8443" debug="0" protocol="AJP/1.3" />

Softsmith Infotech Tomcat Directory Structure (5.5) Tomcat-Base webappswork JAR files ROOTmyApp1myApp2 server.xml Tomcat-users.xm l WEB-INF libclasses web.xml bincommonlogsconf lib JAR Files

Softsmith Infotech Creating Web Applications A Web application usually contains several different types of Web resources like HTML files, Servlets, JSP files, and other resources like Database tables Each Web application has its own subdirectory under the directory $CATALINA_BASE/webapps/ –$CATALINA_BASE is an environment variable set to your tomcat- base directory (The directory that contains the Web-site content, Web applications and configuration data

Softsmith Infotech The Directory Structure of a Web Application – Cont. An application's directory should contain the following: –The directory WEB-INF/ –A legal web.xml file under WEB-INF/ Minimal content of web.xml

Softsmith Infotech Configuring a Web Application Application-specific configuration and declarations are written in the file myApp/WEB-INF/web.xml This file contains: –Servlet declarations, mappings and parameters –Default files for directory requests (e.g index.html) –Error pages (sent in cases of HTTP errors) –Security constraints –Session time-out specification –Context (application) parameters –And more…

Softsmith Infotech Error Pages Use the error-page element to define the page sent in case of an HTTP error that occurs within the application context An error page element has two sub elements: –error-code - the HTTP error status code –location - the page that should be sent

Softsmith Infotech A non-existing resource