httpd的源码安装

httpd的源码安装

下载httpd源码安装包
1)下载地址:http://mirror.bit.edu.cn/apache/httpd/
# wget http://mirror.bit.edu.cn/apache/httpd/httpd-2.4.39.tar.gz

2)下载到当前目录之后解压:
# tar xzf httpd-2.4.39.tar.gz

3)解压到当前文件夹之后进入到解压后的目录开始编译安装:
#cd httpd-2.4.39
(可以看到README或者INSTALL这样的文件,如果是不熟悉的源码安装包,可以看文件描述的安装方法)
1、./configure --prefix=/usr/local/application/apache 检查安装环境并且指定安装路径。
检查之后有报错:
error: APR not found. Please read the documentation
找不到apr包
rpm -q apr
[root@centos7 bin]# rpm -q apr 用rpm查看apr已经安装了,但是却显示找不到
apr-1.4.8-5.el7.x86_64

原因:
由于没有安装apr头文件,导致找不到apr库。
解决方法:用yum search来查找以apr-devel命名的包
[root@centos7 http]# yum search apr
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
============================================== N/S matched: apr ===============================================
apr-devel.x86_64 : APR library development kit
apr-util-devel.x86_64 : APR utility library development kit
apr.x86_64 : Apache Portable Runtime library
apr-util.x86_64 : Apache Portable Runtime Utility library
haproxy.x86_64 : TCP/HTTP proxy and load balancer for high availability environments

这里由于apr-util和pcre也有同样的问题所以一起安装了:
# yum -y install apr-devel.x86_64 apr-util-devel.x86_64 pcre-devel.x86_64

也可以用rpm -ivh安装:
# cd /mnt/Packages
# ls | grep rpa-devel
apr-devel-1.4.8-5.el7.x86_64.rpm
# rpm -qpl apr-devel-1.4.8-5.el7.x86_64.rpm 查看包里面的文件,都是以.h结尾的头文件。

然后# ./configure --prefix=/usr/local/application/apache 不会报错了。
(如果这里缺少c++编译环境,需要安装的是gcc-c++)

2、编译:
# make -j 4 加快编译速度

3、安装:
# make install

httpd安装完成。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值