Tomcat目录映射设置
方法一:
\conf\server.xml
<Host>内插入<Context path="虚拟目录" docBase="文件目录" />
<Context path="虚拟目录" docBase="文件目录" />
注:需重启Tomcat
方法二:
\conf\Catalina\localhost
新建文件 虚拟目录.xml 文件内写入
<Context path="" docBase="文件目录" />
注:
多级目录写法 虚拟一级目录#虚拟二级目录#虚拟三级目录.xml
根目录起始页设置
\conf\Catalina\localhost
1.新建文件 ROOT.xml 文件内写入
<Context path="" docBase="文件目录" />
2.文件目录下新建必须文件夹 "WEB-INF","WEB-INF"下新建文件夹"classes"和"lib"
3.新建文件 web.xml 文件内写入

<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
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.
-->
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
<welcome-file-list>
<welcome-file>起始页1.html</welcome-file>
<welcome-file>起始页2.html</welcome-file>
<welcome-file>起始页3.html</welcome-file>
</welcome-file-list> </web-app>

本地域名映射
1.C:\Windows\System32\drivers\etc\hosts
127.0.0.1 域名
2.\conf\server.xml
<Engine></Engine>内插入
<Host name="域名" appBase="域名基准文件路径">
<Context path="虚拟目录" docBase="文件路径(相对基准文件路径)"/>
</Host>
*端口
<Connector port="80" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
Tomcat目录映射设置的更多相关文章
- tomcat目录映射
环境:CentOS 6 + tomcat 7 + jdk 7 目前使用2种方法: 1.tomcat/conf/server.xml <Host name="localhost" ...
- (Tomcat)服务器之web应用的虚拟目录映射和主机搭建
首先来了解一下web的虚拟目录映射和主机搭建的知识 第一:web的虚拟目录映射 首先我们要知道什么叫做web的虚拟目录映射,这个很好理解的,就是将我们本地硬盘上的web应用映射出一个供外界用户访问的地 ...
- JavaWeb学习篇之----web应用的虚拟目录映射和主机搭建(Tomcat)
从今天开始来学习JavaWeb的相关知识,之前弄过一段时间JavaWeb的,就是在做毕业设计的时候搞过,但是那时候完全是为了任务去学习,所以效果不好,好多东西都没有深入的研究过,所以接下来的一段时间我 ...
- tomcat配置虚拟目录映射
本文主要介绍web虚拟目录映射的两种常用方法及配置默认web应用的方法 一.在Server.xml中进行配置 在<Host>元素中添加子元素<Context path=" ...
- Tomcat 虚拟目录映射
最近老是被一个旧Ant工程所困扰,代码版本都改好了测试也通过了,就是打不了war包,一看build.xml 我的天 各种逆天啊....头大.于是乎想起了最基础的tomcat虚拟目录虽是一个很基础的点, ...
- tomcat配置目录映射
修改server.xml,在<host>中添加<Context>,具体配置如下: <!-- 目录映射 --> <Context path="/upl ...
- web应用和虚拟目录映射
Tip:WEB应用程序 WEB应用程序指供浏览器访问的程序,通常简称为web应用. 一个web应用由多个静态web资源和动态web资源组成,如: HTML.css.js文件 JSP文件.java程序. ...
- tomcat 防火墙如何设置
tomcat 防火墙能够有效的防护我们电脑,那么我们要怎么样去设置呢?下面由学习啦小编给你做出详细的tomcat 防火墙设置方法介绍!希望对你有帮助! tomcat 防火墙设置方法一: 1.为tomc ...
- nginx 目录映射
---恢复内容开始--- 设置目录映射 ---恢复内容结束--- 设置目录映射
随机推荐
- django 1.7之后python manage.py syncdb没有了
在命令行输入python manage.py createsuperuser按照提示输入即可记得先初始化表. django>1.7 python manage.py makemigrations ...
- 自动重启sqlserver服务
公司一台官网服务器是由.net语言sqlserver数据库开发的,官网后台登录要涉及到sql数据库,现在出了一个问题,每天登录后台都会报错,要重启sqlserver才能进入,问题一直也没有解决,但是也 ...
- 一次性搞明白 service和factory区别
原文链接 http://blog.thoughtram.io/angular/2015/07/07/service-vs-factory-once-and-for-all.html 等下,已经有一篇文 ...
- C++学习笔记 构造&析构 友元 new&delete
构造&析构函数 构造函数 定义:与类同名,可以有参可以无参,主要功能用于在类的对象创建时定义初始化的状态,无返回值,也不能用void修饰,构造函数不能被直接调用,必须通过new运算符在创建对象 ...
- int型时间字符串转日期
string re ="201611"; DateTime d1 = DateTime.ParseExact(re, "yyyyMMdd", null);
- 使用Visual Studio扩展插件Visual assist X给代码插入注释模板
Visual Assist 是由Whole Tomato公司为Microsoft Visual Studio开发的一款插件.它对Visual Studio的智能提示功能和代码高亮功能进行了增强,同时还 ...
- WebSocket///////////////////////z
作者:Ovear链接:http://www.zhihu.com/question/20215561/answer/40316953来源:知乎著作权归作者所有,转载请联系作者获得授权. 一.WebSoc ...
- jQuery Scroll Follow
Overview Scroll Follow is a simple jQuery plugin that enables a DOM object to follow the page as the ...
- Python Thread related
1.Thread.join([timeout]) Wait until the thread terminates. This blocks the calling thread until the ...
- win8 win10 安装msi 提示2502、2503的错误代码
前言: 归根到底是权限不够导致的.win7应该不会有这个问题. 问题发生: 换了个电脑,装个win10预览版玩玩,发现python的msi安装文件安装不了.错误代码是2502. 其实我已经在w ...