Linux下安装Tomcat5.5,并进行优化


1. 安装JDK1.5  (Tomcat5.5必须要JDK1.5以上版本)
1)下载RPM包或bin包
2)安装步骤
  a. 如果是bin包,需要 chmod 777  jdk-1_5_0_12-linux-i586-rpm.bin
     然后执行  ./jdk-1_5_0_12-linux-i586-rpm.bin
  b. 软件自动安装到 /usr/java/jdk1.5.0_12
  c. vi ~/.bash_profile
     在PATH后面添加:/usr/java/jdk1.5.0_12/bin

2.安装Tomcat5.5
1)下载源码包  apache-tomcat-5.5.23.tar.gz
   下载地址:http://tomcat.apache.org
2)安装步骤
   a. tar zxvf apache-tomcat-5.5.23.tar.gz /usr/local/tomcat1
      tar zxvf apache-tomcat-5.5.23.tar.gz /usr/local/tomcat2
   b. 修改  bin/catalina.sh
      JAVA_HOME=/usr/java/jdk1.5.0_12
      JAVA_OPTS=' -Xms256m -Xmx512m -XX:PermSize=512M -XX:MaxPermSize=512m '  

     window下的写法:
    set JAVA_OPTS=%JAVA_OPTS% -Xms256m -Xmx512m -XX:PermSize=512M -XX:MaxPermSize=512m
3)起停
  /usr/local/tomcat1/bin/startup.sh|shutdown.sh

3.安装Tomcat-Native连接APR,提高静态资源的访问性能
1)下载软件包  tomcat-native-1.1.10-src.tar.gz
   下载地址:http://archive.apache.org/dist/tomcat/tomcat-connectors/native/
2)apr和apr-util的安装参考Linux下Apache和Apr整合,提高Apache性能
2)安装步骤
   a. tar zxvf tomcat-native-1.1.10-src.tar.gz
   b. cd /tomcat-native-1.1.10-src/jni/native
   c. ./configure --prefix=/usr/local/apache2/apr --with-apr=/usr/local/apache2/apr --with-java-home=/usr/java/jdk1.5.0_12
   d. make
   e. make install
   f. 修改  bin/catalina.sh 添加 CATALINA_OPTS=' -Djava.library.path=/usr/local/apache2/apr '

你可能感兴趣的:(java,apache,tomcat,linux,jni)