apache自动安装的小脚本
每次部署服务器时都需要手动执行一些脚本,麻烦,而且也不规范。以下小脚本可以比较统一的部署服务器,部署出来的服务器不会出现什么大的差异。以下脚本包括了编辑安装,启动服务,测试服务是否正常运行等。挺简陋的,希望大家给于补充。
###########################################
#!/bin/bash
#write by eben 2010 7 1
#this shell is a test doc.
#mail:zytao321@163.com
#QQ:85035516
#MSN:jackey8289@hotmail.com
############################################
APP="/Data/app";
SOF=/Data/software
HTTP=httpd-2.2.11
cd $SOF ;
tar -zxf $HTTP".tar.gz"
cd $SOF/$HTTP ;
#System version is X64 do this.
SYS=`uname -a|grep 64|wc -l`
if (($SYS==1))
then
sed -i 's/256/2560/g' $SOF/$HTTP/include/http_config.h
fi
#编辑 apache 环境变量
./configure --prefix=$APP/$HTTP --enable-so --enable-rewrite --enable-info --enable-cgid --enable-mime-magic --enable-vhost-alias --enable-deflate --enable-expires --with-mpm=prefork --enable-proxy --enable-cache --enable-mem-cache --enable-ssl --enable-thread-safe-client --enable-lib64 -libdir=/usr/lib64 && make && make install
$APP/$HTTP/bin/apachectl start
#test apache alive
x=(`ps -ef|grep httpd|wc -l`)
if (( $x>1 ))
OK="apache is starting"
BAD="apache is not successful,please make sure"
then echo "$OK";
else echo $BAD
fi
页:
[1]