zoukankan      html  css  js  c++  java
  • tomcat7.0 server.xml修改(默认目录,端口,多个域名)

    tomcat目录下的conf文件夹, server.xml

    1、修改默认webapps

    1 <Host name="localhost"  appBase="webapps" unpackWARs="true" autoDeploy="true">
    2   ...
    3 </Host>

    appBase 可以修改成你的站点位置如:D:/web

    2、修改默认目录ROOT

    具体是是在<Host></Host>之间加上Content标签,你可以理解为每个Content都代表一个应用。

    1 <Context path="" docBase="/myweb" debug="0" reloadable="true"/>

    path是说明虚拟目录的名字,如果你要只输入ip地址就显示主页,则该键值留为空;
    docBase是虚拟目录的路径,它默认的是$tomcat/webapps/ROOT目录,现在我在webapps目录下建了一个myweb目录,让该目录作为我的默认目录。
    debug和reloadable一般都分别设置成0和true。

    3、默认端口

    1 <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />

    将port改成你的端口

    4、绑定域名

    1 <Host name="xx.com"  appBase="webapps" unpackWARs="true" autoDeploy="true">
    2   <Alias>www.xx.com</Alias> <!--多个域名-->
    3 </Host>

    5、多个项目

    1 <Host name="aa.com"  appBase="webapps" unpackWARs="true" autoDeploy="true">
    2 ...
    3 </Host>
    4 
    5 <Host name="bb.com"  appBase="webapps" unpackWARs="true" autoDeploy="true">
    6 ...
    7 </Host>

    6、中文图片名字显示不出来解决办法

    1 <Connector port="8080" connectionTimeout="20000" disableUploadTimeout="true" URIEncoding="utf-8"/>

    附录:参考自:http://www.cnblogs.com/ilovecss/archive/2013/04/28/3049098.html

  • 相关阅读:
    Docker login报错一例
    Ubuntu 18.04设置dns
    docker日志引擎说明
    Docker简介与安装配置
    使用traefik作为kubernetes的ingress
    Axiom3D:Ogre动画基本流程与骨骼动画
    Axiom3D:Ogre中Mesh文件格式分析(一)
    Axiom3D:数据绑定基本流程
    3D引擎Axiom的选择与学习.
    初试PyOpenGL四 (Python+OpenGL)GPU粒子系统与基本碰撞
  • 原文地址:https://www.cnblogs.com/xbyl/p/5997700.html
Copyright © 2011-2022 走看看