1.得到安装依赖 放在目录 usr/local/src中
wget https://ftp.pcre.org/pub/pcre/pcre-8.01.tar.gz
wget http://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-1.7.0.tar.gz
wget http://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-util-1.6.1.tar.gz
2.分别解压
tar zxvf apr-1.7.0.tar.gz
tar zxvf apr-util-1.6.1.tar.gz
tar zxvf pcre-8.01.tar.gz
tar zxvpf httpd-2.4.39.tar.gz //我本地有
3.对包进行分别编译
cd pcre-8.01
./configure --prefix=/opt/pcre
make && make install
cd …/ && cd apr-1.7.0/
./configure --prefix=/opt/apr
make && make install
cd …/ && cd apr-util-1.6.1/
./configure --prefix=/opt/apr-util --with-apr=/opt/apr --with-apr-util=/opt/apr-util --with-pcre=/opt/pcre
make && make install
装的过程发现报错 于是安装
yum install expat-devel
make && make install
cd …/ && cd httpd-2.4.39/
./configure --prefix=/opt/apache --with-apr=/opt/apr --with-apr-util=/opt/apr-util --with-pcre=/opt/pcre --with-included-apr
make -j4 && make install
4.进入apache目录
cd /opt/apache/bin
./httpd
curl localhost:80
本文详细介绍了如何从源码编译安装Apache及相关依赖,包括pcre、apr及apr-util等组件。通过wget下载各组件,tar命令解压,然后在指定目录下使用./configure配置,make编译,make install完成安装。过程中遇到的错误及解决方法也有所记录。
161

被折叠的 条评论
为什么被折叠?



