当前位置:   article > 正文

编译httpd-2.4.46的RPM包_lua-devel is needed by

lua-devel is needed by

目录

一、下载源码

二、编译&排错

2.1、第一次编译,解决依赖包问题。

2.2、第二次编译,解决anaconda导致的环境变量问题

2.3、第三次编译,解决apr版本过低问题


提供 apr-1.7.0、httpd-2.4.46 的RPM包下载。

apr-1.7.0-bundle.zip

httpd-2.4.46 -bundle.zip

一、下载源码

  1. [root@lingmk ~]# cd rpmbuild/SOURCES/
  2. [root@lingmk SOURCES]#
  3. [root@lingmk SOURCES]# wget https://mirror.bit.edu.cn/apache//httpd/httpd-2.4.46.tar.bz2
  4. …………
  5. [root@lingmk SOURCES]# sha256sum httpd-2.4.46.tar.bz2
  6. 740eddf6e1c641992b22359cabc66e6325868c3c5e2e3f98faf349b61ecf41ea httpd-2.4.46.tar.bz2
  7. [root@lingmk SOURCES]#
  8. [root@lingmk SOURCES]# tar xvjf httpd-2.4.46.tar.bz2
  9. …………
  10. [root@lingmk SOURCES]# cd httpd-2.4.46/
  11. [root@lingmk httpd-2.4.46]# ll | grep spec
  12. -rw-r--r-- 1 root 40 17313 Aug 1 22:11 httpd.spec
  13. [root@lingmk httpd-2.4.46]# cp httpd.spec ../../SPECS/
  14. [root@lingmk httpd-2.4.46]# cd ../../SPECS/

二、编译&排错

2.1、第一次编译,解决依赖包问题。

报错需要lua-devel,安装之。

  1. [root@lingmk SPECS]# rpmbuild -ba httpd.spec
  2. error: Failed build dependencies:
  3. lua-devel is needed by httpd-2.4.46-1.x86_64
  4. [root@lingmk SPECS]#
  5. [root@lingmk SPECS]# yum install lua-devel -y

2.2、第二次编译,解决anaconda导致的环境变量问题

报错 /usr/lib64/libapr-1.so: undefined reference to `uuid_generate@UUID_1.0'。

  1. 使用/usr/lib64/libapr-1.so时遇到一个未定义的uuid……。
  2. 我们用ldd命令看看/usr/lib64/libapr-1.so的库依赖,包含uuid的是libuuid.so.1。
  3. 我们再locate命令看看哪里有libuuid.so.1,发现在anaconda里面也有libuuid.so.1。

原因就是这个冲突导致的。我们可以查看PATH环境变量,果然anaconda排在前面。我们使用conda deactivate取消anaconda的环境变量。再次编译。

  1. [root@lingmk SPECS]# rpmbuild -ba httpd.spec
  2. …………
  3. /usr/lib64/libapr-1.so: undefined reference to `uuid_generate@UUID_1.0'
  4. collect2: error: ld returned 1 exit status
  5. make[1]: *** [httpd] Error 1
  6. make[1]: Leaving directory `/root/rpmbuild/BUILD/httpd-2.4.46'
  7. make: *** [all-recursive] Error 1
  8. error: Bad exit status from /var/tmp/rpm-tmp.7JVKVB (%build)
  9. RPM build errors:
  10. Bad exit status from /var/tmp/rpm-tmp.7JVKVB (%build)
  11. [root@lingmk SPECS]#
  12. [root@lingmk SPECS]# ldd /usr/lib64/libapr-1.so | grep uuid
  13. libuuid.so.1 => /lib64/libuuid.so.1 (0x00007fa4f959d000)
  14. [root@lingmk SPECS]#
  15. [root@lingmk SPECS]# locate libuuid.so.1
  16. /data/anaconda3/lib/libuuid.so.1
  17. /data/anaconda3/lib/libuuid.so.1.0.0
  18. /data/anaconda3/pkgs/libuuid-1.0.3-h1bed415_2/lib/libuuid.so.1
  19. /data/anaconda3/pkgs/libuuid-1.0.3-h1bed415_2/lib/libuuid.so.1.0.0
  20. /usr/lib64/libuuid.so.1
  21. /usr/lib64/libuuid.so.1.3.0
  22. [root@lingmk SPECS]#
  23. [root@lingmk SPECS]# echo $PATH
  24. /data/anaconda3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
  25. [root@lingmk SPECS]#
  26. [root@lingmk SPECS]# conda deactivate
  27. [root@lingmk SPECS]# echo $PATH
  28. /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
  29. [root@lingmk SPECS]#

2.3、第三次编译,解决apr版本过低问题

报错找不到文件/root/rpmbuild/BUILDROOT/httpd-2.4.46-1.x86_64/usr/lib64/httpd/modules/mod_mpm_event.so。

据说是由于apr(Apache Portable Runtime)的版本太低,CentOS7自带的是1.4.x版本的,需要将升级apr升级到1.5.x以上才行,目前最新的是1.7.0版本。我们先完成支线任务编译apr,再继续编译apache。编译成功。

  1. [root@lingmk SPECS]# rpmbuild -ba httpd.spec
  2. …………
  3. + grep TEXTREL
  4. + exit 0
  5. Processing files: httpd-2.4.46-1.x86_64
  6. error: File not found: /root/rpmbuild/BUILDROOT/httpd-2.4.46-1.x86_64/usr/lib64/httpd/modules/mod_mpm_event.so
  7. Executing(%doc): /bin/sh -e /var/tmp/rpm-tmp.fP4iVM
  8. + umask 022
  9. + cd /root/rpmbuild/BUILD
  10. + cd httpd-2.4.46
  11. + DOCDIR=/root/rpmbuild/BUILDROOT/httpd-2.4.46-1.x86_64/usr/share/doc/httpd-2.4.46
  12. + export DOCDIR
  13. + /usr/bin/mkdir -p /root/rpmbuild/BUILDROOT/httpd-2.4.46-1.x86_64/usr/share/doc/httpd-2.4.46
  14. + cp -pr ABOUT_APACHE /root/rpmbuild/BUILDROOT/httpd-2.4.46-1.x86_64/usr/share/doc/httpd-2.4.46
  15. + cp -pr README /root/rpmbuild/BUILDROOT/httpd-2.4.46-1.x86_64/usr/share/doc/httpd-2.4.46
  16. + cp -pr CHANGES /root/rpmbuild/BUILDROOT/httpd-2.4.46-1.x86_64/usr/share/doc/httpd-2.4.46
  17. + cp -pr LICENSE /root/rpmbuild/BUILDROOT/httpd-2.4.46-1.x86_64/usr/share/doc/httpd-2.4.46
  18. + cp -pr NOTICE /root/rpmbuild/BUILDROOT/httpd-2.4.46-1.x86_64/usr/share/doc/httpd-2.4.46
  19. + exit 0
  20. RPM build errors:
  21. File not found: /root/rpmbuild/BUILDROOT/httpd-2.4.46-1.x86_64/usr/lib64/httpd/modules/mod_mpm_event.so
  22. [root@lingmk SPECS]#
  23. [root@lingmk SPECS]# cd ../SOURCES/
  24. [root@lingmk SOURCES]# wget https://mirrors.bfsu.edu.cn/apache//apr/apr-1.7.0.tar.bz2
  25. [root@lingmk SOURCES]# sha256sum apr-1.7.0.tar.bz2
  26. e2e148f0b2e99b8e5c6caa09f6d4fb4dd3e83f744aa72a952f94f5a14436f7ea apr-1.7.0.tar.bz2
  27. [root@lingmk SOURCES]#
  28. [root@lingmk SOURCES]# tar xvjf apr-1.7.0.tar.bz2
  29. [root@lingmk SOURCES]# cp apr-1.7.0/apr.spec ../SPECS/
  30. [root@lingmk SOURCES]# cd ../SPECS/
  31. [root@lingmk SPECS]#
  32. [root@lingmk SPECS]# rpmbuild -ba apr.spec
  33. …………
  34. Wrote: /root/rpmbuild/SRPMS/apr-1.7.0-1.src.rpm
  35. Wrote: /root/rpmbuild/RPMS/x86_64/apr-1.7.0-1.x86_64.rpm
  36. Wrote: /root/rpmbuild/RPMS/x86_64/apr-devel-1.7.0-1.x86_64.rpm
  37. Wrote: /root/rpmbuild/RPMS/x86_64/apr-debuginfo-1.7.0-1.x86_64.rpm
  38. Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.FxdyDh
  39. + umask 022
  40. + cd /root/rpmbuild/BUILD
  41. + cd apr-1.7.0
  42. + rm -rf /root/rpmbuild/BUILDROOT/apr-1.7.0-1.x86_64
  43. + exit 0
  44. [root@lingmk SPECS]# cd ../RPMS/x86_64/
  45. [root@lingmk x86_64]# yum localinstall apr-1.7.0-1.x86_64.rpm apr-devel-1.7.0-1.x86_64.rpm
  46. [root@lingmk x86_64]# cd ../../SPECS/
  47. [root@lingmk SPECS]# rpmbuild -ba httpd.spec
  48. …………
  49. Wrote: /root/rpmbuild/SRPMS/httpd-2.4.46-1.src.rpm
  50. Wrote: /root/rpmbuild/RPMS/x86_64/httpd-2.4.46-1.x86_64.rpm
  51. Wrote: /root/rpmbuild/RPMS/x86_64/httpd-devel-2.4.46-1.x86_64.rpm
  52. Wrote: /root/rpmbuild/RPMS/x86_64/httpd-manual-2.4.46-1.x86_64.rpm
  53. Wrote: /root/rpmbuild/RPMS/x86_64/httpd-tools-2.4.46-1.x86_64.rpm
  54. Wrote: /root/rpmbuild/RPMS/x86_64/mod_authnz_ldap-2.4.46-1.x86_64.rpm
  55. Wrote: /root/rpmbuild/RPMS/x86_64/mod_lua-2.4.46-1.x86_64.rpm
  56. Wrote: /root/rpmbuild/RPMS/x86_64/mod_proxy_html-2.4.46-1.x86_64.rpm
  57. Wrote: /root/rpmbuild/RPMS/x86_64/mod_ssl-2.4.46-1.x86_64.rpm
  58. Wrote: /root/rpmbuild/RPMS/x86_64/httpd-debuginfo-2.4.46-1.x86_64.rpm
  59. Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.nL1uTo
  60. + umask 022
  61. + cd /root/rpmbuild/BUILD
  62. + cd httpd-2.4.46
  63. + rm -rf /root/rpmbuild/BUILDROOT/httpd-2.4.46-1.x86_64
  64. + exit 0
  65. [root@lingmk SPECS]#

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Guff_9hys/article/detail/936496
推荐阅读
相关标签
  

闽ICP备14008679号