1.tomcat可以配置多個實例,可以為每一個實例定義一個$CATALINA_BASE
如果tomcat只有一個$CATALINA_BASE 和$CATALINA_HOME 一樣
說明(網上資料):CATALINA_HOME是Tomcat的安裝目錄,CATALINA_BASE是Tomcat的工作目錄。
如果我們想要運行Tomcat的多個實例,但是不想安裝多個Tomcat軟件副本。
那么我們可以配置多個工作目錄,每個運行實例獨占一個工作目錄,但是共享同一個安裝目錄。
Tomcat每個運行實例需要使用自己的conf、logs、temp、webapps、work和shared目錄,
因此CATALINA_BASE就指向這些目錄。而其他目錄主要包括了Tomcat的二進制文件和腳本,
CATALINA_HOME就指向這些目錄。
如果我們希望再運行另一個Tomcat實例,那么我們可以建立一個目錄,
把conf、logs、temp、webapps、work和shared拷貝到該目錄下,然后讓CATALINA_BASE指向該目錄即可
2.英語學習:There's nothing like scouring the web only to find out that the answer was right in front of you all along!
就像搜索網頁一樣,在你面前的正確答案始終沒有
3.
--unix Daemon--
Tomcat can be run as a daemon using the jsvc tool from the commons-daemon project
./configure --with-java=/usr/java
命令腳本:
Please note that you should use the GNU make (gmake) instead of the native BSD make on FreeBSD systems
cd $CATALINA_HOME/bin
tar xvfz commons-daemon-native.tar.gz
cd commons-daemon-1.0.x-native-src/unix
./configure
make
cp jsvc ../..
cd ../..
Tomcat can then be run as a daemon using the following commands.
cd $CATALINA_HOME
./bin/jsvc -cp ./bin/bootstrap.jar:./bin/tomcat-juli.jar \
-outfile ./logs/catalina.out -errfile ./logs/catalina.err \
org.apache.catalina.startup.Bootstrap
You may also need to specify -jvm server if the JVM defaults to using a server VM rather than a client VM. This has been observed on OSX
(最好指定使用服務器虛擬機-Server JVM)
jsvc可以加一些參數執行
4./etc/init.d 可以編輯使得tomcat自動啟動