LinuX安装apache遇到坑的处理方案

作者 : 开心源码 本文共3029个字,预计阅读时间需要8分钟 发布时间: 2022-05-12 共199人阅读

apache安装错误error: APR not found处理办法:

这里摘录百度经验《apache安装错误error: APR not found处理办法》地址如下:

https://jingyan.baidu.com/article/4b07be3c5cd75348b380f3c3.html

下载依赖包

http://archive.apache.org/dist/apr/apr-1.4.5.tar.gz?

http://archive.apache.org/dist/apr/apr-util-1.3.12.tar.gz ?

?http://jaist.dl.sourceforge.net/project/pcre/pcre/8.10/pcre-8.10.zip

解压依赖包

第一步? cd? tar目录 (没有自己建立一个tar目录)

tar -xzvf apr-1.4.5.tar.gz

tar -xzvf apr-util-1.3.12.tar.gz

tar -xzvf pcre-8.10.zip(这种方法是错误的,所以我在网上找少量资料)

参见博客园蔷薇Nina《Apache Linux下Apache安装步骤》地址如下:

https://www.cnblogs.com/wcwnina/p/8029156.html

处理方法摘录如下:

[root@getlnx05 kerry]#?unzip pcre-8.33.zip

[root@getlnx05 kerry]#?cd pcre-8.33

[root@getlnx05 pcre-8.33]#?mkdir /usr/local/pcre

[root@getlnx05 pcre-8.33]#?./configure –prefix=/usr/local/pcre –with-apr=/usr/local/apr/bin/apr-1-config

但这里我想给各位提个醒,先安装yum是一个不错的处理方案

摘录cndn的拥春飞翔《linux下yum安装的最简方法》方法如下:

下载最新的yum-3.2.28.tar.gz并解压

1)wget?http://yum.baseurl.org/download/3.2/yum-3.2.28.tar.gz

? ? ?tar xvf yum-3.2.28.tar.gz

2)运行安装

? ? touch/etc/ yum.conf

? ? cd yum-3.2.28

? ? ?yummain.py install?yum

处理g++方案如下

参见博客园蔷薇Nina《Apache Linux下Apache安装步骤》地址如下:

https://www.cnblogs.com/wcwnina/p/8029156.html

Apache安装过程

Step 1:安装包gcc或者gcc-c++

[root@getlnx05 pcre-8.33]#?yum list gcc-c++

Loaded plugins: product-id, security, subscription-manager

Updating Red Hat repositories.

Available Packages

gcc-c++.x86_644.1.2-51.el5??????????????????????????????????????????????????????????????? rhel-debuginfo

[root@getlnx05 pcre-8.33]#?yum list gcc

Loaded plugins: product-id, security, subscription-manager

Updating Red Hat repositories.

Installed Packages

gcc.x86_64??????????????????????????????????????????????????????????????????? 4.1.2-51.el5??????????????????????????????????????????????????????????????????? installed

[root@getlnx05 pcre-8.33]#?rpm -q gcc

gcc-4.1.2-51.el5

从上面可见gcc包已经安装,缺少gcc-c++包,那么接下来安装包gcc-c++,假如此处不安装该包,后面安装过程中会报错。(编译C)

[root@getlnx05 pcre-8.33]#yum install? gcc-c++

处理libtool问题

二、 libtool编译?

1. ?网站上下载libtool的源码包

2. 解压源码包之后,进入包目录,执行以下命令

./configure –prefix=/home/lizj/0002_linux/libtool/libtool_install ?# 该路径依据你自己的系统设置

make &&make install

问题4:安装前忘了先安装APR相关包

[root@getlnx05 httpd-2.4.6]#? ./configure –prefix=/usr/local/appache/

checking for chosen layout… Apache

checking for working mkdir -p… yes

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

checking for egrep… /bin/grep -E

checking build system type… x86_64-unknown-linux-gnu

checking host system type… x86_64-unknown-linux-gnu

checking target system type… x86_64-unknown-linux-gnu

configure:

configure: Configuring Apache Portable Runtime library…

configure:

checking for APR… no

configure: error: APR not found.? Please read the documentation.

[root@getlnx05 httpd-2.4.6]#

这里没有提出处理方案:

我查cndn中nange_nice写<<安装apr-util 执行make命令时报错的处理方法>>有效

摘录如下:

地址如下:

https://blog.csdn.net/nange_nice/article/details/75785189

但还需要最后一步,来自yzkwork《Centos安装 Apache2.4提醒 APR not found的处理办法》方法

https://www.cnblogs.com/yuzhaokai0523/p/4382974.html

摘录如下:

2.最后编译Apache时加上:–with-apr=/usr/local/apr \–with-apr-util=/usr/local/apr-util/ \–with-pcre=/usr/local/pcre

./configure –prefix=/usr/local/apache2.4–with-apr=/usr/local/apr –with-apr-util=/usr/local/apr-util –with-pcre=/usr/local/pcre

如图所示:

说明
1. 本站所有资源来源于用户上传和网络,如有侵权请邮件联系站长!
2. 分享目的仅供大家学习和交流,您必须在下载后24小时内删除!
3. 不得使用于非法商业用途,不得违反国家法律。否则后果自负!
4. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解!
5. 如有链接无法下载、失效或广告,请联系管理员处理!
6. 本站资源售价只是摆设,本站源码仅提供给会员学习使用!
7. 如遇到加密压缩包,请使用360解压,如遇到无法解压的请联系管理员
开心源码网 » LinuX安装apache遇到坑的处理方案

发表回复