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 礼物 阅读(1124) 评论(0)  编辑  收藏 所属分类: Linux