设为首页 收藏本站
查看: 1090|回复: 0

[经验分享] 【问题记录】 Linux 安装 apache 遇到的一些问题

[复制链接]
累计签到:6 天
连续签到:1 天
发表于 2015-7-30 15:14:55 | 显示全部楼层 |阅读模式
以下为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.依次解压、安装
  附相关命令:



1 [iyunv@test ~]# tar -zxvf xxx.tar.gz
2 [iyunv@test ~]# ./configure --prefix=path  //path为安装路径
3 [iyunv@test ~]# make
4 [iyunv@test ~]# make install
  4. apache 设置指定库位置



1 [iyunv@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 [iyunv@test ~]# ./config -fPIC --prefix=path enable-shared
2 [iyunv@test ~]# ./config -t
3 [iyunv@test ~]# make depend
4 [iyunv@test ~]# make
5 [iyunv@test ~]# make test
6 [iyunv@test ~]# make install
  然后安装apache时指定



1 [iyunv@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
  错误日志:



1 make[4]: Entering directory `/home/zfh/httpd-2.2.9/modules/filters'
2 /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
3 /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
4 /usr/local/zlib//lib/libz.a: could not read symbols: Bad value //注意这行
5 collect2: ld returned 1 exit status
6 make[4]: *** [mod_deflate.la] Error 1
7 make[4]: Leaving directory `/home/zfh/httpd-2.2.9/modules/filters'
8 make[3]: *** [shared-build-recursive] Error 1
9 make[3]: Leaving directory `/home/zfh/httpd-2.2.9/modules/filters'
10 make[2]: *** [shared-build-recursive] Error 1
11 make[2]: Leaving directory `/home/zfh/httpd-2.2.9/modules'
12 make[1]: *** [shared-build-recursive] Error 1
13 make[1]: Leaving directory `/home/zfh/httpd-2.2.9'
14 make: *** [all-recursive] Error 1
15 [iyunv@localhost httpd-2.2.9]#
  错误为zlib库有问题,错误中有提示 recompile with -fPIC 即加上 -fPIC进行编译。
  
  解决方法:
  1. 找到zlib的源码安装包,或者直接下载一个 。地址:http://www.zlib.net/
  2. 执行以下相关命令



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



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

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-92345-1-1.html 上篇帖子: SpringMVC+Apache Shiro+JPA(hibernate)案例教学(四)基于Shiro验证用户权限,且给用户授权 下篇帖子: Apache Storm源码阅读笔记
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表