以下为linux上安装apache时自己遇到的一些问题,记录在这,以后遇到时也会不定时更新...

一.安装Apache提示APR not found的解决办法

解决方法:

1. 网站 http://apr.apache.org/download.cgi 下载 apr-1.5.1.tar.gz 、apr-util-1.5.4.tar.gz

2. 网站 http://www.pcre.org/ 下载 pcre-8.36.tar.gz

3.依次解压、安装

附相关命令:

 [root@test ~]# tar -zxvf xxx.tar.gz
[root@test ~]# ./configure --prefix=path //path为安装路径
[root@test ~]# make
[root@test ~]# make install

4. apache 设置指定库位置

 [root@test ~]#  ./configure --prefix=/usr/local/httpd-2.4.10 --with-apr=apr-path  --with-apr-util=aprutil-path  --with-pcre=pcre-path  --enable-so  //把path修改成各自的安装路径即可

5. make && make install

二、/xxx/httpd-2.4.x/support/ab.c:2273: undefined reference to `TLSv1_2_client_method'、/xxx/httpd-2.4.x/support/ab.c:2271: undefined reference to `TLSv1_1_client_method'

错误日志:

...
ab.o: In function `main':
/xxx/httpd-2.4.x/support/ab.c:2273: undefined reference to `TLSv1_2_client_method'
/xxx/httpd-2.4.x/support/ab.c:2271: undefined reference to `TLSv1_1_client_method'
collect2: ld returned 1 exit status
make[2]: *** [ab] Error 1
make[2]: Leaving directory `/xxx/httpd-2.4.x/support'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/xxx/httpd-2.4.x/support'
make: *** [all-recursive] Error 1

解决方法:

open-ssl 库有问题, 安装时需要加上

1 [root@test ~]# ./config -fPIC --prefix=path enable-shared
2 [root@test ~]# ./config -t
3 [root@test ~]# make depend
4 [root@test ~]# make
5 [root@test ~]# make test
6 [root@test ~]# make install

然后安装apache时指定

 [root@test ~]# ./configure --prefix=/usr/local/httpd-2.4.10  --with-ssl=openssl-path --enable-so

三、relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC

错误日志:

 make[4]: Entering directory `/home/zfh/httpd-2.2.9/modules/filters'
/home/user/httpd-2.2.9/srclib/apr/libtool --silent --mode=link gcc -g -O2 -pthread -L/usr/local/zlib//lib -o mod_deflate.la -rpath /usr/local/apache2/modules -module -avoid-version mod_deflate.lo -lz
/usr/bin/ld: /usr/local/zlib//lib/libz.a(crc32.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/usr/local/zlib//lib/libz.a: could not read symbols: Bad value //注意这行
collect2: ld returned 1 exit status
make[4]: *** [mod_deflate.la] Error 1
make[4]: Leaving directory `/home/zfh/httpd-2.2.9/modules/filters'
make[3]: *** [shared-build-recursive] Error 1
make[3]: Leaving directory `/home/zfh/httpd-2.2.9/modules/filters'
make[2]: *** [shared-build-recursive] Error 1
make[2]: Leaving directory `/home/zfh/httpd-2.2.9/modules'
make[1]: *** [shared-build-recursive] Error 1
make[1]: Leaving directory `/home/zfh/httpd-2.2.9'
make: *** [all-recursive] Error 1
[root@localhost httpd-2.2.9]#

错误为zlib库有问题,错误中有提示 recompile with -fPIC 即加上 -fPIC进行编译。

解决方法:

1. 找到zlib的源码安装包,或者直接下载一个 。地址:http://www.zlib.net/

2. 执行以下相关命令

[root@test ~]# tar -zxvf zlib-1.2.3.tar.gz
[root@test ~]# cd zlib-1.2.3
[root@test ~]# ./configure --prefix=path //path为自定义安装路径
[root@test ~]# vi Makefile
[root@test ~]# 找到 CFLAGS=-O3 -DUSE_MMAP
[root@test ~]# 在后面加入-fPIC,即变成CFLAGS=-O3 -DUSE_MMAP -fPIC
[root@test ~]# make && make install

3. 安装apache,添加 --with-zlib-1.2.3=zlib-path 参数

1 [root@test ~]#  ./configure --prefix=/usr/local/httpd-2.4.10 --with-zlib-1.2.3=zlib-path  --enable-so  //把path修改成各自的安装路径即可

未完待续...

【问题记录】 Linux 安装 apache 遇到的一些问题的更多相关文章

  1. linux安装apache

    我的linux是用阿里云上的,版本是CentOS 6.5 apache依赖于apr.apr-util和pcre,所以需要先安装这三个 apr(包含apr.apr-util和apr-iconv)是apa ...

  2. linux安装apache的纠结过程

    本以为linux下安装apache是件很简单的过程.三命令就可以搞定,jxvf解压,make 编译,make install 安装就OK了.没想到这个过程还颇费周折.可能和环境有关吧.先说一下我的环境 ...

  3. linux 安装 apache

    1.  系统基本信息 CentOS  6.4   内存2G  硬盘 200G   cpu 4核  (cat /proc/cpuinfo |grep 'processor'|wc -l  查看cpu核数 ...

  4. linux安装apache软件的过程

    参考官方安装指导:http://httpd.apache.org/docs/2.4/install.html 1.下载依赖包 apr/apr-util/pcre 2.解压依赖包 3.安装apr 进入安 ...

  5. Linux安装Apache报错:Cannot find a valid baseurl for repo: base/7/x86_64解决方案

    最近使用CentOS7学习,安装安装Apache时候,使用yum安装Apache报错:本文适合CentOS7和RHEL7 # yum install httpd 出现:cannot find a va ...

  6. LInux——安装Apache

    在安装Apache的httpd的时候经常会遇到: configure: error: APR not found .  Please read the documentation. configure ...

  7. Linux安装apache服务

    1.通过yum包下载安装httpd yum -y install httpd*(等待安装) 到下面就安装完毕 2.启动apache服务 service httpd restart 3.现在就可以查看a ...

  8. linux 安装Apache服务器

    这篇文章先别看,,有些地方我不是很明白,写错了一些地方,正在咨询会linux的大神 安装好Apache就可以用Http访问或者下载电脑的文件了 我还是用 连接我的linux电脑 咱把Apache安装到 ...

  9. Linux安装Apache常见报错(二)

    配置Apache提示报错configure error: APR could not be located. Please use the --with-apr option. 解决办法: ./con ...

随机推荐

  1. mysql数据库学习小结

    数据库的学习可以从以下几个层次了解掌握,这样思路清晰后后面不管怎么变化都可以随时应变: 1.mysql基础知识 2.操作数据库的方法,增 删 改 查 3.jdbc连接数据库,工作原理 难点重点,如:P ...

  2. React学习笔记3

    React的生命周期   生命周期分为三个阶段   1.mounted(初始化的时候) 当我们看见页面元素从JSX变成了DOM节点时,React组件已经被载入(mounted)到页面中了   2.up ...

  3. asp.net winform 界面传值

    第一种 //form1 //静态传值 public static string Chuanzhi; string Chuanzhi = textbox.text; //form2 string Chu ...

  4. WPF 控件库——可拖动选项卡的TabControl

    WPF 控件库系列博文地址: WPF 控件库——仿制Chrome的ColorPicker WPF 控件库——仿制Windows10的进度条 WPF 控件库——轮播控件 WPF 控件库——带有惯性的Sc ...

  5. 扩展卢卡斯定理(Exlucas)

    题目链接 戳我 前置知识 中国剩余定理(crt)或扩展中国剩余定理(excrt) 乘法逆元 组合数的基本运用 扩展欧几里得(exgcd) 说实话Lucas真的和这个没有什么太大的关系,但是Lucas还 ...

  6. 析构函数的调用------新标准c++程序设计

    示例1: #include<iostream> using namespace std; class CDemo{ public: ~CDemo(){cout<<"d ...

  7. 《C#多线程编程实战》1.11 Monitor.TryEnter()避免死锁

    这章的内容是真的有意思 特别是代码. 先贴上代码: class Program { static void Main(string[] args) { object lock1 = new objec ...

  8. 进阶Kotlin-常见关键字

    常见Kotlin 的关键字   一些常见的语法,我没有写注释. 前面基础的kotlin语法已经弄完了. 现在是高阶kotlin的语法啊. 包括,面向对象,lambad等. 其中面向对象的三大特点:封装 ...

  9. Javascript判断两个点(经纬度)的距离,以及是否在某个区域内(经纬度字符串)

    JS计算两个点(经纬度)的距离 function getGreatCircleDistance(lat1, lng1, lat2, lng2) { var EARTH_RADIUS = 6378137 ...

  10. 【bzoj1014】: [JSOI2008]火星人prefix 平衡树-字符串-hash-二分

    [bzoj1014]: [JSOI2008]火星人 用平衡树维护字符串的hash 然后询问的时候二分一下就好了 /* http://www.cnblogs.com/karl07/ */ #includ ...