前端常见问题
选课中心 APP下载
当前位置:首页 > 技能类 > 前端 > 常见问题 > 基于Centoss7编译安装httpd2.4

基于Centoss7编译安装httpd2.4

更新时间:2020-09-16 19:39:55 来源: 阅读量:

【摘要】 基于Centoss7编译安装httpd2.4考必过小编为大家整理了关于基于Centoss7编译安装httpd2.4的信息,希望可以帮助到大家!

基于Centoss7编译安装httpd2.4

基于Centoss7编译安装httpd2.4

标签:ossusesha指定makeFixchmod存在util

#!/bin/bash
#设置变量
WORKDIR=/apps
#安装需要的环境包
yum -y install gcc make pcre-devel openssl-devel expat-devel
#在指定目录下下载压缩文件 
mkdir /apps
cd ${WORKDIR}
 wget https://mirrors.bfsu.edu.cn/apache//apr/apr-1.7.0.tar.gz
 wget https://mirrors.bfsu.edu.cn/apache//apr/apr-util-1.6.1.tar.gz
 wget https://mirrors.tuna.tsinghua.edu.cn/apache//httpd/httpd-2.4.46.tar.bz2
#解压包
tar xvf apr-1.7.0.tar.gz 
tar xvf apr-util-1.6.1.tar.gz
tar xvf httpd-2.4.46.tar.bz2
#移动apr和ap-util至srcpb目录中,并去掉版本号
mv apr-1.7.0 httpd-2.4.46/srcpb/apr
mv apr-util-1.6.1 httpd-2.4.46/srcpb/apr-util
#开始编译安装
cd httpd-2.4.46/
./configure --prefix=/apps/httpd24 --enable-so --enable-ssl --enable-cgi --enable-rewrite --with-zpb --with-pcre --with-included-apr --enable-modpes=most --enable-mpms-shared=all --with-mpm=prefork 
make -j 4 && make install
#创建用户
if id apache ;then
   echo apache 用户已经存在无需创建
else
   useradd -s /sbin/nologin -r apache
fi
#修改用户和组
cd ${WORKDIR}/httpd24/conf
sed -Ei.bak ‘/^User/s/daemon/apache/‘ httpd.conf
sed -Ei.bak ‘/^Group/s/daemon/apache/‘ httpd.conf
#配置环境变量
echo PATH=/apps/httpd24/bin:$PATH >> /etc/profile.d/httpd24.sh
source /etc/profile.d/httpd24.sh
#配置帮助
echo "MANDATORY_MANPATH    /app/httpd24/man" >> /etc/man_db.conf
#设置开机自动启动
echo "/apps/httpd24/bin/apachectl start" >> /etc/rc.d/rc.local
chmod +x /etc/rc.d/rc.local

基于Centoss7编译安装httpd2.4

标签:ossusesha指定makeFixchmod存在util

以上就是基于Centoss7编译安装httpd2.4的内容,更多资讯请及时关注考必过网站,最新消息小编会第一时间发布,大家考试加油!

分享到: 编辑:dada