编译安装apache-----apr
1、根据上一个文档我们继续搭建
[root@localhost local]# cd software/
安装apr工具包
[root@localhost software]# wget https://archive.apache.org/dist/apr/apr-1.5.2.tar.bz2
解压缩
编辑[root@localhost apr-1.5.2]# vim configure
29065 行 RM='&RM -f'
执行脚本 ./configure
编译安装
make && make insatll
编译安装apache-----apr-util
下载apr-util的包
[root@localhost software]# wget https://archive.apache.org/dist/apr/apr-util-1.5.4.tar.bz2
解压缩
[root@localhost software]# tar -xvf apr-util-1.5.4.tar.bz2
进行配置
[root@localhost apr-util-1.5.4]# ./configure --with-apr=/usr/local/apr/bin/apr-1-config
编译安装
[root@localhost apr-util-1.5.4]# make && make install
把编译安装的apr工具,写入系统的动态库配置文件中,然后更新这些基础动态库
echo "/usr/local/apr/lib/" >> /etc/ld.so.conf
编译安装httpd
安装httpd包
wget https://downloads.apache.org/httpd/httpd-2.4.59.tar.bz2
解压缩 tar -xvf httpd-2.4.59.tar.bz2
编写配置脚本
vim config.sh
./configure \
--enable-modules=all \
--enable-mods-shared=all \
--enable-so \
--enable-rewrite \
--with-pcre \
--enable-ssl \
--with-mpm=prefork \
--with-apr=/usr/local/apr/bin/apr-1-config \
--with-apr-util=/usr/local/apr/bin/apu-1-config
执行改脚本 ./config.sh
编译安装
检查是否有httpd
拷贝apache默认的脚本,启动命令
[root@localhost htdocs]# cp /usr/local/apache2/bin/apachectl /etc/init.d/apache