zoukankan      html  css  js  c++  java
  • LAMP 一键部署

    LAMP 一键部署

    部署http

    
    #!/bin/bash
    
    
    ### global variables
    export lamp_repo=http://192.168.1.5/lamp/
    export lampdir=/lampdata
    export httpdir=$lampdir/httpd/
    
    export httpd_version=httpd-2.4.33.tar.bz2
    export apr_version=apr-1.6.3.tar.gz
    export apr_util_version=apr-util-1.6.1.tar.gz
    
    Get_Version()
    {
            echo `echo $1 | sed -r 's@(.*).tar(.*)@1@g' `
    }
    
    rm -rf $lampdir/*
    cd $lampdir
    
    #download http
    if [ ! -f "$httpd_version" ];then
            wget $lamp_repo$httpd_version
    fi
    tar xf $httpd_version
    http_tar_dir=httpd-2.4.33
    
    #download apr
    if [ ! -f "$apr_version" ];then
            wget $lamp_repo$apr_version
    fi
    tar xf $apr_version
    aprdir=`Get_Version $apr_version`
    #echo $aprdir
    mv $aprdir $http_tar_dir/srclib/apr
    
    #download apr_util
    if [ ! -f "$apr_util_version" ];then
            wget $lamp_repo$apr_util_version
    fi
    tar xf $apr_util_version
    apr_util=`Get_Version $apr_util_version`
    mv $apr_util $http_tar_dir/srclib/apr-util
    
    #configure
    cd $http_tar_dir
    ./configure --prefix="$httpdir" 
    --with-mpm=prefork 
    --enable-so 
    --enable-rewrite 
    --enable-mods-shared=all 
    --enable-nonportable-atomics=yes 
    --disable-dav 
    --enable-deflate 
    --enable-cache 
    --enable-disk-cache 
    --enable-mem-cache 
    --enable-file-cache 
    --enable-ssl 
    --with-included-apr 
    --enable-modules=all  
    --enable-mods-shared=all 
    --enable-cgi 
    
    CPU_NUM=$(cat /proc/cpuinfo | grep processor | wc -l)
    if [ $CPU_NUM -gt 1 ];then
            make -j $CPU_NUM
    else
            make
    fi
    make install
    cp support/apachectl /etc/init.d/httpd
    chmod u+x /etc/init.d/httpd
    
    
  • 相关阅读:
    re | [SWPU2019]ReverseMe
    wp | re | 2020“巅峰极客”网络安全技能挑战赛
    re | [CFI-CTF 2018]IntroToPE
    re | [FlareOn1]Bob Doge
    re | [ACTF新生赛2020]SoulLike
    re | [GKCTF2020]Chelly's identity
    ospf配置与ofps选举DR/BDR
    静态路由的配置
    配置三层交换机实现vlan间通信
    hybrid接口
  • 原文地址:https://www.cnblogs.com/ddz-linux/p/10699451.html
Copyright © 2011-2022 走看看