wiki:waue/2009/0806

Version 5 (modified by waue, 15 years ago) (diff)

--

JSP 筆記

一、安裝

1.1 安裝

  • 大部分的使用者都不建議用apt-get 安裝tomcat 因此建議用tarball方式解壓縮
  • 下載 tomcat 6.0.20 2009/08/06
  • 安裝
    sudo mv ~/Desktop/apache-tomcat-6*.gz /opt/
    cd /opt
    sudo tar -zxvf apache-tomcat-6*.gz
    sudo mv apache-tomcat-6* tomcat
    sudo chown -R `whoami`:`whoami` tomcat
    

1.2 bootstrap

cd /opt/tomcat/bin
tar xvfz jsvc.tar.gz
cd jsvc-src
autoconf
./configure
make
cp jsvc ..
cd /opt/tomcat/
./bin/jsvc -cp ./bin/bootstrap.jar -outfile ./logs/catalina.out -errfile ./logs/catalina.err org.apache.catalina.startup.Bootstrap

1.3 啟動停止tomcat

  • 建立 /etc/init.d/tomcat ,內容為:
    #! /bin/sh
    
    PATH=$PATH:/opt/tomcat/bin
    do_start () {
      /opt/tomcat/bin/startup.sh
    }
    
    do_stop () {
      /opt/tomcat/bin/shutdown.sh
    }
    case "$1" in
      start)
      do_start
      ;;
      restart|reload|force-reload)
      do_stop
      do_start
      ;;
      stop)
      do_stop
      ;;
      *)
      echo "Usage: $0 start|stop" >&2
      exit 3
      ;;
    esac
    

二、