tomcat配置学习笔记

    1.新建自己的web工作目录后,初学者一般会去修改server.xml文件来指向该目录。其实不必修改conf/server.xml,只需要新建一个xml(context)文件,放到conf/Catalina/localhost目录下面即可。

例如:

<?xml version="1.0" encoding="UTF-8"?>
<Context
    docBase="D:/cms"
    reloadable="true"
    workDir="D:/cms/work">
</Context>
服务启动时会加载这些文件,如果该目录下没有找到相应文件则会去查找相应war文件下的 meta-inf/context.xml文件
即(引自tomat_doc):
In addition to nesting Context elements inside a Host element, you can also store them:

1. in the individual $CATALINA_HOME/conf/context.xml file: the Context element information will be loaded by all webapps (安装目录下conf/context.xml文件,所有应用必须加载该文件)
2. in the individual $CATALINA_HOME/conf/[enginename]/[hostname]/context.xml.default file: the Context element information will be loaded by all webapps of that host ()
3. in individual files (with a ".xml" extension) in the $CATALINA_HOME/conf/[enginename]/[hostname]/ directory
4. if the previous file was not found for this application, in individual file at /META-INF/context.xml inside the application files
更详细内容请见http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/context.html

     2.tomcat的角色由conf/tomcat-users.xml配置。

     3.tomcat5.x的版本中admin模块默认没有安装,需从网站下载,另外需修改conf/tomcat-users.xml文件,加一个admin角色并提供用户才可以使用admin模块。例如:

  <role rolename="admin"/>
  <user username="adm" password="tomcat" roles="admin,manager"/>

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值