Apache+tomcat脚本快速安装(最新版本)

#!/bin/sh
#############2013-01-08###########
yum install openssl* -y
DIR=/usr/local/src/
###########wget#################
cd $DIR
wget http://apache.dataguru.cn//httpd/httpd-2.4.3.tar.gz
wget http://mirror.bit.edu.cn/apache/apr/apr-util-1.4.1.tar.gz
wget http://mirror.bit.edu.cn/apache/apr/apr-1.4.6.tar.gz
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.31.tar.gz
cd $DIR
##########install apr############
tar -zxvf apr-1.4.6.tar.gz;
cd $DIR/apr-1.4.6;
sed -i '/$RM "$cfgfile"/s/^/#/'  /usr/local/src/apr-1.4.6/configure ;
./configure --prefix=/usr/local/apr/ ;
make && make install;
##########install pcre#############
cd $DIR
tar zxvf pcre-8.31.tar.gz;
cd $DIR/pcre-8.31;
./configure --prefix=/usr/local/pcre ;
make && make install;
###########install Apache###########
cd $DIR;
tar zxf httpd-2.4.3.tar.gz ;
rm -rf $DIR/apr-1.4.6;
rm -rf $DIR/apr-util-1.4.1  ;
tar -zxvf $DIR/apr-1.4.6.tar.gz ;
tar -zxvf $DIR/apr-util-1.4.1.tar.gz  ;
mv  $DIR/apr-1.4.6 $DIR/httpd-2.4.3/srclib/apr  ;
mv   $DIR/apr-util-1.4.1 $DIR/httpd-2.4.3/srclib/apr-util;
cd /usr/local/src/httpd-2.4.3  ;
./configure --prefix=/usr/local/apache --enable-so  --enable-deflate=shared --enable-ssl=shared --enable-expires=shared --enable-deflate=shared --enable-ssl=shared --enable-expires=shared --enable-headers=shared --enable-rewrite=shared --enable-static-support --with-included-apr --with-mpm=prefork --enable-cache --enable-file-cache --with-pcre=/usr/local/pcre --with-lnduded-apr --with-included-apr --enable-rewrite=shared;
make && make install;
###############install Tomcat#############
cd $DIR
wget http://www.apache.org/dist/tomcat/tomcat-7/v7.0.34/src/apache-tomcat-7.0.34-src.tar.gz;
wget http://www.apache.org/dist/tomcat/tomcat-connectors/jk/tomcat-connectors-1.2.37-src.tar.gz;
tar -zxvf tomcat-connectors-1.2.37-src.tar.gz
cd $DIR/tomcat-connectors-1.2.37-src/native;
./configure --with-apxs=/usr/local/apache/bin/apxs;
make ;
cp ./apache-2.0/mod_jk.so /usr/local/apache/modules/  ;
cd $DIR ;
tar -zxvf apache-tomcat-7.0.34-src.tar.gz ;
mv apache-tomcat-7.0.34 /usr/local/tomcat/
#####################cp##################################
cp /root/workers.properties  /usr/local/apache/conf/extra/
cp /root/mod_jk.conf         /usr/local/apache/conf/extra/

猜你喜欢

转载自7shao.iteye.com/blog/1770592
今日推荐