#分析文件lanmp.sh,在其头部引入了一系列的函数文件 . lib/common.conf . lib/common.sh . lib/mysql.sh . lib/apache.sh . lib/nginx.sh . lib/php.sh . lib/na.sh . lib/libiconv.sh . lib/eaccelerator.sh . lib/zend.sh . lib/pureftp.sh . lib/pcre.sh . lib/webconf.sh . lib/service.sh 首先分析 lib/common.conf # 定义的一些路径变量 #获取当前路径 IN_PWD=$(pwd) #当前路径下的源码 IN_SRC=${IN_PWD}/lanmp #日志路径 LOGPATH=${IN_PWD}/logs IN_DIR="/www/wdlinux" IN_DIR_ME=0 SERVER="apache" RE_INS=0 SOFT_DOWN=0 #软件的下载地址,可以看到具体的安装版本 HTTPD_DU="http://mirror.bjtu.edu.cn/apache/httpd/httpd-2.2.24.tar.gz" NGINX_DU="http://nginx.org/download/nginx-1.2.9.tar.gz" MYSQL_DU="http://cdn.mysql.com/Downloads/MySQL-5.1/mysql-5.1.69.tar.gz" PHP_DU="http://www.php.net/get/php-5.2.17.tar.gz/from/cn.php.net/mirror" PHP53_DU="http://tw2.php.net/distributions/php-5.3.29.tar.gz" PUREFTP_DU="http://download.pureftpd.org/pub/pure-ftpd/releases/pure-ftpd-1.0.36.tar.gz" EACCELERATOR_DU="http://bart.eaccelerator.net/source/0.9.6/eaccelerator-0.9.6.tar.bz2" ZEND_DU="http://downloads.zend.com/optimizer/3.3.3/ZendOptimizer-3.3.3-linux-glibc23-i386.tar.gz" ZENDX86_DU="http://downloads.zend.com/optimizer/3.3.3/ZendOptimizer-3.3.3-linux-glibc23-x86_64.tar.gz" PHP_FPM_DU="http://php-fpm.org/downloads/php-5.2.14-fpm-0.5.14.diff.gz" VSFTPD_DU="http://dl.wdlinux.cn:5180/vsftpd-2.2.2.tar.gz" PHPMYADMIN_DU="http://dl.wdlinux.cn:5180/phpMyAdmin-3.3.3-all-languages.tar.gz" PCRE_DU=" #定义的一系列软件版本 MYS_VER="5.1.69" NGI_VER="1.2.9" APA_VER="2.2.24" PHP_VER="5.2.17" PUR_VER="1.0.36" LIBICONV_VER="1.14" EACCE_VER="0.9.5.3" PCRE_VER="8.10" WDCP_VER="v2.5" #产生程序安装时的锁定文件 mysql_inf="/tmp/mysql_ins.txt" nginx_inf="/tmp/nginx_ins.txt" httpd_inf="/tmp/httpd_ins.txt" pureftp_inf="/tmp/pureftp_ins.txt" php_inf="/tmp/php_ins.txt" na_inf="/tmp/na_ins.txt" libiconv_inf="/tmp/libiconv_ins.txt" eac_inf="/tmp/eac_ins.txt" zend_inf="/tmp/zend_ins.txt" conf_inf="/tmp/conf_ins.txt" wdapache_inf="/tmp/wdapache_ins.txt" wdphp_inf="/tmp/wdphp_ins.txt" wdcp_inf="/tmp/wdcp_ins.txt" #定义一个判断操作系统的变量 OS_RL=1 #根据grep返回的结果,改变OS_RL的值 grep -qi ‘debian\|ubuntu‘ /etc/issue && OS_RL=2 if [ $OS_RL = 1 ]; then R6=0 grep -q ‘release 6‘ /etc/redhat-release && R6=1 fi #判断操作系统是32位后者64位 X86=0 if uname -m | grep -q ‘x86_64‘; then X86=1 fi #获取当前脚本的名称,并命名日志 command=$(basename $0) logpre=${command%%.sh}
时间: 2024-10-09 07:09:30