Alex刺客

          Dancing fingers, damage world. -- 舞動手指,破壞世界.

            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
            57 隨筆 :: 0 文章 :: 76 評論 :: 0 Trackbacks
          Configured Linux installation services tomcat6

          1. Installation Preparation.


          ?? ?a) download tomcat.

          ?? ??? ?......

          ?? ?b) copy to '/opt' directory.

          1?????????cp?apache-tomcat-6.0.29.tar.gz?/opt/

          ?? ?c) extract files.

          1?????????cd?/opt/
          2?????????tar?zxvf?apache-tomcat-6.0.29.tar.gz


          ?? ?d) rename.

          1?????????mv?apache-tomcat-6.0.29?tomcat6


          ?? ?e) Test whether you can run.

          1?????????cd?tomcat6/bin/
          2?????????./catalina.sh?run

          2. Installation commons-daemon-native
          (Reference)
          http://tomcat.apache.org/tomcat-7.0-doc/setup.html
          ???
          ??? a) extract files.
          ??? ??? 'commons-daemon-native' in the bin directory.
          ??? ???
          1?????????tar?xvfz?commons-deamon-native.tar.gz

          ??? b) configuration commons-daemon-native.
          ???
          1?????????cd?commons-daemon-1.0.2-native-src/unix
          2?????????./configure

          ??? c) compiled.

          1?????????make?#?Make?an?error?the?first?time.
          2?????????make?clean
          3?????????make?#?Once?again?make?compile?successfully.

          ??? d) copy 'jsvc' to 'bin' directory.
          1?????????cp?jsvc?../..

          3. Set the startup script.
          (Reference)?
          native/Tomcat5.sh
          http://hi.baidu.com/wallace_gong/blog/item/7b27c449ad74502d09f7ef83.html
          http://blog.csdn.net/luinstein/archive/2009/08/28/4493055.aspx

          ??? a) editing shell startup file tomcat5.
          1?????????cd?/etc/init.d/
          2?????????vim?tomcat6

          (Refer to the following document)
          #!/bin/sh
          #
          ?tomcat:?Start/Stop/Restart?tomcat
          #
          #
          ?chkconfig:?2345?85?15
          #
          ?description:?Apache?tomcat6

          #?Small?shell?script?to?show?how?to?start/stop?Tomcat?using?jsvc
          #
          ?If?you?want?to?have?Tomcat?running?on?port?80?please?modify?the?server.xml
          #
          ?file:
          #
          #
          ????<!--?Define?a?non-SSL?HTTP/1.1?Connector?on?port?80?-->
          #
          ????<Connector?className="org.apache.catalina.connector.http.HttpConnector"
          #
          ???????????????port="80"?minProcessors="5"?maxProcessors="75"
          #
          ???????????????enableLookups="true"?redirectPort="8443"
          #
          ???????????????acceptCount="10"?debug="0"?connectionTimeout="60000"/>
          #
          #
          JAVA_HOME=/usr/java/latest
          CATALINA_HOME=/opt/tomcat6
          DAEMON_HOME
          =$CATALINA_HOME/bin
          #?I?did?not?use?the?user.
          #
          TOMCAT_USER=tomcat

          #?for?multi?instances?adapt?those?lines.
          TMP_DIR=$CATALINA_HOME/tmp
          PID_FILE
          =/var/run/jsvc.pid
          CATALINA_BASE
          =$CATALINA_HOME
          .?
          /etc/rc.d/init.d/functions
          CATALINA_OPTS
          =
          CLASSPATH
          =\
          $JAVA_HOME
          /lib/tools.jar:\
          $CATALINA_HOME
          /bin/commons-daemon.jar:\
          $CATALINA_HOME
          /bin/bootstrap.jar

          start()?{
          ????echo?
          -n?$"Starting?Tomcat6:?"
          ????
          #?If?you?want?to?specify?a?user?to?run?Tomcat.
          ????#increase?the?'user?$?TOMCAT_USER?\'?to?the?parameter?list.
          ????$DAEMON_HOME/jsvc?\
          ????
          -home?$JAVA_HOME?\
          ????
          -Dcatalina.home=$CATALINA_HOME?\
          ????
          -Dcatalina.base=$CATALINA_BASE?\
          ????
          -Djava.io.tmpdir=$TMP_DIR?\
          ????
          -wait?10?\
          ????
          -pidfile?$PID_FILE?\
          ????
          -outfile?$CATALINA_HOME/logs/catalina.out?\
          ????
          -errfile?'&1'?\
          ????$CATALINA_OPTS?\
          ????
          -cp?$CLASSPATH?\
          ????org.apache.catalina.startup.Bootstrap
          }

          stop()?{
          ????echo?
          -n?$"Stopping?Tomcat6:?"
          ????
          #
          ????$DAEMON_HOME/jsvc?\
          ????
          -stop?\
          ????
          -pidfile?$PID_FILE?\
          ????org.apache.catalina.startup.Bootstrap
          }

          status()?{
          ?????ps?ax?
          --width=1000?|?grep?"[o]rg.apache.catalina.startup.Bootstrap"?|?awk?'{printf?$1?"?"}'?|?wc?|?awk?'{print?$2}'?>/tmp/tomcat_process_count.txt
          ?????read?line?
          <?/tmp/tomcat_process_count.txt
          ?????
          if?[?$line?-gt?0?];?then
          ???????echo?
          -n?"tomcat6?(?pid?"
          ???????ps?ax?
          --width=1000?|?grep?"[o]rg.apache.catalina.startup.Bootstrap"?|?awk?'{printf?$1?"?"}'
          ???????echo?
          ")?is?running"
          ?????
          else
          ???????echo?
          "Tomcat6?is?stopped"
          ?????fi
          }

          case?
          "$1"?in
          ??start)
          ????
          #?Start?Tomcat
          ????start
          ????exit?$?
          ????;;

          ??stop)
          ????
          #?Stop?Tomcat
          ????stop
          ????exit?$?
          ????;;
          ??restart)
          ????
          #?Restart?Tomcat
          ????stop
          ????sleep?
          3
          ????start
          ????exit?$?
          ????;;
          ???status)
          ????status
          ????exit?$?
          ????;;
          ??
          *)
          ????echo?
          "Usage:?tomcat6?{start|stop|restart|status}"
          ????exit?
          1;;
          esac


          4. Added to the system service
          1?????chkconfig?--add?tomcat6
          2?????chkconfig?--list?|?grep?tomcat6
          3?????tomcat6????????????0:off????1:off????2:on????3:on????4:on????5:on????6:off


          5. Start and Stop for tomcat service.

          [root@localhost?init.d]
          #?service?tomcat6?start
          Starting?Tomcat?
          [root@localhost?init.d]
          #?service?tomcat6?status
          tomcat?(?pid?8024?8025?)?is?running
          [root@localhost?init.d]
          #?service?tomcat6?stop
          Stopping?Tomcat?
          [root@localhost?init.d]
          #?service?tomcat6?status
          Tomcat?is?stopped
          [root@localhost?init.d]
          #?

          最近對英文產生了莫明其妙的好感 -- 嘿嘿.
          ?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? author: alex刺客
          溫馨提示: 轉載請保留此文檔地址.
          Tips: Reprinted Please keep this document URL.
          posted on 2010-10-27 19:08 Alex刺客 閱讀(1746) 評論(0)  編輯  收藏 所屬分類: Linux
          主站蜘蛛池模板: 巫溪县| 蓝山县| 磐石市| 雷波县| 马龙县| 长丰县| 三江| 宿松县| 锦屏县| 博野县| 锡林浩特市| 清镇市| 松桃| 阿坝| 中超| 旬邑县| 广东省| 南雄市| 玉环县| 离岛区| 辽中县| 古丈县| 瓦房店市| 松原市| 西城区| 若尔盖县| 大田县| 正宁县| 庐江县| 延长县| 榆社县| 渝北区| 同江市| 弋阳县| 金沙县| 任丘市| 淮南市| 贵定县| 易门县| 琼结县| 乃东县|