CentOS7 编码编译安装或卸载http2.4.25 一键脚本
待完善
CentOS 7测试
哈哈
#!/bin/bash
#**************************************************************
#Author: dsadas
#QQ: 68**67321
#Date: 2019-08-08
#FileName: install_httpd.sh
#URL: https://jd.com
#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
CentOS7 编码编译安装或卸载http2.4.25 一键脚本的更多相关文章
- centos7.6编译安装php7.2.11及redis/memcached/rabbitmq/openssl/curl等常见扩展
centos7.6编译安装php7..11及redis/memcached/rabbitmq/openssl/curl等常见扩展 获取Php的编译参数方法: [root@eus-api-cms-bac ...
- CentOS7.6编译安装openssl-1.1.1c
卸载旧版本OpenSSL # which openssl/usr/bin/openssl# mv openssl openssl.oldrm -rf /etc/ssl #删除配置文件 CentOS7. ...
- linux服务器上,yum、rpm、源码编译安装及卸载
源码的编译安装及卸载 源码安装三部曲 1.生成makefile编译文件./configure 一般安装包下面都有一个configure文件,用来生成makefile编译文件常用的参数: --prefi ...
- ./configure && make && make install 编译安装和卸载 (Linux)
./configure && make && make install 编译安装和卸载 (Linux) 正常的编译安装/卸载: 源码的安装一般由3个步骤组成:配置( ...
- centos7下编译安装php-7.0.15(PHP-FPM)
centos7下编译安装php-7.0.15(PHP-FPM) 一.下载php7源码包 http://php.net/downloads.php 如:php-7.0.15.tar.gz 二.安装所需依 ...
- Linux Centos7.2 编译安装PHP7.0.2
操作环境: 1.系统:Centos7.2 2.服务:Nginx 1.下载PHP7.0.2的安装包解压,编译,安装: $ cd /usr/src/ $ wget http://cn2.php.net/d ...
- CentOS7.6编译安装Python-3.7.4
安装步骤 1. 下载安装包.wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tgz<说明>如果报SSL/TSL错误,则加 ...
- CentOS7下编译安装redis-5.0.9
CentOS7下编译安装redis-5.0.9 本文地址http://yangjianyong.cn/?p=171转载无需经过作者本人授权 下载redis #code start wget https ...
- CentOS7 下编译安装 Samba,什么是 SMB/CIFS 协议
目录 一.关于 Samba 1. SMB 2. Samba 二.yum 安装 Samba 1. 安装 Samba 2. 查看版本 3. 查看配置文件 4. 启动服务 5. 本地客户端验证 6. Win ...
随机推荐
- LIS&&LCS&&LCIS
LIS #include<bits/stdc++.h> using namespace std; int n,a[100005],b[100005],ji; int main(){ cin ...
- Kubernetes之Flannel介绍
Flannel是CoreOS团队针对Kubernetes设计的一个网络规划服务,简单来说,它的功能是让集群中的不同节点主机创建的Docker容器都具有全集群唯一的虚拟IP地址. 在Kubernetes ...
- OD 逆向工具常用快捷键
F2:设置断点,只要在光标定位的位置(上图中灰色条)按F2键即可,再按一次F2键则会删除断点. F8:单步步过.每按一次这个键执行一条反汇编窗口中的一条指令,遇到 CALL 等子程序不进入其代码. F ...
- ASP.NET Core在 .NET Core 3.1 Preview 1中的更新
.NET Core 3.1 Preview 1现在可用.此版本主要侧重于错误修复,但同时也包含一些新功能. 这是此版本的ASP.NET Core的新增功能: 对Razor components的部分类 ...
- Cocos2d-x 学习笔记(11.8) DelayTime ReverseTime TargetedAction ActionFloat Blink TintTo TintBy ResizeTo ResizeBy
1. DelayTime 通过create方法create(float d)设置时长,update方法没有任何操作.可以用于动作之间的延迟. 2. ReverseTime create方法create ...
- 一文了解Mysql
文章原创于公众号:程序猿周先森.本平台不定时更新,喜欢我的文章,欢迎关注我的微信公众号. Redis系列到上一篇已经全部结束了,从本篇开始进入Mysql系列文章专题.本篇作为Mysql系列专题的开篇文 ...
- iview和element中日期选择器快捷选项的定制控件
公司的两个vue项目中都用到了iview和element这个框架,最近的两个需求都有关于日期选择的定制控件,就是要求日期选择的快捷选项左边栏有包含今日.昨日.本周.上周.最近一周.本月.上月.上季 ...
- opencv::自定义线性滤波
卷积概念 常见算子 自定义卷积模糊 卷积概念 1.卷积是图像处理中一个操作,是kernel在图像的每个像素上的操作. 2.Kernel本质上一个固定大小的矩阵数组,其中心点称为锚点(anchor po ...
- 入门了解Service Mesh + Istio?从本文开始
下周六,深圳,阔别已久的线下技术沙龙要和你见面啦! 现场有Rancher Labs研发经理demo刚刚发布的Rancher 2.3中的Istio.Windows容器.集群模板等功能及使用,还有k3s首 ...
- git jenkins 部署java项目
1.Java项目部署基本概述: 1.什么是Java项目? 2.为什么Java项目需要使用Maven编译? 3.手动实现Java项目构建? 4.手动实现Java项目架构图? 源码包 jar包 ...