bash-2 httpd服务的源码编译安装脚本

httpd服务的源码编译安装脚本

#!/bin/bash
#
#********************************************************************
#Author: kjAlbert
#Date: 2019-10-14
#FileName: httpd.sh
#Description: The test script
#Copyright (C): 2019 All rights reserved
#********************************************************************
#
if [ $UID -ne 0 ];then
echo "not root can't insatll httpd"
exit 101
fi
mkdir -p /app/
cd /app
wget http://mirrors.tuna.tsinghua.edu.cn/apache//httpd/httpd-2.4.41.tar.bz2 &>/dev/null
tar xvf httpd-2.4.41.tar.bz2 &>/dev/null
echo "uncompress compelet"
cd httpd-2.4.41
yum install -y gcc make apr-devel apr-util-devel pcre-devel &>/dev/null
echo "all denpen ok"
./configure --prefix=/app &>/dev/null
make &>/dev/null
make install &>/dev/null
echo "start apache"
/app/bin/apachectl
echo "httpd is running"

部分解释

步骤:

  1. 将源码下载,并在root目录下建立app目录,将源码包复制并解压到app目录下
  2. 进入加压后的源码目录,将必要的包下载好,运行configure脚本生成makefile
  3. 运行make惊醒编译
  4. 运行make install进行最后的复制即完成安装
  5. 将服务启动,并将开机启动脚本写入profile.d目录
上一篇:单元测试Struts2Spring项目的Action和Service(包含源码)


下一篇:div在Iframe 被遮挡解决方法