• Save
Tomcat configuration
Upcoming SlideShare
Loading in...5
×
 

Tomcat configuration

on

  • 744 views

Simple configuration for Tomcat servlet container

Simple configuration for Tomcat servlet container

Statistics

Views

Total Views
744
Views on SlideShare
744
Embed Views
0

Actions

Likes
1
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Tomcat configuration Tomcat configuration Presentation Transcript

    • Prepared by: Dima Gomaa
    •  Tomcat is a Servlet container (Web server that interacts withSe rvle ts ) developed under the Jakarta Project of Apache SoftwareFoundation Tomcat implements the Se rvle t and the Java Se rve r Pag e s (JSP)specifications of Sun Microsystems Tomcat is an open-source, non commercial project◦ Licensed under the Apache Software License Tomcat is written in Java (OS independent)
    • Tomcat is a free open source implementation of java server pagesand java servlets, developed as part of the Jakarta projectunder the Apache Software FoundationMore info at:http://tomcat.apache.org/
    •  To use Tomcat web server working need to know about: Environment variables How to start and stop the server How to configure Tomcat to pick up web files from your directory
    •  Extract source zip file into a directory on hard disk. Default directoryis jakarta-tomcat-ve rsio n#. A set of subdirectories are automatically created (bin, conf, doc etc)Tomcat uses two environment variables: environment variables:◦ JAVA_HOME and CATALINA_HOME
    •  Extract source zip file into a directory on hard disk. Default directoryis jakarta-tomcat-ve rsio n#. A set of subdirectories are automatically created (bin, conf, doc etc) Tomcat uses two environment variables: environment variables:◦ JAVA_HOME (point to directory containing JDK)◦ CATALINA_HOME (point to directory containing Tomcat)
    •  From UNIX shell prompt, go to where Tomcat is installed◦ dgomaa_debian: cd /usr/local/jakarta-tomcat-1.6… Go to the subdirectory bin To START:◦ ./startup.sh Tomcat server executes on TCP port 8080 (in case anotherserver is using the default port 80)
    •  To test Tomcat, in browser type URL:http://hostname:8080/ This will access the Tomcat documentation welcome page ifserver working properly To STOP Tomcat when it is running◦ ./shutdown .sh
    •  By default, Tomcat looks in its own WEBAPPS directory for webapplication files (e.g. jsps, html etc) To hold application files elsewhere, need to edit the se rve r. xm lconfiguration file (in the conf directory) to look in alternate location.Both <host> and <context> element need to be changed -NOTE: Always make a backup of server.xml before changing!In server.xml: change Host name parameter appbase from ‘webapps’ to thepreferred directory you want <Host name="localhost"debug="0"appBase=“/home/dgomaa/tomcat-apps/webapps" reloadable ="true"
    • To set up an application directory: -To create a new web application (e.g. newapp) in yourweb application directory Tomcat directory :◦ create a subdirectory of your WEBAPPs directory in which to holdthe web application files◦ This directory is now the top level directory for the web applicationnewapp, accessed as http://www.domainname/newapp
    •  An applications directory must contain the following:◦ The directory WEB-INF/◦ A legal web.xml file under WEB-INF/<web-app></web-app>
    •  Environment variable java_home incorrect Not putting 8080 in URL (http://localhost:8080) Not configuring server.xml to look at correct location of your webfiles Not starting the server… Not re-starting the server when you’ve added/ changed your files Not re-setting the environment variables when shell re-started