Bläddra i källkod

Del openssl.conf

lj2007331@gmail.com 7 år sedan
förälder
incheckning
f8c83a116b

+ 0 - 1
include/apache-2.2.sh

@@ -32,7 +32,6 @@ Install_Apache22() {
   [ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=${apache_install_dir}/bin:\$PATH" >> /etc/profile
   [ -n "`grep ^'export PATH=' /etc/profile`" -a -z "`grep ${apache_install_dir} /etc/profile`" ] && sed -i "s@^export PATH=\(.*\)@export PATH=${apache_install_dir}/bin:\1@" /etc/profile
   . /etc/profile
-  sed -i "s@^export LD_LIBRARY_PATH.*@export LD_LIBRARY_PATH=${openssl_install_dir}/lib:\$LD_LIBRARY_PATH@" ${apache_install_dir}/bin/envvars
   /bin/cp ${apache_install_dir}/bin/apachectl /etc/init.d/httpd
   sed -i '2a # chkconfig: - 85 15' /etc/init.d/httpd
   sed -i '3a # description: Apache is a World Wide Web server. It is used to serve' /etc/init.d/httpd

+ 3 - 3
include/apache-2.4.sh

@@ -28,7 +28,8 @@ Install_Apache24() {
     ./configure
     make -j ${THREAD} && make install
     popd
-    echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf; ldconfig
+    [ -z "`grep /usr/local/lib /etc/ld.so.conf.d/*.conf`" ] && echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf
+    ldconfig
     rm -rf nghttp2-${nghttp2_ver}
   fi
 
@@ -37,7 +38,7 @@ Install_Apache24() {
   /bin/cp -R ../apr-${apr_ver} ./srclib/apr
   /bin/cp -R ../apr-util-${apr_util_ver} ./srclib/apr-util
   [[ "${php_option}" =~ ^[1-4]$ ]] && Apache_mpm_arg='--with-mpm=prefork'
-  LDFLAGS=-ldl LD_LIBRARY_PATH=${openssl_install_dir}/lib ./configure --prefix=${apache_install_dir} ${Apache_mpm_arg} --enable-mpms-shared=all --with-included-apr --enable-headers --enable-deflate --enable-so --enable-dav --enable-rewrite --enable-ssl --with-ssl=${openssl_install_dir} --enable-http2 --with-nghttp2=/usr/local --enable-expires --enable-static-support --enable-suexec --enable-modules=all --enable-mods-shared=all
+  LDFLAGS=-ldl ./configure --prefix=${apache_install_dir} ${Apache_mpm_arg} --enable-mpms-shared=all --with-included-apr --enable-headers --enable-deflate --enable-so --enable-dav --enable-rewrite --enable-ssl --with-ssl=${openssl_install_dir} --enable-http2 --with-nghttp2=/usr/local --enable-expires --enable-static-support --enable-suexec --enable-modules=all --enable-mods-shared=all
   make -j ${THREAD} && make install
   unset LDFLAGS
   if [ -e "${apache_install_dir}/conf/httpd.conf" ]; then
@@ -54,7 +55,6 @@ Install_Apache24() {
   [ -n "`grep ^'export PATH=' /etc/profile`" -a -z "`grep ${apache_install_dir} /etc/profile`" ] && sed -i "s@^export PATH=\(.*\)@export PATH=${apache_install_dir}/bin:\1@" /etc/profile
   . /etc/profile
 
-  sed -i "s@^export LD_LIBRARY_PATH.*@export LD_LIBRARY_PATH=${openssl_install_dir}/lib:\$LD_LIBRARY_PATH@" ${apache_install_dir}/bin/envvars
   /bin/cp ${apache_install_dir}/bin/apachectl /etc/init.d/httpd
   sed -i '2a # chkconfig: - 85 15' /etc/init.d/httpd
   sed -i '3a # description: Apache is a World Wide Web server. It is used to serve' /etc/init.d/httpd

+ 1 - 1
include/boost.sh

@@ -19,7 +19,7 @@ installBoost() {
     popd
   fi
   if [ -e "/usr/local/lib/libboost_system.so" ]; then
-    echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf
+    [ -z "`grep /usr/local/lib /etc/ld.so.conf.d/*.conf`" ] && echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf
     ldconfig
     echo "${CSUCCESS}Boost installed successfully! ${CEND}"
     rm -rf boost_${boostVersion2}

+ 1 - 1
include/jemalloc.sh

@@ -23,7 +23,7 @@ Install_Jemalloc() {
       else
         ln -s /usr/local/lib/libjemalloc.so.2 /usr/lib/libjemalloc.so.1
       fi
-      echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf
+      [ -z "`grep /usr/local/lib /etc/ld.so.conf.d/*.conf`" ] && echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf
       ldconfig
       echo "${CSUCCESS}jemalloc module installed successfully! ${CEND}"
       rm -rf jemalloc-${jemalloc_ver}

+ 3 - 5
include/openssl.sh

@@ -10,19 +10,17 @@
 
 Install_openSSL102() {
   if [ ! -e "${openssl_install_dir}/lib/libcrypto.a" ]; then
-    # install openssl-1.0.2
     pushd ${oneinstack_dir}/src > /dev/null
     tar xzf openssl-${openssl_ver}.tar.gz
     pushd openssl-${openssl_ver}
     make clean
-    ./config --prefix=${openssl_install_dir} -fPIC shared zlib-dynamic
+    ./config -fPIC --prefix=${openssl_install_dir} --openssldir=${openssl_install_dir}
+    make depend
     make -j ${THREAD} && make install
     popd
     if [ -f "${openssl_install_dir}/lib/libcrypto.a" ]; then
       echo "${CSUCCESS}openssl-1.0.2 module installed successfully! ${CEND}"
-      /bin/cp cacert.pem ${openssl_install_dir}/ssl/cert.pem
-      echo "${openssl_install_dir}/lib" > /etc/ld.so.conf.d/openssl.conf
-      ldconfig
+      /bin/cp cacert.pem ${openssl_install_dir}/cacert.pem
       rm -rf openssl-${openssl_ver}
     else
       echo "${CFAILURE}openssl-1.0.2 install failed, Please contact the author! ${CEND}"

+ 1 - 1
include/php-5.3.sh

@@ -51,7 +51,7 @@ Install_PHP53() {
     rm -rf mhash-${mhash_ver}
   fi
 
-  echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf
+  [ -z "`grep /usr/local/lib /etc/ld.so.conf.d/*.conf`" ] && echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf
   ldconfig
   [ "$OS" == 'CentOS' ] && { ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config; [ "${OS_BIT}" == '64' ] && ln -s /lib64/libpcre.so.0.0.1 /lib64/libpcre.so.1 || ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1; }
 

+ 1 - 1
include/php-5.4.sh

@@ -51,7 +51,7 @@ Install_PHP54() {
     rm -rf mhash-${mhash_ver}
   fi
 
-  echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf
+  [ -z "`grep /usr/local/lib /etc/ld.so.conf.d/*.conf`" ] && echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf
   ldconfig
   [ "$OS" == 'CentOS' ] && { ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config; [ "${OS_BIT}" == '64' ] && ln -s /lib64/libpcre.so.0.0.1 /lib64/libpcre.so.1 || ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1; }
 

+ 1 - 1
include/php-5.5.sh

@@ -51,7 +51,7 @@ Install_PHP55() {
     rm -rf mhash-${mhash_ver}
   fi
 
-  echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf
+  [ -z "`grep /usr/local/lib /etc/ld.so.conf.d/*.conf`" ] && echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf
   ldconfig
   [ "$OS" == 'CentOS' ] && { ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config; [ "${OS_BIT}" == '64' ] && ln -s /lib64/libpcre.so.0.0.1 /lib64/libpcre.so.1 || ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1; }
 

+ 1 - 1
include/php-5.6.sh

@@ -51,7 +51,7 @@ Install_PHP56() {
     rm -rf mhash-${mhash_ver}
   fi
 
-  echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf
+  [ -z "`grep /usr/local/lib /etc/ld.so.conf.d/*.conf`" ] && echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf
   ldconfig
   [ "$OS" == 'CentOS' ] && { ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config; [ "${OS_BIT}" == '64' ] && ln -s /lib64/libpcre.so.0.0.1 /lib64/libpcre.so.1 || ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1; }
 

+ 1 - 1
include/php-7.0.sh

@@ -51,7 +51,7 @@ Install_PHP70() {
     rm -rf mhash-${mhash_ver}
   fi
 
-  echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf
+  [ -z "`grep /usr/local/lib /etc/ld.so.conf.d/*.conf`" ] && echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf
   ldconfig
   [ "$OS" == 'CentOS' ] && { ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config; [ "${OS_BIT}" == '64' ] && ln -s /lib64/libpcre.so.0.0.1 /lib64/libpcre.so.1 || ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1; }
 

+ 1 - 1
include/php-7.1.sh

@@ -51,7 +51,7 @@ Install_PHP71() {
     rm -rf mhash-${mhash_ver}
   fi
 
-  echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf
+  [ -z "`grep /usr/local/lib /etc/ld.so.conf.d/*.conf`" ] && echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf
   ldconfig
   [ "$OS" == 'CentOS' ] && { ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config; [ "${OS_BIT}" == '64' ] && ln -s /lib64/libpcre.so.0.0.1 /lib64/libpcre.so.1 || ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1; }
 

+ 1 - 1
include/php-7.2.sh

@@ -55,7 +55,7 @@ Install_PHP72() {
     rm -rf mhash-${mhash_ver}
   fi
 
-  echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf
+  [ -z "`grep /usr/local/lib /etc/ld.so.conf.d/*.conf`" ] && echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf
   ldconfig
   [ "$OS" == 'CentOS' ] && { [ "${OS_BIT}" == '64' ] && ln -s /lib64/libpcre.so.0.0.1 /lib64/libpcre.so.1 || ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1; }
 

+ 1 - 2
include/upgrade_oneinstack.sh

@@ -12,8 +12,7 @@ Upgrade_OneinStack() {
   pushd ${oneinstack_dir} > /dev/null
   Latest_OneinStack_MD5=$(curl -s http://mirrors.linuxeye.com/md5sum.txt | grep oneinstack.tar.gz | awk '{print $1}')
   [ ! -e install.sh ] && install_flag=n
-  #[ -e /etc/ld.so.conf.d/*openssl.conf ] && { /bin/mv /etc/ld.so.conf.d/{openssl.conf,z_openssl.conf}; ldconfig; }
-  if [ "$oneinstack_md5" != "$Latest_OneinStack_MD5" ]; then
+  if [ "${oneinstack_md5}" != "${Latest_OneinStack_MD5}" ]; then
     /bin/mv options.conf /tmp
     sed -i '/oneinstack_dir=/d' /tmp/options.conf
     [ -e /tmp/oneinstack.tar.gz ] && rm -rf /tmp/oneinstack.tar.gz

+ 76 - 76
include/upgrade_web.sh

@@ -10,24 +10,24 @@
 
 Upgrade_Nginx() {
   pushd ${oneinstack_dir}/src > /dev/null
-  [ ! -e "$nginx_install_dir/sbin/nginx" ] && echo "${CWARNING}Nginx is not installed on your system! ${CEND}" && exit 1
-  OLD_nginx_ver_tmp=`$nginx_install_dir/sbin/nginx -v 2>&1`
+  [ ! -e "${nginx_install_dir}/sbin/nginx" ] && echo "${CWARNING}Nginx is not installed on your system! ${CEND}" && exit 1
+  OLD_nginx_ver_tmp=`${nginx_install_dir}/sbin/nginx -v 2>&1`
   OLD_nginx_ver=${OLD_nginx_ver_tmp##*/}
   Latest_nginx_ver=`curl -s http://nginx.org/en/CHANGES-1.12 | awk '/Changes with nginx/{print$0}' | awk '{print $4}' | head -1`
-  [ -z "$Latest_nginx_ver" ] && Latest_nginx_ver=`curl -s http://nginx.org/en/CHANGES | awk '/Changes with nginx/{print$0}' | awk '{print $4}' | head -1`
+  [ -z "${Latest_nginx_ver}" ] && Latest_nginx_ver=`curl -s http://nginx.org/en/CHANGES | awk '/Changes with nginx/{print$0}' | awk '{print $4}' | head -1`
   echo
-  echo "Current Nginx Version: ${CMSG}$OLD_nginx_ver${CEND}"
+  echo "Current Nginx Version: ${CMSG}${OLD_nginx_ver}${CEND}"
   while :; do echo
-    read -p "Please input upgrade Nginx Version(default: $Latest_nginx_ver): " NEW_nginx_ver
-    [ -z "$NEW_nginx_ver" ] && NEW_nginx_ver=$Latest_nginx_ver
-    if [ "$NEW_nginx_ver" != "$OLD_nginx_ver" ]; then
-      [ ! -e "nginx-$NEW_nginx_ver.tar.gz" ] && wget --no-check-certificate -c http://nginx.org/download/nginx-$NEW_nginx_ver.tar.gz > /dev/null 2>&1
-      if [ -e "nginx-$NEW_nginx_ver.tar.gz" ]; then
-        src_url=https://www.openssl.org/source/openssl-$openssl_ver.tar.gz && Download_src
-        src_url=http://mirrors.linuxeye.com/oneinstack/src/pcre-$pcre_ver.tar.gz && Download_src
-        tar xzf openssl-$openssl_ver.tar.gz
-        tar xzf pcre-$pcre_ver.tar.gz
-        echo "Download [${CMSG}nginx-$NEW_nginx_ver.tar.gz${CEND}] successfully! "
+    read -p "Please input upgrade Nginx Version(default: ${Latest_nginx_ver}): " NEW_nginx_ver
+    [ -z "${NEW_nginx_ver}" ] && NEW_nginx_ver=${Latest_nginx_ver}
+    if [ "${NEW_nginx_ver}" != "${OLD_nginx_ver}" ]; then
+      [ ! -e "nginx-${NEW_nginx_ver}.tar.gz" ] && wget --no-check-certificate -c http://nginx.org/download/nginx-${NEW_nginx_ver}.tar.gz > /dev/null 2>&1
+      if [ -e "nginx-${NEW_nginx_ver}.tar.gz" ]; then
+        src_url=https://www.openssl.org/source/openssl-${openssl_ver}.tar.gz && Download_src
+        src_url=http://mirrors.linuxeye.com/oneinstack/src/pcre-${pcre_ver}.tar.gz && Download_src
+        tar xzf openssl-${openssl_ver}.tar.gz
+        tar xzf pcre-${pcre_ver}.tar.gz
+        echo "Download [${CMSG}nginx-${NEW_nginx_ver}.tar.gz${CEND}] successfully! "
         break
       else
         echo "${CWARNING}Nginx version does not exist! ${CEND}"
@@ -37,28 +37,28 @@ Upgrade_Nginx() {
     fi
   done
 
-  if [ -e "nginx-$NEW_nginx_ver.tar.gz" ]; then
-    echo "[${CMSG}nginx-$NEW_nginx_ver.tar.gz${CEND}] found"
+  if [ -e "nginx-${NEW_nginx_ver}.tar.gz" ]; then
+    echo "[${CMSG}nginx-${NEW_nginx_ver}.tar.gz${CEND}] found"
     echo "Press Ctrl+c to cancel or Press any key to continue..."
     char=`get_char`
-    tar xzf nginx-$NEW_nginx_ver.tar.gz
-    pushd nginx-$NEW_nginx_ver
+    tar xzf nginx-${NEW_nginx_ver}.tar.gz
+    pushd nginx-${NEW_nginx_ver}
     make clean
     sed -i 's@CFLAGS="$CFLAGS -g"@#CFLAGS="$CFLAGS -g"@' auto/cc/gcc # close debug
-    $nginx_install_dir/sbin/nginx -V &> $$
+    ${nginx_install_dir}/sbin/nginx -V &> $$
     nginx_configure_arguments=`cat $$ | grep 'configure arguments:' | awk -F: '{print $2}'`
     rm -rf $$
-    ./configure $nginx_configure_arguments
+    ./configure ${nginx_configure_arguments}
     make -j ${THREAD}
     if [ -f "objs/nginx" ]; then
-      /bin/mv $nginx_install_dir/sbin/nginx{,`date +%m%d`}
-      /bin/cp objs/nginx $nginx_install_dir/sbin/nginx
+      /bin/mv ${nginx_install_dir}/sbin/nginx{,`date +%m%d`}
+      /bin/cp objs/nginx ${nginx_install_dir}/sbin/nginx
       kill -USR2 `cat /var/run/nginx.pid`
       sleep 1
       kill -QUIT `cat /var/run/nginx.pid.oldbin`
       popd > /dev/null
-      echo "You have ${CMSG}successfully${CEND} upgrade from ${CWARNING}$OLD_nginx_ver${CEND} to ${CWARNING}$NEW_nginx_ver${CEND}"
-      rm -rf nginx-$NEW_nginx_ver
+      echo "You have ${CMSG}successfully${CEND} upgrade from ${CWARNING}${OLD_nginx_ver}${CEND} to ${CWARNING}${NEW_nginx_ver}${CEND}"
+      rm -rf nginx-${NEW_nginx_ver}
     else
       echo "${CFAILURE}Upgrade Nginx failed! ${CEND}"
     fi
@@ -68,23 +68,23 @@ Upgrade_Nginx() {
 
 Upgrade_Tengine() {
   pushd ${oneinstack_dir}/src > /dev/null
-  [ ! -e "$tengine_install_dir/sbin/nginx" ] && echo "${CWARNING}Tengine is not installed on your system! ${CEND}" && exit 1
-  OLD_tengine_ver_tmp=`$tengine_install_dir/sbin/nginx -v 2>&1`
+  [ ! -e "${tengine_install_dir}/sbin/nginx" ] && echo "${CWARNING}Tengine is not installed on your system! ${CEND}" && exit 1
+  OLD_tengine_ver_tmp=`${tengine_install_dir}/sbin/nginx -v 2>&1`
   OLD_tengine_ver="`echo ${OLD_tengine_ver_tmp#*/} | awk '{print $1}'`"
   Latest_tengine_ver=`curl -s http://tengine.taobao.org/changelog.html | grep -oE "[0-9]\.[0-9]\.[0-9]+" | head -1`
   echo
-  echo "Current Tengine Version: ${CMSG}$OLD_tengine_ver${CEND}"
+  echo "Current Tengine Version: ${CMSG}${OLD_tengine_ver}${CEND}"
   while :; do echo
-    read -p "Please input upgrade Tengine Version(default: $Latest_tengine_ver): " NEW_tengine_ver
-    [ -z "$NEW_tengine_ver" ] && NEW_tengine_ver=$Latest_tengine_ver
-    if [ "$NEW_tengine_ver" != "$OLD_tengine_ver" ]; then
-      [ ! -e "tengine-$NEW_tengine_ver.tar.gz" ] && wget --no-check-certificate -c http://tengine.taobao.org/download/tengine-$NEW_tengine_ver.tar.gz > /dev/null 2>&1
-      if [ -e "tengine-$NEW_tengine_ver.tar.gz" ]; then
-        src_url=https://www.openssl.org/source/openssl-$openssl_ver.tar.gz && Download_src
-        src_url=http://mirrors.linuxeye.com/oneinstack/src/pcre-$pcre_ver.tar.gz && Download_src
-        tar xzf openssl-$openssl_ver.tar.gz
-        tar xzf pcre-$pcre_ver.tar.gz
-        echo "Download [${CMSG}tengine-$NEW_tengine_ver.tar.gz${CEND}] successfully! "
+    read -p "Please input upgrade Tengine Version(default: ${Latest_tengine_ver}): " NEW_tengine_ver
+    [ -z "${NEW_tengine_ver}" ] && NEW_tengine_ver=${Latest_tengine_ver}
+    if [ "${NEW_tengine_ver}" != "${OLD_tengine_ver}" ]; then
+      [ ! -e "tengine-${NEW_tengine_ver}.tar.gz" ] && wget --no-check-certificate -c http://tengine.taobao.org/download/tengine-${NEW_tengine_ver}.tar.gz > /dev/null 2>&1
+      if [ -e "tengine-${NEW_tengine_ver}.tar.gz" ]; then
+        src_url=https://www.openssl.org/source/openssl-${openssl_ver}.tar.gz && Download_src
+        src_url=http://mirrors.linuxeye.com/oneinstack/src/pcre-${pcre_ver}.tar.gz && Download_src
+        tar xzf openssl-${openssl_ver}.tar.gz
+        tar xzf pcre-${pcre_ver}.tar.gz
+        echo "Download [${CMSG}tengine-${NEW_tengine_ver}.tar.gz${CEND}] successfully! "
         break
       else
         echo "${CWARNING}Tengine version does not exist! ${CEND}"
@@ -94,33 +94,33 @@ Upgrade_Tengine() {
     fi
   done
 
-  if [ -e "tengine-$NEW_tengine_ver.tar.gz" ]; then
-    echo "[${CMSG}tengine-$NEW_tengine_ver.tar.gz${CEND}] found"
+  if [ -e "tengine-${NEW_tengine_ver}.tar.gz" ]; then
+    echo "[${CMSG}tengine-${NEW_tengine_ver}.tar.gz${CEND}] found"
     echo "Press Ctrl+c to cancel or Press any key to continue..."
     char=`get_char`
-    tar xzf tengine-$NEW_tengine_ver.tar.gz
-    pushd tengine-$NEW_tengine_ver
+    tar xzf tengine-${NEW_tengine_ver}.tar.gz
+    pushd tengine-${NEW_tengine_ver}
     make clean
     sed -i 's@CFLAGS="$CFLAGS -g"@#CFLAGS="$CFLAGS -g"@' auto/cc/gcc # close debug
-    $tengine_install_dir/sbin/nginx -V &> $$
+    ${tengine_install_dir}/sbin/nginx -V &> $$
     tengine_configure_arguments=`cat $$ | grep 'configure arguments:' | awk -F: '{print $2}'`
     rm -rf $$
-    ./configure $tengine_configure_arguments
+    ./configure ${tengine_configure_arguments}
     make -j ${THREAD}
     if [ -f "objs/nginx" ]; then
-      /bin/mv $tengine_install_dir/sbin/nginx{,`date +%m%d`}
-      /bin/mv $tengine_install_dir/sbin/dso_tool{,`date +%m%d`}
-      /bin/mv $tengine_install_dir/modules{,`date +%m%d`}
-      /bin/cp objs/nginx $tengine_install_dir/sbin/nginx
-      /bin/cp objs/dso_tool $tengine_install_dir/sbin/dso_tool
-      chmod +x $tengine_install_dir/sbin/*
+      /bin/mv ${tengine_install_dir}/sbin/nginx{,`date +%m%d`}
+      /bin/mv ${tengine_install_dir}/sbin/dso_tool{,`date +%m%d`}
+      /bin/mv ${tengine_install_dir}/modules{,`date +%m%d`}
+      /bin/cp objs/nginx ${tengine_install_dir}/sbin/nginx
+      /bin/cp objs/dso_tool ${tengine_install_dir}/sbin/dso_tool
+      chmod +x ${tengine_install_dir}/sbin/*
       make install
       kill -USR2 `cat /var/run/nginx.pid`
       sleep 1
       kill -QUIT `cat /var/run/nginx.pid.oldbin`
       popd > /dev/null
-      echo "You have ${CMSG}successfully${CEND} upgrade from ${CWARNING}$OLD_tengine_ver${CEND} to ${CWARNING}$NEW_tengine_ver${CEND}"
-      rm -rf tengine-$NEW_tengine_ver
+      echo "You have ${CMSG}successfully${CEND} upgrade from ${CWARNING}$OLD_tengine_ver${CEND} to ${CWARNING}${NEW_tengine_ver}${CEND}"
+      rm -rf tengine-${NEW_tengine_ver}
     else
       echo "${CFAILURE}Upgrade Tengine failed! ${CEND}"
     fi
@@ -130,23 +130,23 @@ Upgrade_Tengine() {
 
 Upgrade_OpenResty() {
   pushd ${oneinstack_dir}/src > /dev/null
-  [ ! -e "$openresty_install_dir/nginx/sbin/nginx" ] && echo "${CWARNING}OpenResty is not installed on your system! ${CEND}" && exit 1
-  OLD_openresy_ver_tmp=`$openresty_install_dir/nginx/sbin/nginx -v 2>&1`
+  [ ! -e "${openresty_install_dir}/nginx/sbin/nginx" ] && echo "${CWARNING}OpenResty is not installed on your system! ${CEND}" && exit 1
+  OLD_openresy_ver_tmp=`${openresty_install_dir}/nginx/sbin/nginx -v 2>&1`
   OLD_openresy_ver="`echo ${OLD_openresy_ver_tmp#*/} | awk '{print $1}'`"
   Latest_openresy_ver=`curl -s https://openresty.org/en/download.html | awk '/download\/openresty-/{print $0}' |  grep -oE "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+" | head -1`
   echo
-  echo "Current OpenResty Version: ${CMSG}$OLD_openresy_ver${CEND}"
+  echo "Current OpenResty Version: ${CMSG}${OLD_openresy_ver}${CEND}"
   while :; do echo
-    read -p "Please input upgrade OpenResty Version(default: $Latest_openresy_ver): " NEW_openresy_ver
-    [ -z "$NEW_openresy_ver" ] && NEW_openresy_ver=$Latest_openresy_ver
-    if [ "$NEW_openresy_ver" != "$OLD_openresy_ver" ]; then
-      [ ! -e "openresty-$NEW_openresy_ver.tar.gz" ] && wget --no-check-certificate -c https://openresty.org/download/openresty-$NEW_openresy_ver.tar.gz > /dev/null 2>&1
-      if [ -e "openresty-$NEW_openresy_ver.tar.gz" ]; then
-        src_url=https://www.openssl.org/source/openssl-$openssl_ver.tar.gz && Download_src
-        src_url=http://mirrors.linuxeye.com/oneinstack/src/pcre-$pcre_ver.tar.gz && Download_src
-        tar xzf openssl-$openssl_ver.tar.gz
-        tar xzf pcre-$pcre_ver.tar.gz
-        echo "Download [${CMSG}openresty-$NEW_openresy_ver.tar.gz${CEND}] successfully! "
+    read -p "Please input upgrade OpenResty Version(default: ${Latest_openresy_ver}): " NEW_openresy_ver
+    [ -z "${NEW_openresy_ver}" ] && NEW_openresy_ver=${Latest_openresy_ver}
+    if [ "${NEW_openresy_ver}" != "${OLD_openresy_ver}" ]; then
+      [ ! -e "openresty-${NEW_openresy_ver}.tar.gz" ] && wget --no-check-certificate -c https://openresty.org/download/openresty-${NEW_openresy_ver}.tar.gz > /dev/null 2>&1
+      if [ -e "openresty-${NEW_openresy_ver}.tar.gz" ]; then
+        src_url=https://www.openssl.org/source/openssl-${openssl_ver}.tar.gz && Download_src
+        src_url=http://mirrors.linuxeye.com/oneinstack/src/pcre-${pcre_ver}.tar.gz && Download_src
+        tar xzf openssl-${openssl_ver}.tar.gz
+        tar xzf pcre-${pcre_ver}.tar.gz
+        echo "Download [${CMSG}openresty-${NEW_openresy_ver}.tar.gz${CEND}] successfully! "
         break
       else
         echo "${CWARNING}OpenResty version does not exist! ${CEND}"
@@ -156,27 +156,27 @@ Upgrade_OpenResty() {
     fi
   done
 
-  if [ -e "openresty-$NEW_openresy_ver.tar.gz" ]; then
-    echo "[${CMSG}openresty-$NEW_openresy_ver.tar.gz${CEND}] found"
+  if [ -e "openresty-${NEW_openresy_ver}.tar.gz" ]; then
+    echo "[${CMSG}openresty-${NEW_openresy_ver}.tar.gz${CEND}] found"
     echo "Press Ctrl+c to cancel or Press any key to continue..."
     char=`get_char`
-    tar xzf openresty-$NEW_openresy_ver.tar.gz
-    pushd openresty-$NEW_openresy_ver
+    tar xzf openresty-${NEW_openresy_ver}.tar.gz
+    pushd openresty-${NEW_openresy_ver}
     make clean
     openresty_ver_tmp=${NEW_openresy_ver%.*}
-    sed -i 's@CFLAGS="$CFLAGS -g"@#CFLAGS="$CFLAGS -g"@' bundle/nginx-$openresty_ver_tmp/auto/cc/gcc # close debug
-    $openresty_install_dir/nginx/sbin/nginx -V &> $$
-    ./configure --prefix=$openresty_install_dir --user=${run_user} --group=${run_user} --with-http_stub_status_module --with-http_v2_module --with-http_ssl_module --with-http_gzip_static_module --with-http_realip_module --with-http_flv_module --with-http_mp4_module --with-openssl=../openssl-$openssl_ver --with-pcre=../pcre-$pcre_ver --with-pcre-jit --with-ld-opt='-ljemalloc' $nginx_modules_options
+    sed -i 's@CFLAGS="$CFLAGS -g"@#CFLAGS="$CFLAGS -g"@' bundle/nginx-${openresty_ver_tmp}/auto/cc/gcc # close debug
+    ${openresty_install_dir}/nginx/sbin/nginx -V &> $$
+    ./configure --prefix=${openresty_install_dir} --user=${run_user} --group=${run_user} --with-http_stub_status_module --with-http_v2_module --with-http_ssl_module --with-http_gzip_static_module --with-http_realip_module --with-http_flv_module --with-http_mp4_module --with-openssl=../openssl-${openssl_ver} --with-pcre=../pcre-${pcre_ver} --with-pcre-jit --with-ld-opt='-ljemalloc' ${nginx_modules_options}
     make -j ${THREAD}
-    if [ -f "build/nginx-$openresty_ver_tmp/objs/nginx" ]; then
-      /bin/mv $openresty_install_dir/nginx/sbin/nginx{,`date +%m%d`}
+    if [ -f "build/nginx-${openresty_ver_tmp}/objs/nginx" ]; then
+      /bin/mv ${openresty_install_dir}/nginx/sbin/nginx{,`date +%m%d`}
       make install
       kill -USR2 `cat /var/run/nginx.pid`
       sleep 1
       kill -QUIT `cat /var/run/nginx.pid.oldbin`
       popd > /dev/null
-      echo "You have ${CMSG}successfully${CEND} upgrade from ${CWARNING}$OLD_openresy_ver${CEND} to ${CWARNING}$NEW_openresy_ver${CEND}"
-      rm -rf openresty-$NEW_openresy_ver
+      echo "You have ${CMSG}successfully${CEND} upgrade from ${CWARNING}${OLD_openresy_ver}${CEND} to ${CWARNING}${NEW_openresy_ver}${CEND}"
+      rm -rf openresty-${NEW_openresy_ver}
     else
       echo "${CFAILURE}Upgrade OpenResty failed! ${CEND}"
     fi
@@ -231,7 +231,7 @@ Upgrade_Apache() {
       /bin/cp -R ../apr-util-${apr_util_ver} ./srclib/apr-util
       [ -e "${php_install_dir}/bin/phpize" ] && { PHP_detail_ver=`${php_install_dir}/bin/php -r 'echo PHP_VERSION;'`; PHP_master_ver=${PHP_detail_ver%%.*}; }
       [ "${PHP_master_ver}" == '5' ] && Apache_mpm_arg='--with-mpm=prefork'
-      LDFLAGS=-ldl LD_LIBRARY_PATH=${openssl_install_dir}/lib ./configure --prefix=${apache_install_dir} ${Apache_mpm_arg} --enable-mpms-shared=all --with-included-apr --enable-headers --enable-deflate --enable-so --enable-dav --enable-rewrite --enable-ssl --with-ssl=${openssl_install_dir} --enable-http2 --with-nghttp2=/usr/local --enable-expires --enable-static-support --enable-suexec --enable-modules=all --enable-mods-shared=all
+      LDFLAGS=-ldl ./configure --prefix=${apache_install_dir} ${Apache_mpm_arg} --enable-mpms-shared=all --with-included-apr --enable-headers --enable-deflate --enable-so --enable-dav --enable-rewrite --enable-ssl --with-ssl=${openssl_install_dir} --enable-http2 --with-nghttp2=/usr/local --enable-expires --enable-static-support --enable-suexec --enable-modules=all --enable-mods-shared=all
     elif [ "${Apache_flag}" == '22' ]; then
       [ "${Ubuntu_ver}" == "12" ] && sed -i '@SSL_PROTOCOL_SSLV2@d' modules/ssl/ssl_engine_io.c
       LDFLAGS=-ldl ./configure --prefix=${apache_install_dir} --with-mpm=prefork --with-included-apr --enable-headers --enable-deflate --enable-so --enable-rewrite --enable-ssl--with-ssl=${openssl_install_dir} --enable-expires --enable-static-support --enable-suexec --enable-modules=all --enable-mods-shared=all

+ 1 - 1
ss.sh

@@ -157,7 +157,7 @@ Install_SS-libev() {
   ./configure
   make -j ${THREAD} && make install
   popd
-  echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf
+  [ -z "`grep /usr/local/lib /etc/ld.so.conf.d/*.conf`" ] && echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf
   ldconfig
   if [ -f /usr/local/bin/ss-server ]; then
     if [ "${OS}" == "CentOS" ]; then

+ 1 - 1
uninstall.sh

@@ -229,7 +229,7 @@ Print_openssl() {
 }
 
 Uninstall_openssl() {
-  [ -d "${openssl_install_dir}" ] && { rm -rf ${openssl_install_dir} /etc/ld.so.conf.d/*openssl.conf; ldconfig; }
+  [ -d "${openssl_install_dir}" ] && rm -rf ${openssl_install_dir}
 }
 
 Menu(){