zoukankan      html  css  js  c++  java
  • LNMP一键安装包sh脚本

    Xshell 5 (Build 0719)
    Copyright (c) 2002-2015 NetSarang Computer, Inc. All rights reserved.
    
    Type `help' to learn how to use Xshell prompt.
    [d:~]$ 
    
    Connecting to 192.168.1.137:22...
    Connection established.
    To escape to local shell, press 'Ctrl+Alt+]'.
    
    Last login: Sun Dec 13 19:15:22 2015 from 192.168.1.169
    [root@localhost ~]# cd /home
    [root@localhost home]# ll
    total 4
    drwx------. 4 ligaoxiang ligaoxiang 4096 Dec 14  2015 ligaoxiang
    [root@localhost home]# wget -c http://soft.vpser.net/lnmp/lnmp1.2-full.tar.gz
    --2015-12-13 20:44:04--  http://soft.vpser.net/lnmp/lnmp1.2-full.tar.gz
    Resolving soft.vpser.net... failed: Name or service not known.
    wget: unable to resolve host address “soft.vpser.net”
    [root@localhost home]# wget -c http://soft.vpser.net/lnmp/lnmp1.2-full.tar.gz && tar zxf lnmp1.2-full.tar.gz && cd lnmp1.2-full && ./install.sh lnmp
    --2015-12-13 20:44:57--  http://soft.vpser.net/lnmp/lnmp1.2-full.tar.gz
    Resolving soft.vpser.net... 74.207.246.99
    Connecting to soft.vpser.net|74.207.246.99|:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 326745420 (312M) [application/octet-stream]
    Saving to: “lnmp1.2-full.tar.gz”
    
    19% [=======>                                   ] 62,303,983  3.45M/s  eta 78s     ^C
    [root@localhost home]# ll
    total 61520
    drwx------. 4 ligaoxiang ligaoxiang     4096 Dec 14  2015 ligaoxiang
    -rw-r--r--. 1 root       root       62991223 Dec 13 20:45 lnmp1.2-full.tar.gz
    [root@localhost home]# wget -c http://soft.vpser.net/lnmp/lnmp1.2-full.tar.gz
    --2015-12-13 20:45:34--  http://soft.vpser.net/lnmp/lnmp1.2-full.tar.gz
    Resolving soft.vpser.net... 74.207.246.99, 2600:3c01::f03c:91ff:fe96:d57a
    Connecting to soft.vpser.net|74.207.246.99|:80... connected.
    HTTP request sent, awaiting response... 206 Partial Content
    Length: 326745420 (312M), 263754197 (252M) remaining [application/octet-stream]
    Saving to: “lnmp1.2-full.tar.gz”
    
    100%[++++++++==================================>] 326,745,420 3.05M/s   in 84s     
    
    2015-12-13 20:47:04 (2.98 MB/s) - “lnmp1.2-full.tar.gz” saved [326745420/326745420]
    
    [root@localhost home]# ll
    total 319096
    drwx------. 4 ligaoxiang ligaoxiang      4096 Dec 14  2015 ligaoxiang
    -rw-r--r--. 1 root       root       326745420 Jul 24 02:34 lnmp1.2-full.tar.gz
    [root@localhost home]# tar zxf lnmp1.2-full.tar.gz 
    
    ^H^H
    ^C
    [root@localhost home]# tar zxf lnmp1.2-full.tar.gz
    [root@localhost home]# ll
    total 319100
    drwx------. 4 ligaoxiang ligaoxiang      4096 Dec 14  2015 ligaoxiang
    drwxr-xr-x. 7 root       root            4096 Jun  5  2015 lnmp1.2-full
    -rw-r--r--. 1 root       root       326745420 Jul 24 02:34 lnmp1.2-full.tar.gz
    [root@localhost home]# cd  lnmp1.2-full
    [root@localhost lnmp1.2-full]# ll
    total 80
    -rwxr-xr-x. 1 root root 3870 Jun  5  2015 addons.sh
    -rw-r--r--. 1 root root 6338 Jun  5  2015 ChangeLog
    drwxr-xr-x. 3 root root 4096 Jun  5  2015 conf
    drwxr-xr-x. 2 root root 4096 Jun  5  2015 include
    drwxr-xr-x. 2 root root 4096 Apr 16  2015 init.d
    -rwxr-xr-x. 1 root root 4534 Jun  5  2015 install.sh
    -rwxr-xr-x. 1 root root 6123 Jun  5  2015 php5.2.17.sh
    -rwxr-xr-x. 1 root root 6694 Jun 18 05:25 pureftpd.sh
    -rw-r--r--. 1 root root 5272 May 31  2015 readme
    -rw-r--r--. 1 root root 5272 Jun  5  2015 README
    drwxr-xr-x. 3 root root 4096 Jun 23 23:00 src
    drwxr-xr-x. 2 root root 4096 Apr 16  2015 tools
    -rwxr-xr-x. 1 root root 3942 Jun  5  2015 uninstall.sh
    -rwxr-xr-x. 1 root root 2421 Jun  5  2015 upgrade.sh
    [root@localhost lnmp1.2-full]# vim install.sh
    [root@localhost lnmp1.2-full]# vim install.sh
    
    #!/bin/bash
    PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
    export PATH
    
    # Check if user is root
        exit 1
    fi
    
    cur_dir=$(pwd)
        Stack="lnmp"
    else
        Stack=$1
    fi
    
    LNMP_Ver='1.2'
    
    . include/main.sh
    . include/init.sh
    . include/mysql.sh
    . include/mariadb.sh
    . include/php.sh
    . include/nginx.sh
    . include/apache.sh
    . include/end.sh
    
    Get_Dist_Name
    
    if [ "${DISTRO}" = "unknow" ]; then
        exit 1
    fi
    
    clear
    echo "+------------------------------------------------------------------------+"
    echo "+------------------------------------------------------------------------+"
    echo "|        A tool to auto-compile & install LNMP/LNMPA/LAMP on Linux       |"
    echo "+------------------------------------------------------------------------+"
    echo "|          For more information please visit http://www.lnmp.org         |"
    echo "+------------------------------------------------------------------------+"
    
    Init_Install()
    {
        Press_Install
        Print_Sys_Info
        if [ "${DISTRO}" = "RHEL" ]; then
            RHEL_Modify_Source
        fi
        Get_Dist_Version
        if [ "${DISTRO}" = "Ubuntu" ]; then
            Ubuntu_Modify_Source
        fi
        Set_Timezone
        if [ "$PM" = "yum" ]; then
            CentOS_InstallNTP
            CentOS_RemoveAMP
            CentOS_Dependent
        elif [ "$PM" = "apt" ]; then
            Deb_InstallNTP
            Xen_Hwcap_Setting
            Deb_RemoveAMP
            Deb_Dependent
        fi
        Disable_Selinux
        Check_Download
        Install_Autoconf
        Install_Libiconv
        Install_Libmcrypt
        Install_Mhash
        Install_Mcrypt
        Install_Freetype
        Install_Curl
        Install_Pcre
        if [ "${SelectMalloc}" = "2" ]; then
            Install_Jemalloc
        elif [ "${SelectMalloc}" = "3" ]; then
            Install_TCMalloc
        fi
        if [ "$PM" = "yum" ]; then
            CentOS_Lib_Opt
        elif [ "$PM" = "apt" ]; then
            Deb_Lib_Opt
            Deb_Check_MySQL
        fi
        if [ "${DBSelect}" = "1" ]; then
            Install_MySQL_51
        elif [ "${DBSelect}" = "2" ]; then
            Install_MySQL_55
        elif [ "${DBSelect}" = "3" ]; then
            Install_MySQL_56
        elif [ "${DBSelect}" = "4" ]; then
            Install_MariaDB_5
        elif [ "${DBSelect}" = "5" ]; then
            Install_MariaDB_10
        fi
        Export_PHP_Autoconf
    }
    
    LNMP_Stack()
    {
        Init_Install
        if [ "${PHPSelect}" = "1" ]; then
            Install_PHP_52
        elif [ "${PHPSelect}" = "2" ]; then
            Install_PHP_53
        elif [ "${PHPSelect}" = "3" ]; then
            Install_PHP_54
        elif [ "${PHPSelect}" = "4" ]; then
            Install_PHP_55
        elif [ "${PHPSelect}" = "5" ]; then
            Install_PHP_56
        fi
        Install_Nginx
            Install_PHP_54 
        elif [ "${PHPSelect}" = "4" ]; then 
            Install_PHP_55 
        elif [ "${PHPSelect}" = "5" ]; then 
            Install_PHP_56 
        fi 
        Creat_PHP_Tools 
        Add_LAMP_Startup 
        Check_LAMP_Install 
    } 
     
    case "${Stack}" in 
        lnmp) 
            Dispaly_Selection 
            LNMP_Stack 2>&1 | tee -a /root/lnmp-install.log 
            ;; 
        lnmpa) 
            Dispaly_Selection 
            LNMPA_Stack 2>&1 | tee -a /root/lnmp-install.log 
            ;; 
        lamp) 
            Dispaly_Selection 
            LAMP_Stack 2>&1 | tee -a /root/lnmp-install.log 
            ;; 
        *) 
            Echo_Red "Usage: $0 {lnmp|lnmpa|lamp}" 
            ;; 
    esac 
    -- VISUAL LINE --                                                 190,1         Bot
  • 相关阅读:
    序列化与反序列化
    进程与线程
    winform基础
    MD5加密
    Docker安装Nextcloud+collabora office+ocdownloader
    Docker安装MariaDB
    Docker 安装 Nginx
    Docker命令大全
    Docker之镜像操作
    Linux入门-Docker安装
  • 原文地址:https://www.cnblogs.com/jiufen/p/5045041.html
Copyright © 2011-2022 走看看