---
title: "Tomcat学习笔记（一）"
author: "chandler"
date: "2010-03-18T15:50:20Z"
tags: ["Ant", "JVM", "Linux", "Spring", "Tomcat"]
categories: ["企业架构"]
slug: "tomcat"
draft: false
lastmod: "2010-03-18T15:50:20Z"
id: 619119
url: "https://chandler.iteye.com/blog/619119"
---

1。多个Tomcat实例  
     To have one Tomcat distribution installed and run two or more Tomcat JVM instances that are configureddifferently, you must keep each JVM instance’s files separate  
      看了这句话，对于Tomcat有点得结构有点模糊的感觉。隐隐的感觉Tomcat设计得相当的松散。后面介绍说，Tomcat得运行的多个实例的技巧在于 CATALINA\_HOME设置到Tomcat的安装目录。然后CATALINA\_BASE设置到到另一个你希望的JVM目录（关于这个，看到后面的具体 操作，只是在这个目录中，创建Conf的信息。然后创建相应的目录--log等。）  
     Linux命令  
       cp -a $CATALINA\_HOME/conf .  
       mkdir common logs temp server shared webapps work  
      （copy过来之后，需要在Conf文件夹中，修改端口号）  
    启动Tomcat脚本  
       #!/bin/sh  
       set CATALINA\_BASE="/opt/tomcat-instance/groovywigs.com"  
       set CATALINA\_HOME="/opt/tomcat"  
       export CATALINA\_BASE CATALINA\_HOME  
       service tomcat start          # Standard way to start on Linux

2 端口的是设置  
      这里主要是在linux系统下的设置。有时候80端口被其他用户使用，或者说没有你没有使用权限。iptables和jsvc两种法。其中jsvc是 tomcat提供的工具。具体看书P45.

3 JVM  
     在书P68页有张表。

4 JSP Compiler  
        Tomcat 5.5以上版本默认都是Eclipse JDT Compiler.  
        修改办法  
        1. Move Tomcat’s CATALINA\_HOME/common/lib/jasper-compiler-jdt.jar file so that it is not used in the common class loader.  
        2. Install Apache Ant’s ant.jar file into the common/lib/ directory. （这一点让我觉得有点奇怪。难道一定要装入ant?）  
        3. Add the JDK’s tools.jar file to the common class loader.

5 权限管理  
     没有细看.因为以后打算好好学Spring security