前言
apache源码安装需要以来apr apr-util
网盘链接:https://pan.baidu.com/s/1oK8_jOKTRViEZUMifYpEgw 提取码:kkq4
mkdir /user/local/apache 添加三个tar包 apr-util-1.6.1.tar.gz,apr-1.7.0.tar.gz,httpd-2.4.51.tar.gz
tar -zxvf apr-util-1.6.1.tar.gz
tar -zxvf apr-1.7.0.tar.gz
tar -zxvf httpd-2.4.51.tar.gz
#重命名
mv apr-1.7.0 ./apr
mv apr-util-1.6.1 ./apr-util
mv httpd-2.4.51 ./httpd
需要安装的依赖包有 gcc expat-devel openssl-devel pcre pcre-devel
yum install gcc
yum install -y expat-devel
yum install openssl-devel
yum install -y pcre pcre-devel
yum install pcre-devel
进入apr目录
./configure --prefix=/usr/local/apache/apr/
make && make install
进入apr-util目录
./configure --prefix=/usr/local/apache/apr-util --with-apr=/usr/local/apache/apr/
make && make install
进入httpd目录
./configure --prefix=/usr/local/apache/httpd --with-apr=/usr/local/apache/apr --with-apr-util=/usr/local/apache/apr-util
make && make install
在启动apache之前需要配置 httpd.conf 中的 ServerName
/usr/local/apache/httpd/apachectl start 启动apache