Terry.Li-彬

          虛其心,可解天下之問;專其心,可治天下之學;靜其心,可悟天下之理;恒其心,可成天下之業。

            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
            143 隨筆 :: 344 文章 :: 130 評論 :: 0 Trackbacks
          https://github.com/fly2wind/TSShellScript

          #!/bin/sh
          ########################################################################################
          #
          # Install Ejabberd Server
          #
          # Shawn Ma
          #
          ########################################################################################
          # Define
          TARGET=apache-tomcat-7.0.34.tar.gz
          SOURCE=http://mirror.bjtu.edu.cn/apache/tomcat/tomcat-7/v7.0.34/bin/$TARGET

          # Create a build directory
          mkdir -p /opt/install/tomcat && cd /opt/install/tomcat

          # Prepare for compilation source
          curl -o $TARGET $SOURCE
          mkdir -p tmp && tar -zxvf $TARGET -C tmp

          # Install build dependencies
          yum install -y gcc gcc-c++ make cmake autoconf automake
          yum install -y apr-devel openssl-devel

          # Create a User Group
          groupadd tomcat
          useradd -r -g tomcat tomcat

          # Compile and deploy
          mkdir -p /opt/server/web && mv tmp/* /opt/server/web/tomcat && cd /opt/server/web/tomcat/bin
          tar -zxvf tomcat-native.tar.gz && cd tomcat-native-1.1.24-src/jni/native/
          ./configure \
          --with-apr=/usr/bin/apr-1-config \
          --with-java-home=/opt/environment/java/1.7.0 \
          --with-ssl=yes \
          --prefix=/opt/server/web/tomcat
          make
          make install

          cd /opt/server/web/tomcat
          curl -o conf/server.xml https://raw.github.com/fly2wind/TSShellScript/master/tomcat/conf/server.xml
          curl -o conf/tomcat-users.xml https://raw.github.com/fly2wind/TSShellScript/master/tomcat/conf/tomcat-users.xml
          curl -o conf/wrapper.conf https://raw.github.com/fly2wind/TSShellScript/master/tomcat/wrapper/wrapper.conf
          curl -o lib/wrapper.jar https://raw.github.com/fly2wind/TSShellScript/master/tomcat/wrapper/wrapper.jar
          curl -o lib/wrapper.so https://raw.github.com/fly2wind/TSShellScript/master/tomcat/wrapper/libwrapper.so
          curl -o bin/tomcat https://raw.github.com/fly2wind/TSShellScript/master/tomcat/wrapper/tomcat

          # Postinstallation setup
          cd /opt/server/web/tomcat
          chown -R tomcat .
          chgrp -R tomcat .
          chown -R root .
          chown -R tomcat conf webapps work temp logs

          # Configuration
          curl -o /etc/init.d/tomcat https://raw.github.com/fly2wind/TSShellScript/master/tomcat/init/tomcat
          chmod a+x /etc/init.d/tomcat

          # Additional
          chkconfig --add tomcat
          chkconfig tomcat on

          posted on 2013-01-09 15:01 禮物 閱讀(1145) 評論(0)  編輯  收藏 所屬分類: Linux
          主站蜘蛛池模板: 湘潭县| 淄博市| 万源市| 长子县| 闽侯县| 额尔古纳市| 凭祥市| 永和县| 邢台县| 盐亭县| 普格县| 瓦房店市| 封丘县| 丰城市| 金门县| 遵化市| 中西区| 长寿区| 专栏| 唐河县| 锡林郭勒盟| 栾川县| 安康市| 武乡县| 安阳市| 金门县| 澄江县| 榆林市| 鲜城| 南城县| 沁源县| 景东| 沅江市| 德保县| 乐都县| 阿城市| 祁阳县| 磐石市| 兰溪市| 睢宁县| 平舆县|