SmileFace
          與java一起走過的日子
          posts - 41,  comments - 8,  trackbacks - 0
          I planned to install Roller in my centOS which need tomcat6. But centos5.3 has tomcat5 in it's yum. So I have to install tomcat6 using other way. I searched and found this good install guide in:
               http://cloudservers.mosso.com/index.php/CentOS_-_Tomcat_6 ( or http://de0ris.blogspot.com/2008/08/installing-tomcat-6x-on-centos-5.html )
          which give detail instructions. I choose some important part and paste here in case for late use.

          1.  install appache ant:  (note: download and put the tar file in /usr/share first )
             tar -xzf apache-ant-1.7.1-bin.tar.gz



          2. install tomcat:(note: download and put the tar file in /usr/share first )



          tar -xzf apache-tomcat-6.0.18.tar.gz

          3.  create a symbolic link for Ant so other applications can easily find it. Be sure to select the correct version when you create your link.
          ln -s /usr/share/apache-ant-1.7.1/bin/ant /usr/bin

          4. set JAVA_HOME:
          cd /usr/share/apache-tomcat-6.0.18/bin

          vi catalina.sh

          enter insert mode. Enter the following:

          JAVA_HOME=/usr/java/jdk1.6.0_14

          Test:
          cd /usr/share/apache-tomcat-6.0.18/bin

          ./startup.sh

          5.Automating atartup:   Right now Tomcat will not start up on it's own so we need to create a startup script for this. To do this:
          cd /etc/init.d

          vi tomcat

          Press i to enter insert mode and paste in the following:

          #!/bin/bash

          # chkconfig: 234 20 80

          # description: Tomcat Server basic start/shutdown script

          # processname: tomcat

          JAVA_HOME=/usr/java/jdk1.6.0_14

          export JAVA_HOME

          TOMCAT_HOME=/usr/share/apache-tomcat-6.0.18/bin

          START_TOMCAT=/usr/share/apache-tomcat-6.0.18/bin/startup.sh

          STOP_TOMCAT=/usr/share/apache-tomcat-6.0.18/bin/shutdown.sh

          start() {

          echo -n "Starting tomcat: "

          cd $TOMCAT_HOME

          ${START_TOMCAT}

          echo "done."

          }

          stop() {

          echo -n "Shutting down tomcat: "

          cd $TOMCAT_HOME

          ${STOP_TOMCAT}

          echo "done."

          }

          case "$1" in

          start)

          start

          ;;

          stop)

          stop

          ;;

          restart)

          stop

          sleep 10

          start

          ;;

          *)

          echo "Usage: $0 {start|stop|restart}"

          esac

          exit 0

          Be sure to change the following items in the above file:

          * JAVA_HOME path

          * TOMCAT_HOME path

          * START_TOMCAT path

          * STOP_TOMCAT path

          Once you have those changes made, save the file and quit.

          Now we need to change the permissions on the file.

          chmod 755 tomcat

          We need to set the script to start with other system services and set the runlevels.

          chkconfig --add tomcat

          chkconfig --level 234 tomcat on

          You can verify that it is listed by typing chkconfig --list tomcat.

          tomcat         	0:off	1:off	2:on	3:on	4:on	5:off	6:off

          Test your shutdown and startup script.

          sudo /sbin/service tomcat stop

          sudo /sbin/service tomcat start

          Tomcat 6 should now be installed under CentOS.

              



          posted on 2009-08-20 13:12 SmileFace 閱讀(706) 評論(0)  編輯  收藏 所屬分類: Linux

          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導(dǎo)航:
           

          <2009年8月>
          2627282930311
          2345678
          9101112131415
          16171819202122
          23242526272829
          303112345

          常用鏈接

          留言簿(2)

          隨筆分類

          隨筆檔案

          文章檔案

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 泰兴市| 屏南县| 盐边县| 芷江| 贺兰县| 洛浦县| 吉水县| 绥德县| 温宿县| 晋江市| 谷城县| 原阳县| 黄大仙区| 张北县| 邯郸市| 满城县| 泊头市| 民丰县| 库尔勒市| 西吉县| 武穴市| 福清市| 务川| 吉安县| 南皮县| 湖北省| 沅江市| 沈阳市| 铜川市| 奉贤区| 卓资县| 苏尼特右旗| 巴里| 济宁市| 南木林县| 绥棱县| 长宁区| 泸溪县| 鹤峰县| 呈贡县| 余庆县|