瀏覽代碼

Add auto-install

lj2007331@gmail.com 7 年之前
父節點
當前提交
258febdeb3
共有 11 個文件被更改,包括 584 次插入420 次删除
  1. 2 2
      addons.sh
  2. 1 0
      config/index.html
  3. 1 0
      config/index_cn.html
  4. 5 5
      include/check_os.sh
  5. 3 3
      include/check_sw.sh
  6. 2 2
      include/hhvm_CentOS.sh
  7. 4 4
      include/init_CentOS.sh
  8. 2 2
      include/python.sh
  9. 1 1
      include/xcache.sh
  10. 562 400
      install.sh
  11. 1 1
      ss.sh

+ 2 - 2
addons.sh

@@ -230,8 +230,8 @@ What Are You Doing?
             2)
               if [[ "${PHP_main_ver}" =~ ^5.[3-6]$ ]]; then
                 while :; do
-                  read -p "Please input xcache admin password: " xcache_admin_pass
-                  (( ${#xcache_admin_pass} >= 5 )) && { xcache_admin_md5_pass=$(echo -n "${xcache_admin_pass}" | md5sum | awk '{print $1}') ; break ; } || echo "${CFAILURE}xcache admin password least 5 characters! ${CEND}"
+                  read -p "Please input xcache admin password: " xcachepwd
+                  (( ${#xcachepwd} >= 5 )) && { xcachepwd_md5=$(echo -n "${xcachepwd}" | md5sum | awk '{print $1}') ; break ; } || echo "${CFAILURE}xcache admin password least 5 characters! ${CEND}"
                 done
                 checkDownload
                 Install_XCache

+ 1 - 0
config/index.html

@@ -2,6 +2,7 @@
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<meta http-equiv="Cache-Control" content="max-age=604800" />
 <title>OneinStack - A PHP/JAVA Deployment Tool</title>
 <meta name="keywords" content="OneinStack,lemp Stack,lamp Stack,lnmp stack" />
 <meta name="description" content="OneinStack is a LEMP, LAMP stack of Nginx, Apache, Tomcat, MySQL, MariaDB, Percona, Redis, Memcached, Pureftpd, PHP & JAVA. It's quite simple to use, manage and extend." />

+ 1 - 0
config/index_cn.html

@@ -2,6 +2,7 @@
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<meta http-equiv="Cache-Control" content="max-age=604800" />
 <title>OneinStack - PHP/JAVA环境一键部署工具</title>
 <meta name="keywords" content="OneinStack,LAMP Stack,LNMP Stack,lnmpa stack" />
 <meta name="description" content="OneinStack是PHP/JAVA环境一键部署工具, 包括Nginx, Apache, Tomcat, MySQL, MariaDB, Percona, Redis, Memcached, Pureftpd, PHP & JAVA." />

+ 5 - 5
include/check_os.sh

@@ -10,12 +10,12 @@
 
 if [ -n "$(grep 'Aliyun Linux release' /etc/issue)" -o -e /etc/redhat-release ]; then
   OS=CentOS
-  [ -n "$(grep ' 7\.' /etc/redhat-release 2> /dev/null)" ] && CentOS_RHEL_ver=7
-  [ -n "$(grep ' 6\.' /etc/redhat-release 2> /dev/null)" -o -n "$(grep 'Aliyun Linux release6 15' /etc/issue)" ] && CentOS_RHEL_ver=6
-  [ -n "$(grep ' 5\.' /etc/redhat-release 2> /dev/null)" -o -n "$(grep 'Aliyun Linux release5' /etc/issue)" ] && CentOS_RHEL_ver=5
+  [ -n "$(grep ' 7\.' /etc/redhat-release 2> /dev/null)" ] && CentOS_ver=7
+  [ -n "$(grep ' 6\.' /etc/redhat-release 2> /dev/null)" -o -n "$(grep 'Aliyun Linux release6 15' /etc/issue)" ] && CentOS_ver=6
+  [ -n "$(grep ' 5\.' /etc/redhat-release 2> /dev/null)" -o -n "$(grep 'Aliyun Linux release5' /etc/issue)" ] && CentOS_ver=5
 elif [ -n "$(grep 'Amazon Linux AMI release' /etc/issue)" -o -e /etc/system-release ]; then
   OS=CentOS
-  CentOS_RHEL_ver=6
+  CentOS_ver=6
 elif [ -n "$(grep 'bian' /etc/issue)" -o "$(lsb_release -is 2>/dev/null)" == "Debian" ]; then
   OS=Debian
   [ ! -e "$(which lsb_release)" ] && { apt-get -y update; apt-get -y install lsb-release; clear; }
@@ -92,7 +92,7 @@ if [[ "${OS}" =~ ^Ubuntu$|^Debian$ ]]; then
     sslLibVer=ssl100
   fi
 elif [ "${OS}" == "CentOS" ]; then
-  if [ "${CentOS_RHEL_ver}" == '5' ]; then
+  if [ "${CentOS_ver}" == '5' ]; then
     sslLibVer=ssl098e
   else
     sslLibVer=ssl101

+ 3 - 3
include/check_sw.sh

@@ -52,16 +52,16 @@ installDepsCentOS() {
   yum makecache
   # Uninstall the conflicting packages
   echo "${CMSG}Removing the conflicting packages...${CEND}"
-  if [ "${CentOS_RHEL_ver}" == '7' ]; then
+  if [ "${CentOS_ver}" == '7' ]; then
     yum -y groupremove "Basic Web Server" "MySQL Database server" "MySQL Database client" "File and Print Server"
     systemctl mask firewalld.service
     if [ "${iptables_yn}" == 'y' ]; then
       yum -y install iptables-services
       systemctl enable iptables.service
     fi
-  elif [ "${CentOS_RHEL_ver}" == '6' ]; then
+  elif [ "${CentOS_ver}" == '6' ]; then
     yum -y groupremove "FTP Server" "PostgreSQL Database client" "PostgreSQL Database server" "MySQL Database server" "MySQL Database client" "Web Server" "Office Suite and Productivity" "E-mail server" "Ruby Support" "Printing client"
-  elif [ "${CentOS_RHEL_ver}" == '5' ]; then
+  elif [ "${CentOS_ver}" == '5' ]; then
     yum -y groupremove "FTP Server" "Windows File Server" "PostgreSQL Database" "News Server" "MySQL Database" "DNS Name Server" "Web Server" "Dialup Networking Support" "Mail Server" "Ruby" "Office/Productivity" "Sound and Video" "Printing Support" "OpenFabrics Enterprise Distribution"
   fi
 

+ 2 - 2
include/hhvm_CentOS.sh

@@ -13,7 +13,7 @@ Install_hhvm_CentOS() {
   id -u ${run_user} >/dev/null 2>&1
   [ $? -ne 0 ] && useradd -M -s /sbin/nologin ${run_user}
 
-  if [ "${CentOS_RHEL_ver}" == '7' ]; then
+  if [ "${CentOS_ver}" == '7' ]; then
     [ ! -e /etc/yum.repos.d/epel.repo ] && cat > /etc/yum.repos.d/epel.repo << EOF
 [epel]
 name=Extra Packages for Enterprise Linux 7 - \$basearch
@@ -34,7 +34,7 @@ EOF
     [ ! -e "/usr/bin/hhvm" -a "/usr/local/bin/hhvm" ] && ln -s /usr/local/bin/hhvm /usr/bin/hhvm
   fi
 
-  if [ "${CentOS_RHEL_ver}" == '6' ]; then
+  if [ "${CentOS_ver}" == '6' ]; then
     [ ! -e /etc/yum.repos.d/epel.repo ] && cat > /etc/yum.repos.d/epel.repo << EOF
 [epel]
 name=Extra Packages for Enterprise Linux 6 - \$basearch

+ 4 - 4
include/init_CentOS.sh

@@ -9,7 +9,7 @@
 #       https://github.com/lj2007331/oneinstack
 
 # closed Unnecessary services and remove obsolete rpm package
-[ "${CentOS_RHEL_ver}" == '7' ] && [ "$(systemctl is-active NetworkManager.service)" == 'active' ] && NM_flag=1
+[ "${CentOS_ver}" == '7' ] && [ "$(systemctl is-active NetworkManager.service)" == 'active' ] && NM_flag=1
 for Service in $(chkconfig --list | grep 3:on | awk '{print $1}' | grep -vE 'nginx|httpd|tomcat|mysqld|php-fpm|pureftpd|redis-server|memcached|supervisord|aegis|NetworkManager|iptables');do chkconfig --level 3 ${Service} off;done
 [ "${NM_flag}" == '1' ] && systemctl enable NetworkManager.service
 for Service in sshd network crond messagebus irqbalance syslog rsyslog;do chkconfig --level 3 ${Service} on;done
@@ -103,15 +103,15 @@ net.netfilter.nf_conntrack_tcp_timeout_established = 3600
 EOF
 sysctl -p
 
-if [ "${CentOS_RHEL_ver}" == '5' ]; then
+if [ "${CentOS_ver}" == '5' ]; then
   sed -i 's@^[3-6]:2345:respawn@#&@g' /etc/inittab
   sed -i 's@^ca::ctrlaltdel@#&@' /etc/inittab
   sed -i 's@LANG=.*$@LANG="en_US.UTF-8"@g' /etc/sysconfig/i18n
-elif [ "${CentOS_RHEL_ver}" == '6' ]; then
+elif [ "${CentOS_ver}" == '6' ]; then
   sed -i 's@^ACTIVE_CONSOLES.*@ACTIVE_CONSOLES=/dev/tty[1-2]@' /etc/sysconfig/init
   sed -i 's@^start@#start@' /etc/init/control-alt-delete.conf
   sed -i 's@LANG=.*$@LANG="en_US.UTF-8"@g' /etc/sysconfig/i18n
-elif [ "${CentOS_RHEL_ver}" == '7' ]; then
+elif [ "${CentOS_ver}" == '7' ]; then
   sed -i 's@LANG=.*$@LANG="en_US.UTF-8"@g' /etc/locale.conf
 fi
 

+ 2 - 2
include/python.sh

@@ -10,7 +10,7 @@
 
 Install_Python() {
   pushd ${oneinstack_dir}/src > /dev/null
-  if [ "${CentOS_RHEL_ver}" == '7' ]; then
+  if [ "${CentOS_ver}" == '7' ]; then
     [ ! -e /etc/yum.repos.d/epel.repo ] && cat > /etc/yum.repos.d/epel.repo << EOF
 [epel]
 name=Extra Packages for Enterprise Linux 7 - \$basearch
@@ -20,7 +20,7 @@ failovermethod=priority
 enabled=1
 gpgcheck=0
 EOF
-  elif [ "${CentOS_RHEL_ver}" == '6' ]; then
+  elif [ "${CentOS_ver}" == '6' ]; then
     [ ! -e /etc/yum.repos.d/epel.repo ] && cat > /etc/yum.repos.d/epel.repo << EOF
 [epel]
 name=Extra Packages for Enterprise Linux 6 - \$basearch

+ 1 - 1
include/xcache.sh

@@ -29,7 +29,7 @@ extension=xcache.so
 [xcache.admin]
 xcache.admin.enable_auth=On
 xcache.admin.user=admin
-xcache.admin.pass="${xcache_admin_md5_pass}"
+xcache.admin.pass="${xcachepwd_md5}"
 
 [xcache]
 xcache.size=${xcacheSize}M

文件差異過大導致無法顯示
+ 562 - 400
install.sh


+ 1 - 1
ss.sh

@@ -32,7 +32,7 @@ pushd ${oneinstack_dir}/src > /dev/null
 
 PUBLIC_IPADDR=$(../include/get_public_ipaddr.py)
 
-[ "${CentOS_RHEL_ver}" == '5' ] && { echo "${CWARNING}SS only support CentOS6,7 or Debian or Ubuntu! ${CEND}"; exit 1; }
+[ "${CentOS_ver}" == '5' ] && { echo "${CWARNING}SS only support CentOS6,7 or Debian or Ubuntu! ${CEND}"; exit 1; }
 
 Check_SS() {
   [ -f /usr/local/bin/ss-server ] && ss_option=1

部分文件因文件數量過多而無法顯示