linux apr文件解压失败,Apache httpd 源码安装 提示APR错误 :解决方法

Apache httpd 源码安装 提示APR错误

1、下载 HTTPD 源码包

91c9ad57d402ae46be355c366ee73470.png

06a0d7e0558fb8575c7cb19bad24a916.png

4faf7711e55a0b56d1e207a8e28d21fa.png

选择 中国域名 cn 的站点:

23e6012ff21c709976059b103637d06a.png

找到httpd:

cf278cb2df7003e84c95fc5fcaf65bfd.png

2、回到Linux CentOS 中 ,使用wget名令下载httpd压缩包:

[root@magedu ~]# wget https://mirrors.tuna.tsinghua.edu.cn/apache/httpd/httpd-2.4.38.tar.gz

--2019-07-21 13:16:50-- https://mirrors.tuna.tsinghua.edu.cn/apache/httpd/httpd-2.4.38.tar.gz

Resolving mirrors.tuna.tsinghua.edu.cn (mirrors.tuna.tsinghua.edu.cn)... 101.6.8.193, 2402:f000:1:408:8100::1

Connecting to mirrors.tuna.tsinghua.edu.cn (mirrors.tuna.tsinghua.edu.cn)|101.6.8.193|:443... connected.

HTTP request sent, awaiting response... 200 OK

Length: 9187294 (8.8M) [application/x-gzip]

3、解压 下载文件;

[root@magedu ~]# tar zxvf httpd-2.4.38.tar.gz

httpd-2.4.38/

httpd-2.4.38/config.layout

httpd-2.4.38/configure.in

httpd-2.4.38/Makefile.win

httpd-2.4.38/configure

httpd-2.4.38/test/

httpd-2.4.38/test/test_parser.c

httpd-2.4.38/test/check_chunked

httpd-2.4.38/test/make_sni.sh

httpd-2.4.38/test/README

httpd-2.4.38/test/test-writev.c

httpd-2.4.38/test/test_limits.c

httpd-2.4.38/test/tcpdumpscii.txt

4、在解压之前,先安装编译器和开发工具包;

` [root@magedu ~]# yum install gcc "Developent Tools"`

5、进到解压的httpd目录,查看 configure 的帮助信息

[root@magedu ~]# cd httpd-2.4.38/

[root@magedu httpd-2.4.38]# ./configure --help

6、使用配置文件安装

[root@magedu httpd-2.4.38]# ./configure --prefix=/usr/local/httpd --sysconfdir=/etc/httpd

checking for chosen layout... Apache

checking for working mkdir -p... yes

checking for grep that handles long lines and -e... /usr/bin/grep

checking for egrep... /usr/bin/grep -E

checking build system type... x86_64-pc-linux-gnu

checking host system type... x86_64-pc-linux-gnu

checking target system type... x86_64-pc-linux-gnu

configure:

configure: Configuring Apache Portable(移植) Runtime library(运行库)...

configure:

checking for APR... no

configure: error: APR not found. Please read the documentation.(错误:APR没找到,请阅读文档)

提示报错:

configure: error: APR not found. Please read the documentation.(错误:APR没找到,请阅读文档)

提示没有找到 APR,使用yum 来安装,但安装时一定要注意,提示要装哪个软件,一般要在软件的后面加上devel,也就是说要装缺少软件的开发工具,比如这个提示apr,那就要装 apr-devel:

#yum install apr-devel

安装完成之后,再./configure;

特别注意,这个期间不能切换到其他目录中,整个安装的过程一定要在这安装软件的根目录中;

[root@magedu httpd-2.4.38]# ./configure --prefix=/usr/local/httpd --sysconfdir=/etc/httpd

checking for APR-util... no

configure: error: APR-util not found. Please read the documentation.

提示缺少apr-util,接着安装apr-util的开发版,即 apr-util-devel

root@magedu httpd-2.4.39]# yum install apr-util-devel

Loaded plugins: fastestmirror, langpacks

Loading mirror speeds from cached hostfile

Resolving Dependencies

--> Running transaction check

--> Processing Dependency: libdb-devel(x86-64) for package: apr-util-devel-1.5.2-6.el7.x86_64

--> Processing Dependency: libaprutil-1.so.0()(64bit) for package: apr-util-devel-1.5.2-6.el7.x86_64

--> Running transaction check

...

安装完成之后,再./configure

[root@magedu httpd-2.4.38]# ./configure --prefix=/usr/local/httpd --sysconfdir=/etc/httpd

checking for pcre-config... false

configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/

提示pcre报错,再安装pcre,这个pcre也得装开发版,即安装pcre-devel:

[root@magedu httpd-2.4.39]# yum install pcre-devel -y

安装完成之后,再./configure

# ./configure --prefix=/usr/local/httpd --sysconfdir=/etc/httpd

checking for chosen layout... Apache

checking for working mkdir -p... yes

checking for grep that handles long lines and -e... /usr/bin/grep

checking for egrep... /usr/bin/grep -E

checking build system type... x86_64-pc-linux-gnu

checking host system type... x86_64-pc-linux-gnu

checking target system type... x86_64-pc-linux-gnu

configure:

...

config.status: creating include/ap_config_auto.h

config.status: executing default commands

configure: summary of build options:

Server Version: 2.4.39

C compiler: gcc -std=gnu99

CFLAGS: -pthread

CPPFLAGS: -DLINUX -D_REENTRANT -D_GNU_SOURCE

LDFLAGS:

LIBS:

C preprocessor: gcc -E

终于成功了,使用echo$?检查是否成功:

[root@magedu httpd-2.4.39]# echo $?

0

然后使用make

[root@magedu httpd-2.4.39]# make

Making all in srclib

make[1]: Entering directory `/soft/httpd-2.4.39/srclib'

make[1]: Leaving directory `/soft/httpd-2.4.39/srclib'

Making all in os

最后:make install

[root@magedu httpd-2.4.39]#make install

7、完成之后,配置PATH变量、man手册,完成后,启动服务,登陆地址,出现测试页,则表示安装成功;

66d517ebacfc681e6445103115c856f2.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值