`
dodoflying
  • 浏览: 180173 次
社区版块
存档分类
最新评论

Installing Tomcat on Ubuntu

阅读更多

http://doc.gwos.org/index.php/Install_tomcat_5.5

Versions:

  • SDK: 1.5
  • JRE: 1.5
  • Tomcat: 5.5

Step 1 – Install JRE and SDK

Use the advice here to install these packages

You can verify that both items were installed corectly, by checking that you get a response when typing in terminal:

file.pngCode:

java -version javac -help


Step 2 – Get tomcat

Download tomcat 5.5 from http://jakarta.apache.org/site/downloads/

In this example I am using jakarta-tomcat-5.5.9.tar.gz

Uncompress the file:

file.pngCode:

tar xvfz jakarta-tomcat-5.5.9.tar.gz


N.B. To make things simpler I also renamed the package to just 'tomcat'. If you do not do this, make sure you adjust these tutorial instructions to the name of your package whenever you see 'tomcat' written.

Step 3 – Add tomcat

Place the uncompressed package in:

/usr/local/

Step 4 – Set JAVA_HOME and CLASSPATH

You need to point out where you installed Java SDK. You will have to edit the file '.bashrc'. Backup this file first!

In terminal type:

file.pngCode:

gedit ~/.bashrc


Add the following lines to the file:

file.png File:~/.bashrc

#Stuff we added to make tomcat go
export JAVA_HOME=/usr/lib/j2sdk1.5-sun/
export CLASSPATH=/usr/local/tomcat/common/lib/jsp-api.jar:/usr/local/tomcat/common/lib/servlet-api.jar


N.B. remember to change the word tomcat to the name of the package you placed in /usr/local.

Save and close. You will have to log out and back in again before these changes take effect.


The next steps are optional. They are for setting tomcat up to be used as a development environment.

Skip to the last step ( Step 8 ) if you just want to start tomcat how it is.

Step 5 – Change default port number

Tomcats default port number is 8080. To change it to 80 or another number do the following.

In terminal type:

file.pngCode:

gedit usr/local/tomcat/conf/server.xml


Find the lines:

file.pngCode:

<Connector port="8080" ... maxThreads="150" minSpareThreads="25" ...


Adjust the port number to 80 (or any other port number you want to use), save and close.

Step 6 – Turn on Servlet reloading

In terminal type:

file.pngCode:

gedit usr/local/tomcat/conf/context.xml


Find:

file.png File:/usr/local/tomcat/conf/context.xml

<Context>


Change it to:

file.png File:/usr/local/tomcat/conf/context.xml

<Context reloadable="true">


Save and close.

Step 7 – Enable Invoker Servlet

In terminal type:

file.pngCode:

gedit usr/local/tomcat/conf/web.xml


Find and uncomment (remove the <-- and --> wrapped around the tags):

file.png File:/usr/local/tomcat/conf/web.xml

<servlet>
<servlet-name>invoker</servlet-name>
<servlet-class>
org.apache.catalina.servlets.InvokerServlet
</servlet-class>
...
</servlet>


Also find and uncomment:

file.png File:/usr/local/tomcat/conf/web.xml

<servlet-mapping>
<servlet-name>invoker</servlet-name>
<url-pattern>/servlet/*</url-pattern>
</servlet-mapping>


Save and close.

Step 8 – Start tomcat

Tomcat should now be ready to run.

In terminal type:

file.pngCode:

sh /usr/local/tomcat/bin/startup.sh


If everything is working fine, you will see the following lines:

file.png File:/usr/local/tomcat/bin/startup.sh

Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME: /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME: /usr/lib/j2sdk1.5-sun/


In your browser head to http://localhost/ and test if it is serving. If you didn't change the port number it was serving on, head to http://localhost:8080/

To stop tomcat type:

file.pngCode:

sh /usr/local/tomcat/bin/shutdown.sh



I hope this helped!

If you have any problems, I recommend this site for more details: http://www.coreservlets.com/

分享到:
评论
3 楼 shaken 2007-06-12  
装了ubuntu 7.04的tomcat ,但是无法连接啊。
看配置文件也没有错。不知道怎么才能确定服务是否已经正常运行。还有使用了什么端口。
2 楼 lgn21st 2006-11-27  
在Ubuntu 6.10的安装源里面已经有tomcat5.5.20了
1 楼 xxj 2006-11-23  
Install JDK:
sudo apt-get install sun-java5-jdk


Change the default JDK:
sudo update-alternatives --config java


Install Tomcat:
sudo apt-get install tomcat5

相关推荐

    installing samba on ubuntu

    面是我在Ubuntu6.06 LTS 下源码编译安装samba主要安装过程,本人第一次用Ubuntu,刚装上去时候,没有gcc编译环境。郁闷了半天。找出这一过程发了不少的时间。可能还有些不妥,不过我经过这样的安装达到了向windows共享...

    anaconda安装 - Installing Anaconda on Ubuntu

    ### 安装Anaconda在Ubuntu上的详细步骤及关键知识点 #### 一、Anaconda简介 Anaconda是一款非常受欢迎的数据科学平台,它集成了Python或R语言环境中的许多库和工具,便于用户进行数据处理、科学计算、机器学习等...

    Installing STLinux on Ubuntu

    ### 安装STLinux在Ubuntu上的关键步骤与挑战 #### 概览 本文将深入探讨在Ubuntu上安装STLinux的全过程,重点解析由于包管理系统的差异而带来的挑战及其解决方案。对于那些希望在Ubuntu环境中利用STLinux强大功能的...

    OpenERP Installing Ubuntu9.04

    OpenERP Installing Ubuntu9.04

    Failed to install Tomcat6 service(Tomcat6安装失败解决方法)

    3. **具体错误**:“Failed installing Tomcat6 service”。 4. **错误位置**:在执行 `$tomcat_install/logs/jakarta_service_date.log` 日志文件中记录的 `service.bat` 文件时出现。 #### 解决方案 为了解决...

    Installing RAC on AIX

    本篇将基于提供的文档摘要,深入解析安装Oracle RAC on AIX的关键步骤与注意事项,为读者提供一份详尽的操作指南。 ### 安装准备阶段 #### 1. 下载并解压安装介质 首先,需要从Oracle官方网站的edelivery服务下载...

    Microsoft Windows 2000 Scripting Guide - Installing Software on a Remote Computer

    Microsoft Windows 2000 Scripting Guide - Installing Software on a Remote Computer

    \Installing RAC on AIX 001.pdf

    根据提供的文档信息,本文将详细解析安装 Oracle RAC (Real Application Clusters) 在 AIX 操作系统上的步骤、注意事项及关键技术点。 ### 安装前准备 #### 下载安装介质与补丁集 ... - 示例文件包括:`B24442-01_1...

    Installing MIUI on Meizu MX2

    在IT领域,将一款设备刷入不同的操作系统或定制ROM是一种常见的技术操作,它允许用户根据个人喜好和需求自定义手机的界面与功能。本篇内容将深入解析如何在魅族MX2上安装MIUI系统,这是一项对于Android发烧友而言极...

    Installing Your Driver on Windows Millennium

    Installing Your Driver on Windows Millennium INF File Guide

    Ubuntu 使用手册 14.04 最新版本(英文原版)

    Installing Ubuntu—Getting started 11 Finishing Installation 16 2 The Ubuntu Desktop 19 Understanding the Ubuntu desktop 19 Unity 19 The Launcher 21 The Dash 21 Workspaces 24 Managing windows 24 Unity...

    linux环境Tomcat安装配置手册

    本手册旨在指导用户在 Linux 环境中安装和配置 Tomcat 服务器, step-by-stepguiding users through the process of installing and configuring Tomcat on a Linux environment. 知识点一:下载和安装 Tomcat 在...

    Installing Ubuntu 14.04 & ROS & TurtleBot 06-29-2016

    Installing Ubuntu 14.04 & ROS & TurtleBot 06-29-2016 个人小结,关于Ubuntu和ROS的安装。

    Installing Quantum ESPRESSO (serial) on Linux-UBUNTU [TUTORIAL] [720p].mp4

    quantum espresso 视频可以认真学习 进行入门,非常不错的材料 给大家进行分享,值得拥有

    Installing Configuring Alfresco ECM 3.1

    - **Installing Alfresco Tomcat bundle on Windows**:如果用户已经安装了 JDK,则可以仅安装包含 Alfresco 和 Tomcat 的捆绑包。 - **Configuring Alfresco as a Windows service**:指导如何将 Alfresco 配置为 ...

    Beginning.Ubuntu.LTS.Server.Administration.From.Novice.to.Professional.2nd.Edition

    Installing and configuring Ubuntu to ensure secure installations Virtual Ubuntu and LDAP configuration Full network and web services management What you’ll learn Administer, install, and configure ...

    Tomcat The Definitive Guide, 2nd Edition(PDF)

    Updated for the latest version of Tomcat, this new edition offers a complete guide to installing, configuring, maintaining and securing this servlet container. In fact, with such a wealth of new ...

    Ubuntu Server Guide < 英文版>

    The Ubuntu Server Guide contains information on how to install and configure various server applications on your Ubuntu system to fit your ...installing Ubuntu, refer to the Ubuntu Installation Guide.

    Installing Activ Test on Your PC

    ### 安装Activ Test软件至个人电脑的知识点详解 #### 一、背景介绍 随着信息技术的发展,越来越多的专业技能认证考试采用计算机化的方式进行。其中,ECDL(欧洲计算机驾驶执照)作为一项广泛认可的计算机操作技能...

    MySQL V5.5帮助文档

    2.4.1. General Notes on Installing MySQL on Mac OS X 2.4.2. Installing MySQL on Mac OS X Using Native Packages 2.4.3. Installing the MySQL Startup Item 2.4.4. Installing and Using the MySQL Preference...

Global site tag (gtag.js) - Google Analytics