中文字幕av专区_日韩电影在线播放_精品国产精品久久一区免费式_av在线免费观看网站

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

CentOS7 腳本一鍵源碼編譯安裝或卸載http2.4.25

發布時間:2020-07-26 07:46:23 來源:網絡 閱讀:166 作者:lkjwer 欄目:系統運維

待完善
CentOS 7測試

哈哈

#!/bin/bash
#**
#Author: 哈啰
#QQ: ×××
#Date: 2019-08-08
#FileName: install_httpd.sh
#URL: https://blog.51cto.com/14012942
#Description: The test script
#Copyright (C): 2019 Copyright ? 站點名稱 版權所有
#****
#set -e
RED="\033[0;31m"
GREEN="\033[0;32m"
NO_COLOR="\033[0m"
PREFIX=/apps/httpd24
SYSCONFDIR=/etc/httpd
SRC=/usr/src
FLAG=$1
CPUS=cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l
CORE=cat /proc/cpuinfo| grep "cpu cores"| uniq | awk '{print $4}'
J=$((${CPUS}*${CORE}))

判斷是不是root

judge_root() {
[ $(id -u) != "0" ] && { echo -e "${RED}Error:${NO_COLOR} You must be root to run this script."; exit 1; }
}

download

download_source() {
cd
yum install wget -y
#wget http://archive.apache.org/dist/httpd/httpd-2.4.25.tar.bz2

wget https://ftp.osuosl.org/pub/blfs/conglomeration/httpd/httpd-2.4.25.tar.bz2

wget https://ftp.bit.nl/apache/httpd-2.4.25.tar.bz2
if [ ! "$?" -eq 0 ];then
    echo "download failed!"
    exit 1
fi

}

install

install() {
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum install gcc openssl-devel pcre-devel apr-devel apr-util-devel libnghttp2-devel ncurses-devel lbzip2 bzip2 -y
tar xf httpd-2.4.25.tar.bz2 -C ${SRC}/
cd ${SRC}/httpd-2.4.25
./configure \
--prefix=${PREFIX} \
--sysconfdir=${SYSCONFDIR} \
--enable-http2 \
--disable-auth-basic \
--enable-ssl \
--enable-so
make -j ${J}
make install
echo "PATH=${PREFIX}/bin:$PATH" >> /etc/profile.d/env.sh
source /etc/profile.d/env.sh
}

test_web

test_web() {
apachectl start
ss -ltn | grep -q :80
[ "$?" -eq 0 ] && echo -e "${GREEN}May be web server is ok! \n If not ok,please check selinux and firewalld status.${NO_COLOR}" || \
echo -e "${RED}ERROR,Please check the web server.${NO_COLOR}"
}

remove_httpd() {
source /etc/profile.d/env.sh
apachectl stop
rm -rf ${PREFIX} ${SYSCONFDIR} ${SRC}/httpd-2.4.25
sed -i '/^PATH/d' /etc/profile.d/env.sh
}

judge_uninstall(){
if [ "$FLAG" = "uninstall" ];then
remove_httpd
exit 0
fi
}

main() {
judge_uninstall
judge_root
download_source
install
test_web
}

main

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

榕江县| 博白县| 高邑县| 阜新市| 阳新县| 临泽县| 榆树市| 长顺县| 苍南县| 伊通| 宣恩县| 额敏县| 长丰县| 富阳市| 岗巴县| 房山区| 汾西县| 常州市| 淮阳县| 光山县| 无锡市| 大兴区| 宁强县| 宜良县| 溆浦县| 肥西县| 彩票| 德阳市| 辽阳县| 延吉市| 依兰县| 兴义市| 南宁市| 徐水县| 池州市| 花莲市| 潮安县| 沙雅县| 方正县| 南召县| 仁布县|