apache tomcat部署web应用的三种实现方式

工具:apache-tomcat-8.0.33 + windows 10 + JDK 1.7

第一种方式:

(1)将自己的web应用放到解压后的tomcat的webapps目录下。这是最简单,最传统,也是最常用的一种方式!

 (2)双击tomcat的bin目录下的startup.bat 文件,若启动窗口中没有错误信息输出,即tomcat启动成功!

 (3)打开浏览器窗口输入localhost:8080即可访问到tomcat管理界面,输入localhost:8080/THEME/ 即可访问到自己的web应用界面。

 

第二种方式:(注意:测试第二种方式需要提前把第一种方式中的webapps下的THEME目录移除)

(1)找到并编辑修改apache-tomcat-8.0.33\conf/server.xml文件。

    
(2)保存退出后,启动tomcat服务,启动方式同一。在浏览器中输入访问地址即可访问成功!


第三种方式:(注意:测试第三种方式需要提前把第二种方式中的server.xml中的配置移除)

(1)进入目录apache-tomcat-8.0.33\conf\Catalina\localhost,在该目录创建一个THEME.xml文件。

注意:新下载的tomcat在conf目录下没有Catalina目录,此时需要先去启动一下tomcat服务,目录就会出现。

    文件内容为:

<?xml version="1.0" encoding="UTF-8"?>
<!--
  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://www.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.
-->
<Context path="/THEME" docBase="E:\test-web\THEME" />
(2)保存后,启动tomcat服务。 浏览器中输入访问地址即可访问成功!

  • 1
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值