首页 > 其他分享 >tomcat简单配置

tomcat简单配置

时间:2023-02-01 13:48:15浏览次数:43  
标签:xml tomcat webapps 配置 server conf 简单 拷贝到

1.网页拷贝到webapps目录
2.编辑 conf/server.xml

<?xml version="1.0" encoding="UTF-8"?>
<Server port="8005" shutdown="SHUTDOWN">
  <Listener className="org.apache.catalina.startup.VersionLoggerListener" />
  <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
  <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
  <GlobalNamingResources>
    <Resource name="UserDatabase" auth="Container" type="org.apache.catalina.UserDatabase" 
	description="User database that can be updated and saved" 
	factory="org.apache.catalina.users.MemoryUserDatabaseFactory"  pathname="conf/tomcat-users.xml" />
  </GlobalNamingResources>
  
  <!--  ***************************************************************************************** -->
     <!--  名称-->
   <Service name="Catalina-examples">
               <!--  端口-->
    <Connector port="10000" protocol="HTTP/1.1"  connectionTimeout="20000"  redirectPort="8443" />
    <Engine name="Catalina2" defaultHost="localhost">
      <Realm className="org.apache.catalina.realm.LockOutRealm">
        <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>
      </Realm>
      <Host name="localhost"  appBase="webapps" unpackWARs="true" autoDeploy="true">
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
		prefix="localhost_access_log" suffix=".txt" pattern="%h %l %u %t &quot;%r&quot; %s %b" />	   
		                 <!--  网页文件夹-->
		<Context path="/" docBase="examples" debug="0" privileged="true"> </Context>
      </Host>
    </Engine>
  </Service>

<!--  ***************************************************************************************** -->
   <Service name="Catalina-eval">
    <Connector port="10001" protocol="HTTP/1.1"  connectionTimeout="20000"  redirectPort="8443" />
    <Engine name="Catalina2" defaultHost="localhost">
      <Realm className="org.apache.catalina.realm.LockOutRealm">
        <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>
      </Realm>
      <Host name="localhost"  appBase="webapps" unpackWARs="true" autoDeploy="true">
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
		prefix="localhost_access_log" suffix=".txt" pattern="%h %l %u %t &quot;%r&quot; %s %b" />	   
		<Context path="/" docBase="dist-eval" debug="0" privileged="true"> </Context>
      </Host>
    </Engine>
  </Service>
  
   
<!--  ***************************************************************************************** -->
   <Service name="Catalina-quaps">
    <Connector port="10002" protocol="HTTP/1.1"  connectionTimeout="20000"  redirectPort="8443" />
    <Engine name="Catalina2" defaultHost="localhost">
      <Realm className="org.apache.catalina.realm.LockOutRealm">
        <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>
      </Realm>
      <Host name="localhost"  appBase="webapps" unpackWARs="true" autoDeploy="true">
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
		prefix="localhost_access_log" suffix=".txt" pattern="%h %l %u %t &quot;%r&quot; %s %b" />	   
		<Context path="/" docBase="dist-quaps" debug="0" privileged="true"> </Context>
      </Host>
    </Engine>
  </Service>
  
  
  <!--  ***************************************************************************************** -->
   <Service name="Catalina-quaps">
    <Connector port="10003" protocol="HTTP/1.1"  connectionTimeout="20000"  redirectPort="8443" />
    <Engine name="Catalina2" defaultHost="localhost">
      <Realm className="org.apache.catalina.realm.LockOutRealm">
        <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>
      </Realm>
      <Host name="localhost"  appBase="webapps" unpackWARs="true" autoDeploy="true">
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
		prefix="localhost_access_log" suffix=".txt" pattern="%h %l %u %t &quot;%r&quot; %s %b" />	   
		<Context path="/" docBase="dist-auto" debug="0" privileged="true"> </Context>
      </Host>
    </Engine>
  </Service>
  
</Server>


标签:xml,tomcat,webapps,配置,server,conf,简单,拷贝到
From: https://www.cnblogs.com/hyhc8848/p/17082245.html

相关文章

  • vscode 配置
    {"window.zoomLevel":2,"[go]":{"editor.insertSpaces":false,"editor.formatOnSave":true,"editor.codeActionsOnSave":{......
  • 查看 tomcat host-manager 用户权限
    解决方法,一共分两步:1、查看是否添加用户和角色:进入到tomcat的conf目录下,编辑tomcat-users.xml配置文件添加manager-script角色,并赋予角色给admin<rolerolename="admin-g......
  • 简单分块与莫队
    1-分块1.1-定义分块是将要维护的信息分成若干块,而后通过维护整块的信息或者是块间的信息来优化算法。1.2-序列分块在序列上以线段树来类比,线段树是将序列每次对......
  • 从零开始配置vim(31)——git 配置
    很抱歉又拖更了这么久了,在这个新公司我想快速度过试用期,所以大部分的精力主要花在日常工作上面。但是这个系列还是得更新下去,平时只能抽有限的业余时间来准备。这就导致我......
  • android自定义adapter之简单写法
      自定义adapter比较常用,很多人还在使用extendsBaseAdapter,然后写一大堆重复的代码,这里是提供一个封装的工具类,把重复的代码都省略掉,让adapter变的简洁一些。  给......
  • jpa多数据源时Hibernate配置自动生成表不生效
    jpa配置多数据源教程很多,在Springboot2之后有一些变化,来看一下。application.yml如下:spring:application:name:t3ccdatasource:primary:jdbc-url:jdb......
  • ffmpeg 简单教程
    关于ffmpeg的另一个帖子​​​https://www.cnprint.org/bbs/thread/83/345103/​​检测是否安装成功环境变量:测试是否安装成功win+r输入:cmdcmd:输入ffmpeg-version......
  • python pyqt5简单界面
    ​​https://doc.qt.io/qtforpython/PySide6/QtWidgets/QTableWidget.html​​importsysfromPyQt5.QtWidgetsimportQApplication,QWidget,QDesktopWidget,QHBoxLayou......
  • pyqt5 简单工具类
    fromPyQt5.QtWidgetsimportQPushButton,QLabel,QLineEdit,QTextEdit,QPlainTextEdit,QCheckBoxfromPyQt5.QtWidgetsimportQComboBox,QRadioButtonclassMYWIDGET():......
  • pyqt5 简单模板
    importsysfromPyQt5.QtCoreimportQtfromPyQt5.QtWidgetsimportQWidget,QDesktopWidget,QVBoxLayout,QHBoxLayout,QApplication,QButtonGroupfromutils.tableUt......