【Linux运维】【基础】Ubuntu系统中安装Tomcat

前期准备

  1. 在安装Tomcat之前,需要先安装好JDK,并配置环境变量;
    可参考:【Linux运维】【基础】Ubuntu系统中安装JDK

  2. 在官网下载所需版本的Tomcat。
    下载链接:Apache Tomcat®
    Tomcat官网下载界面

安装过程

  1. 将下载好的Tomcat安装包,拷贝至Ubuntu系统中,cd至Tomcat所在目录后,使用命令解压至指定路径下。
tar -zxvf apache-tomcat-7.0.94.tar.gz -C /home/boyce/App/

其中:
apache-tomcat-7.0.94.tar.gz:是下载的Tomcat文件名;
/home/boyce/App:是您想要存放安装软件的路径。

解压Tomcat

  1. 解压完成后,需要修改bin目录下的startup.sh和shutdown.sh文件。进入到/home/boyce/App/apache-tomcat-7.0.94/bin/,选择上述两个文件,右键使用选择gedit打开,在最后一行之前,加入如下代码并保存。
# set java environment
export JAVA_HOME=/home/boyce/App/jdk1.7.0_80   # 修改成你自己的jdk安装路径
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JAVA_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH

# set tomcat ,修改成你自己的Tomcat路径
export TOMCAT_HOME=/home/boyce/App/apache-tomcat-7.0.94

修改startup.sh和shutdown.sh文件

  1. 输入如下命令,启动Tomcat,并访问127.0.0.1:8080,如果显示Apache Tomcat页面,则表明启动成功。
cd /home/boyce/App/apache-tomcat-7.0.94/bin
sudo ./startup.sh

Tomcat启动页面

  1. 此外,可通过修改tomcat目录下的conf/tomcat-user.xml配置文件,在</tomcat-user>之前加入如下代码,添加超级管理员用户。
<role rolename="manager-gui"/>
<role rolename="admin-gui"/>
<user username="boyce" password="123456" roles="manager-gui,admin-gui"/>
  1. 按照第5步重新启动Tomcat,进入Apache Tomcat页面后,点击右侧的Manager App按钮,输入第6步配置的管理员用户名和密码,如果登录成功,进入manager页面,则表明添加的用户有效。
    Manager页面

到此,在Ubuntu下安装Tomcat就完成了。

官网资源 ============================================================ Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ============================================================ ================================= Apache Tomcat 7.0 Patch Proposals ================================= RELEASE SHOWSTOPPERS: PATCHES ACCEPTED TO BACKPORT: [ start all new proposals below, under PATCHES PROPOSED. ] PATCHES PROPOSED TO BACKPORT: [ New proposals should be added at the end of the list ] * https://bz.apache.org/bugzilla/show_bug.cgi?id=54330 Refactor Member interface to reduce dependency on concrete implementation. Based on a patch by Greg Turnquist. I have added this to the status file because it changes an interface. I don't believe there is any harm in this - the interface isn't really usable prior to this patch - but I'd prefer this change to be RTC. http://svn.apache.org/viewvc?rev=1430602&view=rev +1: markt, fhanik -1: * Back-port r1437083 from trunk. http://svn.apache.org/viewvc?view=revision&revision=1437083 Adds SSLContext.clearOptions method to allow clearing of SSL_OP_* options in OpenSSL. This will require tcnative 1.1.25 or errors may be thrown when a
Tomcat是Apache 软件基金会(Apache Software Foundation)的Jakarta 项目的一个核心项目,由Apache、Sun 和其他一些公司及个人共同开发而成。由于有了Sun 的参与和支持,最新的Servlet 和JSP 规范总是能在Tomcat 得到体现,Tomcat 5支持最新的Servlet 2.4 和JSP 2.0 规范。因为Tomcat 技术先进、性能稳定,而且免费,因而深受Java 爱好者的喜爱并得到了部分软件开发商的认可,成为目前比较流行的Web 应用服务器。 Tomcat 服务器是一个免费的开放源代码的Web 应用服务器,属于轻量级应用服务器,在小型系统和并发访问用户不是很多的场合下被普遍使用,是开发和调试JSP 程序的首选。对于一个初学者来说,可以这样认为,当在一台机器上配置好Apache 服务器,可利用它响应HTML(标准通用标记语言下的一个应用)页面的访问请求。实际上Tomcat是Apache 服务器的扩展,但运行时它是独立运行的,所以当你运行tomcat 时,它实际上作为一个与Apache 独立的进程单独运行的。 诀窍是,当配置正确时,Apache 为HTML页面服务,而Tomcat 实际上运行JSP 页面和Servlet。另外,Tomcat和IIS等Web服务器一样,具有处理HTML页面的功能,另外它还是一个Servlet和JSP容器,独立的Servlet容器是Tomcat的默认模式。不过,Tomcat处理静态HTML的能力不如Apache服务器。目前Tomcat最新版本为9.0。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值