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
    评论
好的,我可以和你分享一些关于Spring Boot的学习笔记。 1. Spring Boot是什么? Spring Boot是一个基于Spring框架的快速开发框架,它能够帮助开发者快速搭建Spring项目,简化了Spring应用开发的繁琐过程,提高了开发效率。 2. Spring Boot的优点有哪些? Spring Boot的优点有很多,其中包括: - 简化了Spring应用的开发,提高了开发效率; - 集成了很多常用的第三方库,减少了依赖管理的工作; - 自动化配置,减少了配置文件的编写工作; - 内嵌了Tomcat等Web容器,使得应用的部署更加便捷; - 提供了Actuator等模块,使得应用的监控和管理更加便捷。 3. Spring Boot的核心注解有哪些? Spring Boot的核心注解包括: - @SpringBootApplication:标注在启动类上,代表这是一个Spring Boot应用; - @Controller:标注在控制器类上,处理HTTP请求; - @Service:标注在服务类上,用于处理业务逻辑; - @Repository:标注在数据访问类上,用于数据库访问; - @Configuration:标注在配置类上,用于配置Spring应用上下文。 4. Spring Boot的配置文件有哪些? Spring Boot的配置文件包括: - application.properties:基于Key-Value的属性文件; - application.yml:基于YAML语法的配置文件。 5. 如何使用Spring Boot集成数据库? 使用Spring Boot集成数据库需要完成以下几个步骤: - 在pom.xml中添加相关数据库依赖; - 配置数据源和JPA/Hibernate等相关配置; - 编写实体类和DAO层代码。 以上就是一些关于Spring Boot的学习笔记,希望能对你有所帮助。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值