[SOLVED] html Java compiler database software security Teaching material based on Distributed Systems: Concepts and Design, Edition 4, AddisonWesley 2005

$25

File Name: html_Java_compiler_database_software_security_Teaching_material_based_on_Distributed_Systems:_Concepts_and_Design,_Edition_4,_AddisonWesley_2005.zip
File Size: 1356.48 KB

5/5 - (1 vote)

Teaching material based on Distributed Systems: Concepts and Design, Edition 4, AddisonWesley 2005
Apache Tomcat Version 6.0
CopyrightGeorge Coulouris, Jean Dollimore, Tim Kindberg 2001
email: authorscdk2.net This material is made available for private study and for direct use by individual teachers.
It may not be included in any product or employed in any service without the written permission of the authors.
A Java Based Server
Viewing: These slides must be viewed in slide show mode.
Notes from Vishal Raipurohit

What is Apache Tomcat?
The Tomcat server is a Javabased Web Application container which is used to run Servlet and Java Server Pages JSP Web applications.
It has become the reference implementation for both the Java Servlets and Java Server Pages specifications.
Tomcat was chosen to be the official Sun Web Component JSPServletContainer Reference Implementation.
2

What is Apache Tomcat? Contd.
Apache Tomcat is used to serve Java Servlets and Java Server Pages. Its a complex piece of software and though the documentation is very comprehensive, it helps to have a good reference work to hand.
It is an open source Java Servlet application server used to deploy Java applications after they are built with JSP and Servlets. It can be used as a standalone product or it can be integrated with the Apache server.
In our case will be using it stand alone within an IDE Netbeans.
3

Specifications of version 6.0
Apache Tomcat 6.0
Tomcat 6.0 is the current focus of development. It builds upon the improvements made in Tomcat 5.5.x and implements the Servlet 2.5 and JSP 2.1 specifications and includes many additional features that make it a useful platform for developing and deploying web applications and web services.. In addition it includes the following improvements after last version:
Memory usage optimizationsAdvanced IO capabilities Refactored clustering
4

Apache Tomcat version 6.0
As Tomcat 6 is a new release of Tomcat, keep in mind that some of the issues and solutions vary between the major versions of Tomcat 4.x versus 5. As you search around the web, there will be some documentation that is not relevant to Tomcat 6, but 3.x, 4.x and 5.x. Doing 3.x or 4.x things to 6 will probably not work in most cases as the server.xml files are very different.
5

Apache Tomcat version 6.0
Tomcat 6.0 is designed to run on JSE 5.0 and later. In addition, Tomcat 6.0 uses the Eclipse JDT Java compiler for compiling JSP pages. This means you no longer need to have the complete Java Development Kit JDK to run Tomcat, but a Java Runtime Environment JRE is sufficient. The Eclipse JDT Java compiler is bundled with the binary Tomcat distributions. Tomcat can also be configured to use the compiler from the JDK to compile JSP, or any other Java compiler supported by Apache Ant.
6

Apache Tomcat version 6.0
These are some of the key tomcat directories, all relative to CATALINAHOME The Root of your Tomcat install:
binStartup, shutdown and other scripts. The .sh files for Unix systems are functional duplicates of the .bat files for Windows. Win32 commandline lacks certain functionality so there are some additional files in here.
confConfiguration files and related DTDs. The most important file in here is server.xml. It is the main configuration file for the container.
logsLog files are here by default.
webappsThis is where your webapps go.
7

What is a container?
Containers are the interface between a component and the low level platformspecific functionality that supports the component.
Before a Web, enterprise bean, or application client component can be executed, it must be assembled into a J2EE module and
deployed into its container.
8

J2EE Containers Server
J2EE server :
The runtime portion of a J2EE product. A J2EE server provides EJB and
Web containers.
Enterprise JavaBeans EJB container :
Manages the execution of enterprise beans for J2EE applications.
Enterprise beans and their container run on the J2EE server.
Web container :
Manages the execution of JSP page and servlet components for J2EE applications. Web components and their container run on the J2EE server.
9

J2EE Containers Client
Application client container :
Manages the execution of application client components. Application
clients and their container run on the client.
Applet container :
Manages the execution of applets. Consists of a Web browser and Java
Plugin running on the client together.
10

J2EE Server and Containers
Client
Server
Browser
Servlet JSP page Tomcat Web Container
Application Client
Database
Client Container
Session Entity
Client Machine
Bean Bean EJB Container
JBoss,
WebSphere,
WebLogic, etc
11

Different versions of Apache Tomcat.
Different version of Apache Tomcat are available for different versions of the Servlet and JSP specifications. The mapping between them are:
ServletJSP Spec
Apache Tomcat version
2.21.1 2.31.2 2.42.0 2.52.1
3.3.2 archived 4.1.37 5.5.26 6.0.16
12

Initial Setup
The Java Software Development Kit JDK is aimed at Java developers. It consists of Suns Java Runtime Environment bundled with programming tools. Java Runtime Environment JRE is the software required to run any application deployed on Java platform.
Download J2SE Runtime Environment.
Install the JRE according to the instructions included with the release.
13

Installation of Apache Tomcat
Initiate the download of Tomcat from the site
http:tomcat.apache.org
View the corresponding documentation and setup for help in running on various platform and requirements.
After downloading start installation. 14

Installation of Apache Tomcat
After starting installation and accepting the agreement you will be asked for components to be installed which will be normal.
After selecting that, the location for installation will be asked. The location will be C:Program FilesApache Software FoundationTomcat 6.0
Continue with that and next will be the connection port 8080 and some security settings like password for user.
Next the location of jre will be asked. As mentioned before, the installation of JRE 5.0 will be required for TOMCAT 6.0. Browse the folder where JRE is installed.
15

Run and Test Tomcat
For Apache Tomcat configuration directives that can be included in a confserver.xml file to configure the behavior of the Tomcat 6 ServletJSP container visit this link:
http:tomcat.apache.orgtomcat6.0 docconfigindex.html
16

Run and Test Tomcat Contd.
You can insert a context path and document base which will help Apache Tomcat web server locate Web site projects.
The context and docBase could be set to almost anything as long as they identify the place on your hard drive where you store your projects. The path will be the prefix where all the files and folders stored will be recessed on the web server.
17

Start Up Tomcat
Tomcat can be started by executing the following commands: CATALINAHOMEbinstartup.bat Windows
CATALINAHOMEbinstartup.sh Unix
After startup, the default web applications included with Tomcat will be available by visiting:
http:localhost:8080
18

Link Details
http:localhost:8080myappchapter01sample00.html
protocol is http
Listens on port 8080
Path to file
Server is local
Can OMIT if using ROOT as default
19

Shut Down Tomcat
Tomcat can be shut down by executing the following command: CATALINAHOMEbinshutdown Windows CATALINAHOMEbinshutdown.sh Unix
20

Tomcat on Linux
GLIBC 2.2Linux 2.4 users should define an environment variable:
export LDASSUMEKERNEL2.2.5
Redhat Linux 9.0 users should use the following setting to avoid stability problems:
export LDASSUMEKERNEL2.4.1
21

Tomcat on Linux contd.
There are some Linux bugs reported against the NIO sendfile behavior, make sure you have a JDK that is up to date, or disable sendfile behavior in the Connector.br
6427312: fc FileChannel.transferTo throws IOException system call interruptedbr
5103988: fc FileChannel.transferTo should return 1 for EAGAIN instead throws IOExceptionbr
6253145: fc FileChannel.transferTo on Linux fails when going beyond 2GB boundarybr
6470086: fc FileChannel.transferTo2147483647, 1, channel cause Value too large exceptionbr
22

Setting up system environment variables
Set up the system environment variables.
This is done by accessing the system properties and after that clicking the advanced tab and then clicking Environment variables button.
A dialog will appear where we can enter the path and classpath.
23

Setting up system environment variables contd.
The JAVAHOME environment variable points at the base directory where you have installed the JDK for example, usrlocaljdk1.2.2.
You have added directory JAVAHOMEbin to your PATH environment variable, so that the java command is recognized and executed.
The TOMCATHOME environment variable points at the base directory where you have installed Tomcat for example, opttomcat or usrlocaltomcat.
24

Enabling SSI and CGI support
SSI and CGI are disabled by default for security reasons to enable them:
To enable and configure CGI support, please see the cgihowto.html page.
To enable and configue SSI support, please see the ssi howto.html page.
25

Security Managers URL
In order to grant security permissions to JARs located inside the web application repository, use URLs of of the following format in your policy file:
file:catalina.homewebappsexamplesWEB INFlibdriver.jar
26

Enabling invoker servlet:
Starting with Tomcat 4.1.12, the invoker servlet is no longer available by default in all webapps. Enabling it for all webapps is possible by editing CATALINAHOMEconfweb.xml to uncomment the servlet servletmapping definition.
Using the invoker servlet in a production environment is not recommended and is unsupported. More details are available on the Tomcat FAQ at
http:tomcat.apache.orgfaqmisc.htmlinvoker.
27

Advanced ConfigurationMultiple Tomcat Instances
When single copy of a Tomcat binary distribution is to be shared among multiple users on the same server you can pass aDcatalina.baseCATALINABASE argument when executing the startup command Replace CATALINABASE with the directory that contains the files for Tomcat instance. After this, Tomcat will calculate all relative references for files in the following directories based on the value of CATALINABASE instead of CATALINAHOME
Else CATALINABASE will default to the same value as CATALINAHOME, i.e the same directory is used for all relative path resolutions.
28

Troubleshooting
As Tomcat 6 is new release of Tomcat, so some of the issues and solutions vary between the major versions of Tomcat 4.x versus 5. Their will be some documentation that is not relevant to Tomcat 6, but 3.x, 4.x and 5.x. Doing 3.x or 4.x things to 6 will probably not work in some cases as the server.xml files are very different.
29

Any other web server using port 8080
This happens usually when any other web server or any process has laid claim to port 8080 and this one is the default HTTP port that Tomcat attempts to bind to at startup. So for changing this, open the file:
CATALINAHOMEconfserver.xml
and search for 8080. Change it to a port that isnt in use, and is greater than 1024, as ports less than or equal 1024 require superuser root access to bind under UNIX. Restart Tomcat. Be sure that you replace the 8080 in the URL youre using to access Tomcat. Like if you change the port to 1977, you would request the URL http:localhost:1977 in browser.
30

The localhost machine isnt found error
The localhost machine isnt found.
This could happen if youre behind a proxy. If thats the case, make sure the proxy configuration for your browser knows that you shouldnt be going through the proxy to access the localhost. In Netscape, this is under EditPreferencesAdvancedProxies, and in Internet Explorer, ToolsInternet OptionsConnectionsLAN Settings.
31

Apache Tomcat Updates
The latest version of Apache Tomcat changes regularly so keep updated by visiting the link :
http:tomcat.apache.org
32

Advantages of Tomcat
1 It is an open source application server 2 It is a light weight server no EJB
3 It is easily configured with apache and IIS4 Very stable on Unix systems
5 Good documentation online
6 Java Sun compliant
7 Does not require a lot of memory at startup 8 It is free, yet high quality!
33

References:
http:tomcat.apache.org http:java.sun.com http:jakarta.apache.org
34

35

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[SOLVED] html Java compiler database software security Teaching material based on Distributed Systems: Concepts and Design, Edition 4, AddisonWesley 2005
$25