Httpd服务进阶知识-LAMP源码编译安装

                                                作者:尹正杰

版权声明:原创作品,谢绝转载!否则将追究法律责任。

  想必大家都知道,动态资源交给fastcgi程序处理,静态资源依旧由httpd服务器处理 。我曾经将httpd,fastcgi,mariadb服务器分开部署(要笔记的下伙伴戳我),httpd服务和fastcgi服务(实际上在就是php-fpm软件包)之间通信是基于php-fpm默认的9000端口。但实际工作中,我们大多数是将httpd服务和fastcgi服务放在同一台服务器上运行,在同一台服务器上运行的话在基于端口访问效率没有本地unix socket效率高。

  而想要使用本地套接字进行通信需要httpd版本要在2.4.9版本以上,但CentOS7.6默认安装的版本只有2.4.6,因此我们来一起手动编译安装一下LAMP服务。

一.查看httpd模块对fastcgi模块的支持

1>.查看CentOS7.6默认的源

  1. [root@node101.yinzhengjie.org.cn ~]# yum info httpd
  2. Loaded plugins: fastestmirror
  3. Loading mirror speeds from cached hostfile
  4. * base: mirrors.tuna.tsinghua.edu.cn
  5. * epel: mirrors.yun-idc.com
  6. * extras: mirrors.tuna.tsinghua.edu.cn
  7. * updates: mirrors.tuna.tsinghua.edu.cn
  8. Installed Packages
  9. Name : httpd
  10. Arch : x86_64
  11. Version : 2.4.
  12. Release : .el7.centos
  13. Size : 9.4 M
  14. Repo : installed
  15. From repo : base
  16. Summary : Apache HTTP Server
  17. URL : http://httpd.apache.org/
  18. License : ASL 2.0
  19. Description : The Apache HTTP Server is a powerful, efficient, and extensible
  20. : web server.
  21.  
  22. [root@node101.yinzhengjie.org.cn ~]#
  23. [root@node101.yinzhengjie.org.cn ~]#
  24. [root@node101.yinzhengjie.org.cn ~]# rpm -q httpd
  25. httpd-2.4.-.el7.centos.x86_64
  26. [root@node101.yinzhengjie.org.cn ~]#

2>.查看httpd官网支持fastcgi的配置文档

  1. 博主推荐阅读:
  2.   http://httpd.apache.org/docs/2.4/mod/mod_proxy_fcgi.html

二.编译安装httpd服务

1>.安装环境说明

  1. node101.yinzhengjie.org.cn:
  2. 安装httpd,php服务
  3.  
  4. node108.yinzhengjie.org.cn:
  5. 安装Mariadb数据库服务
  6.  
  7. 温馨提升:
  8.   其实LAMP的版本部署基本上都大同小异,2019年最新的httpd以及更新到2.4.41,感兴趣的小伙伴可以戳我之前的笔记:https://www.cnblogs.com/yinzhengjie/p/8338222.html
  9.  
  10.   本篇博客不会演示Mariadb的源码编译方式,感兴趣的下伙伴可参考我之前的编译笔记:https://www.cnblogs.com/yinzhengjie/p/11733897.html
  11.  
  12.   本篇博客编译安装的目的是将httpdfastcgi部署在同一台机器上,且两者的通信方式是基于本地socket套接字。要求httpd的版本必须在2..9版本以上。

2>.安装相关依赖包

  1. [root@node101.yinzhengjie.org.cn ~]#
  2. [root@node101.yinzhengjie.org.cn ~]# yum -y groupinstall "development tools"
  3. Loaded plugins: fastestmirror
  4. There is no installed groups file.
  5. Maybe run: yum groups mark convert (see man yum)
  6. Loading mirror speeds from cached hostfile
  7. * base: mirror.bit.edu.cn
  8. * extras: mirrors.huaweicloud.com
  9. * updates: mirrors.huaweicloud.com
  10. Resolving Dependencies
  11. --> Running transaction check
  12. ---> Package autoconf.noarch :2.69-.el7 will be installed
  13. ---> Package automake.noarch :1.13.-.el7 will be installed
  14. --> Processing Dependency: perl(Thread::Queue) for package: automake-1.13.-.el7.noarch
  15. ---> Package bison.x86_64 :3.0.-.el7 will be installed
  16. ---> Package byacc.x86_64 :1.9.-.el7 will be installed
  17. ---> Package cscope.x86_64 :15.8-.el7 will be installed
  18. ---> Package ctags.x86_64 :5.8-.el7 will be installed
  19. ---> Package diffstat.x86_64 :1.57-.el7 will be installed
  20. ---> Package doxygen.x86_64 :1.8.-.el7 will be installed
  21. ---> Package elfutils.x86_64 :0.176-.el7 will be installed
  22. --> Processing Dependency: elfutils-libs(x86-) = 0.176-.el7 for package: elfutils-0.176-.el7.x86_64
  23. --> Processing Dependency: elfutils-libelf(x86-) = 0.176-.el7 for package: elfutils-0.176-.el7.x86_64
  24. --> Processing Dependency: libdw.so.(ELFUTILS_0.)(64bit) for package: elfutils-0.176-.el7.x86_64
  25. --> Processing Dependency: libdw.so.(ELFUTILS_0.)(64bit) for package: elfutils-0.176-.el7.x86_64
  26. ---> Package flex.x86_64 :2.5.-.el7 will be installed
  27. ---> Package gcc.x86_64 :4.8.-.el7 will be installed
  28. --> Processing Dependency: libgomp = 4.8.-.el7 for package: gcc-4.8.-.el7.x86_64
  29. --> Processing Dependency: cpp = 4.8.-.el7 for package: gcc-4.8.-.el7.x86_64
  30. --> Processing Dependency: libgcc >= 4.8.-.el7 for package: gcc-4.8.-.el7.x86_64
  31. --> Processing Dependency: libmpfr.so.()(64bit) for package: gcc-4.8.-.el7.x86_64
  32. --> Processing Dependency: libmpc.so.()(64bit) for package: gcc-4.8.-.el7.x86_64
  33. ---> Package gcc-c++.x86_64 :4.8.-.el7 will be installed
  34. --> Processing Dependency: libstdc++-devel = 4.8.-.el7 for package: gcc-c++-4.8.-.el7.x86_64
  35. --> Processing Dependency: libstdc++ = 4.8.-.el7 for package: gcc-c++-4.8.-.el7.x86_64
  36. ---> Package gcc-gfortran.x86_64 :4.8.-.el7 will be installed
  37. --> Processing Dependency: libquadmath-devel = 4.8.-.el7 for package: gcc-gfortran-4.8.-.el7.x86_64
  38. --> Processing Dependency: libquadmath = 4.8.-.el7 for package: gcc-gfortran-4.8.-.el7.x86_64
  39. --> Processing Dependency: libgfortran = 4.8.-.el7 for package: gcc-gfortran-4.8.-.el7.x86_64
  40. --> Processing Dependency: libgfortran.so.()(64bit) for package: gcc-gfortran-4.8.-.el7.x86_64
  41. ---> Package git.x86_64 :1.8.3.1-.el7 will be installed
  42. --> Processing Dependency: perl-Git = 1.8.3.1-.el7 for package: git-1.8.3.1-.el7.x86_64
  43. --> Processing Dependency: rsync for package: git-1.8.3.1-.el7.x86_64
  44. --> Processing Dependency: perl(Term::ReadKey) for package: git-1.8.3.1-.el7.x86_64
  45. --> Processing Dependency: perl(Git) for package: git-1.8.3.1-.el7.x86_64
  46. --> Processing Dependency: perl(Error) for package: git-1.8.3.1-.el7.x86_64
  47. ---> Package indent.x86_64 :2.2.-.el7 will be installed
  48. ---> Package intltool.noarch :0.50.-.el7 will be installed
  49. --> Processing Dependency: perl(XML::Parser) for package: intltool-0.50.-.el7.noarch
  50. --> Processing Dependency: gettext-devel for package: intltool-0.50.-.el7.noarch
  51. ---> Package libtool.x86_64 :2.4.-.el7_3 will be installed
  52. ---> Package patchutils.x86_64 :0.3.-.el7 will be installed
  53. ---> Package rcs.x86_64 :5.9.-.el7 will be installed
  54. ---> Package redhat-rpm-config.noarch :9.1.-.el7.centos will be installed
  55. --> Processing Dependency: dwz >= 0.4 for package: redhat-rpm-config-9.1.-.el7.centos.noarch
  56. --> Processing Dependency: python-srpm-macros for package: redhat-rpm-config-9.1.-.el7.centos.noarch
  57. --> Processing Dependency: perl-srpm-macros for package: redhat-rpm-config-9.1.-.el7.centos.noarch
  58. ---> Package rpm-build.x86_64 :4.11.-.el7 will be installed
  59. --> Processing Dependency: rpm = 4.11.-.el7 for package: rpm-build-4.11.-.el7.x86_64
  60. --> Processing Dependency: bzip2 for package: rpm-build-4.11.-.el7.x86_64
  61. --> Processing Dependency: /usr/bin/gdb-add-index for package: rpm-build-4.11.-.el7.x86_64
  62. ---> Package rpm-sign.x86_64 :4.11.-.el7 will be installed
  63. --> Processing Dependency: rpm-build-libs(x86-) = 4.11.-.el7 for package: rpm-sign-4.11.-.el7.x86_64
  64. ---> Package subversion.x86_64 :1.7.-.el7 will be installed
  65. --> Processing Dependency: subversion-libs(x86-) = 1.7.-.el7 for package: subversion-1.7.-.el7.x86_64
  66. --> Processing Dependency: libsvn_wc-.so.()(64bit) for package: subversion-1.7.-.el7.x86_64
  67. --> Processing Dependency: libsvn_subr-.so.()(64bit) for package: subversion-1.7.-.el7.x86_64
  68. --> Processing Dependency: libsvn_repos-.so.()(64bit) for package: subversion-1.7.-.el7.x86_64
  69. --> Processing Dependency: libsvn_ra_svn-.so.()(64bit) for package: subversion-1.7.-.el7.x86_64
  70. --> Processing Dependency: libsvn_ra_neon-.so.()(64bit) for package: subversion-1.7.-.el7.x86_64
  71. --> Processing Dependency: libsvn_ra_local-.so.()(64bit) for package: subversion-1.7.-.el7.x86_64
  72. --> Processing Dependency: libsvn_ra-.so.()(64bit) for package: subversion-1.7.-.el7.x86_64
  73. --> Processing Dependency: libsvn_fs_util-.so.()(64bit) for package: subversion-1.7.-.el7.x86_64
  74. --> Processing Dependency: libsvn_fs_fs-.so.()(64bit) for package: subversion-1.7.-.el7.x86_64
  75. --> Processing Dependency: libsvn_fs_base-.so.()(64bit) for package: subversion-1.7.-.el7.x86_64
  76. --> Processing Dependency: libsvn_fs-.so.()(64bit) for package: subversion-1.7.-.el7.x86_64
  77. --> Processing Dependency: libsvn_diff-.so.()(64bit) for package: subversion-1.7.-.el7.x86_64
  78. --> Processing Dependency: libsvn_delta-.so.()(64bit) for package: subversion-1.7.-.el7.x86_64
  79. --> Processing Dependency: libsvn_client-.so.()(64bit) for package: subversion-1.7.-.el7.x86_64
  80. --> Processing Dependency: libneon.so.()(64bit) for package: subversion-1.7.-.el7.x86_64
  81. --> Processing Dependency: libaprutil-.so.()(64bit) for package: subversion-1.7.-.el7.x86_64
  82. --> Processing Dependency: libapr-.so.()(64bit) for package: subversion-1.7.-.el7.x86_64
  83. ---> Package swig.x86_64 :2.0.-.el7 will be installed
  84. ---> Package systemtap.x86_64 :4.0-.el7_7 will be installed
  85. --> Processing Dependency: systemtap-devel = 4.0-.el7_7 for package: systemtap-4.0-.el7_7.x86_64
  86. --> Processing Dependency: systemtap-client = 4.0-.el7_7 for package: systemtap-4.0-.el7_7.x86_64
  87. --> Running transaction check
  88. ---> Package apr.x86_64 :1.4.-.el7 will be installed
  89. ---> Package apr-util.x86_64 :1.5.-.el7 will be installed
  90. ---> Package bzip2.x86_64 :1.0.-.el7 will be installed
  91. ---> Package cpp.x86_64 :4.8.-.el7 will be installed
  92. ---> Package dwz.x86_64 :0.11-.el7 will be installed
  93. ---> Package elfutils-libelf.x86_64 :0.172-.el7 will be updated
  94. ---> Package elfutils-libelf.x86_64 :0.176-.el7 will be an update
  95. ---> Package elfutils-libs.x86_64 :0.172-.el7 will be updated
  96. ---> Package elfutils-libs.x86_64 :0.176-.el7 will be an update
  97. ---> Package gdb.x86_64 :7.6.-.el7 will be installed
  98. ---> Package gettext-devel.x86_64 :0.19.8.1-.el7 will be installed
  99. --> Processing Dependency: gettext-common-devel = 0.19.8.1-.el7 for package: gettext-devel-0.19.8.1-.el7.x86_64
  100. ---> Package libgcc.x86_64 :4.8.-.el7 will be updated
  101. ---> Package libgcc.x86_64 :4.8.-.el7 will be an update
  102. ---> Package libgfortran.x86_64 :4.8.-.el7 will be installed
  103. ---> Package libgomp.x86_64 :4.8.-.el7 will be updated
  104. ---> Package libgomp.x86_64 :4.8.-.el7 will be an update
  105. ---> Package libmpc.x86_64 :1.0.-.el7 will be installed
  106. ---> Package libquadmath.x86_64 :4.8.-.el7 will be installed
  107. ---> Package libquadmath-devel.x86_64 :4.8.-.el7 will be installed
  108. ---> Package libstdc++.x86_64 :4.8.-.el7 will be updated
  109. ---> Package libstdc++.x86_64 :4.8.-.el7 will be an update
  110. ---> Package libstdc++-devel.x86_64 :4.8.-.el7 will be installed
  111. ---> Package mpfr.x86_64 :3.1.-.el7 will be installed
  112. ---> Package neon.x86_64 :0.30.-.el7 will be installed
  113. --> Processing Dependency: libgnutls.so.(GNUTLS_3_0_0)(64bit) for package: neon-0.30.-.el7.x86_64
  114. --> Processing Dependency: libgnutls.so.(GNUTLS_2_12)(64bit) for package: neon-0.30.-.el7.x86_64
  115. --> Processing Dependency: libgnutls.so.(GNUTLS_1_4)(64bit) for package: neon-0.30.-.el7.x86_64
  116. --> Processing Dependency: libproxy.so.()(64bit) for package: neon-0.30.-.el7.x86_64
  117. --> Processing Dependency: libpakchois.so.()(64bit) for package: neon-0.30.-.el7.x86_64
  118. --> Processing Dependency: libgnutls.so.()(64bit) for package: neon-0.30.-.el7.x86_64
  119. ---> Package perl-Error.noarch :0.17020-.el7 will be installed
  120. ---> Package perl-Git.noarch :1.8.3.1-.el7 will be installed
  121. ---> Package perl-TermReadKey.x86_64 :2.30-.el7 will be installed
  122. ---> Package perl-Thread-Queue.noarch :3.02-.el7 will be installed
  123. ---> Package perl-XML-Parser.x86_64 :2.41-.el7 will be installed
  124. ---> Package perl-srpm-macros.noarch :-.el7 will be installed
  125. ---> Package python-srpm-macros.noarch :-.el7 will be installed
  126. ---> Package rpm.x86_64 :4.11.-.el7 will be updated
  127. --> Processing Dependency: rpm = 4.11.-.el7 for package: rpm-python-4.11.-.el7.x86_64
  128. --> Processing Dependency: rpm = 4.11.-.el7 for package: rpm-libs-4.11.-.el7.x86_64
  129. ---> Package rpm.x86_64 :4.11.-.el7 will be an update
  130. ---> Package rpm-build-libs.x86_64 :4.11.-.el7 will be updated
  131. ---> Package rpm-build-libs.x86_64 :4.11.-.el7 will be an update
  132. ---> Package rsync.x86_64 :3.1.-.el7_6. will be installed
  133. ---> Package subversion-libs.x86_64 :1.7.-.el7 will be installed
  134. ---> Package systemtap-client.x86_64 :4.0-.el7_7 will be installed
  135. --> Processing Dependency: systemtap-runtime = 4.0-.el7_7 for package: systemtap-client-4.0-.el7_7.x86_64
  136. --> Processing Dependency: mokutil for package: systemtap-client-4.0-.el7_7.x86_64
  137. ---> Package systemtap-devel.x86_64 :4.0-.el7_7 will be installed
  138. --> Processing Dependency: kernel-devel-uname-r for package: systemtap-devel-4.0-.el7_7.x86_64
  139. --> Running transaction check
  140. ---> Package gettext-common-devel.noarch :0.19.8.1-.el7 will be installed
  141. ---> Package gnutls.x86_64 :3.3.-.el7_6 will be installed
  142. --> Processing Dependency: trousers >= 0.3.11.2 for package: gnutls-3.3.-.el7_6.x86_64
  143. --> Processing Dependency: libnettle.so.()(64bit) for package: gnutls-3.3.-.el7_6.x86_64
  144. --> Processing Dependency: libhogweed.so.()(64bit) for package: gnutls-3.3.-.el7_6.x86_64
  145. ---> Package kernel-debug-devel.x86_64 :3.10.-1062.9..el7 will be installed
  146. ---> Package libproxy.x86_64 :0.4.-.el7 will be installed
  147. --> Processing Dependency: libmodman.so.()(64bit) for package: libproxy-0.4.-.el7.x86_64
  148. ---> Package mokutil.x86_64 :-.el7.centos will be installed
  149. --> Processing Dependency: libefivar.so.(libefivar.so.)(64bit) for package: mokutil--.el7.centos.x86_64
  150. --> Processing Dependency: libefivar.so.(LIBEFIVAR_0.)(64bit) for package: mokutil--.el7.centos.x86_64
  151. --> Processing Dependency: libefivar.so.()(64bit) for package: mokutil--.el7.centos.x86_64
  152. ---> Package pakchois.x86_64 :0.4-.el7 will be installed
  153. ---> Package rpm-libs.x86_64 :4.11.-.el7 will be updated
  154. ---> Package rpm-libs.x86_64 :4.11.-.el7 will be an update
  155. ---> Package rpm-python.x86_64 :4.11.-.el7 will be updated
  156. ---> Package rpm-python.x86_64 :4.11.-.el7 will be an update
  157. ---> Package systemtap-runtime.x86_64 :4.0-.el7_7 will be installed
  158. --> Processing Dependency: libsymtabAPI.so.9.3()(64bit) for package: systemtap-runtime-4.0-.el7_7.x86_64
  159. --> Processing Dependency: libdyninstAPI.so.9.3()(64bit) for package: systemtap-runtime-4.0-.el7_7.x86_64
  160. --> Running transaction check
  161. ---> Package dyninst.x86_64 :9.3.-.el7 will be installed
  162. --> Processing Dependency: libdwarf.so.()(64bit) for package: dyninst-9.3.-.el7.x86_64
  163. --> Processing Dependency: libboost_thread-mt.so.1.53.()(64bit) for package: dyninst-9.3.-.el7.x86_64
  164. --> Processing Dependency: libboost_system-mt.so.1.53.()(64bit) for package: dyninst-9.3.-.el7.x86_64
  165. --> Processing Dependency: libboost_date_time-mt.so.1.53.()(64bit) for package: dyninst-9.3.-.el7.x86_64
  166. ---> Package efivar-libs.x86_64 :-.el7 will be installed
  167. ---> Package libmodman.x86_64 :2.0.-.el7 will be installed
  168. ---> Package nettle.x86_64 :2.7.-.el7 will be installed
  169. ---> Package trousers.x86_64 :0.3.-.el7 will be installed
  170. --> Running transaction check
  171. ---> Package boost-date-time.x86_64 :1.53.-.el7 will be installed
  172. ---> Package boost-system.x86_64 :1.53.-.el7 will be installed
  173. ---> Package boost-thread.x86_64 :1.53.-.el7 will be installed
  174. ---> Package libdwarf.x86_64 :-.el7 will be installed
  175. --> Finished Dependency Resolution
  176.  
  177. Dependencies Resolved
  178.  
  179. =============================================================================================================================================
  180. Package Arch Version Repository Size
  181. =============================================================================================================================================
  182. Installing for group install "Development Tools":
  183. autoconf noarch 2.69-.el7 base k
  184. automake noarch 1.13.-.el7 base k
  185. bison x86_64 3.0.-.el7 base k
  186. byacc x86_64 1.9.-.el7 base k
  187. cscope x86_64 15.8-.el7 base k
  188. ctags x86_64 5.8-.el7 base k
  189. diffstat x86_64 1.57-.el7 base k
  190. doxygen x86_64 :1.8.-.el7 base 3.6 M
  191. elfutils x86_64 0.176-.el7 base k
  192. flex x86_64 2.5.-.el7 base k
  193. gcc x86_64 4.8.-.el7 base M
  194. gcc-c++ x86_64 4.8.-.el7 base 7.2 M
  195. gcc-gfortran x86_64 4.8.-.el7 base 6.7 M
  196. git x86_64 1.8.3.1-.el7 base 4.4 M
  197. indent x86_64 2.2.-.el7 base k
  198. intltool noarch 0.50.-.el7 base k
  199. libtool x86_64 2.4.-.el7_3 base k
  200. patchutils x86_64 0.3.-.el7 base k
  201. rcs x86_64 5.9.-.el7 base k
  202. redhat-rpm-config noarch 9.1.-.el7.centos base k
  203. rpm-build x86_64 4.11.-.el7 base k
  204. rpm-sign x86_64 4.11.-.el7 base k
  205. subversion x86_64 1.7.-.el7 base 1.0 M
  206. swig x86_64 2.0.-.el7 base 1.3 M
  207. systemtap x86_64 4.0-.el7_7 updates k
  208. Installing for dependencies:
  209. apr x86_64 1.4.-.el7 base k
  210. apr-util x86_64 1.5.-.el7 base k
  211. boost-date-time x86_64 1.53.-.el7 base k
  212. boost-system x86_64 1.53.-.el7 base k
  213. boost-thread x86_64 1.53.-.el7 base k
  214. bzip2 x86_64 1.0.-.el7 base k
  215. cpp x86_64 4.8.-.el7 base 5.9 M
  216. dwz x86_64 0.11-.el7 base k
  217. dyninst x86_64 9.3.-.el7 base 3.5 M
  218. efivar-libs x86_64 -.el7 base k
  219. gdb x86_64 7.6.-.el7 base 2.4 M
  220. gettext-common-devel noarch 0.19.8.1-.el7 base k
  221. gettext-devel x86_64 0.19.8.1-.el7 base k
  222. gnutls x86_64 3.3.-.el7_6 base k
  223. kernel-debug-devel x86_64 3.10.-1062.9..el7 updates M
  224. libdwarf x86_64 -.el7 base k
  225. libgfortran x86_64 4.8.-.el7 base k
  226. libmodman x86_64 2.0.-.el7 base k
  227. libmpc x86_64 1.0.-.el7 base k
  228. libproxy x86_64 0.4.-.el7 base k
  229. libquadmath x86_64 4.8.-.el7 base k
  230. libquadmath-devel x86_64 4.8.-.el7 base k
  231. libstdc++-devel x86_64 4.8.-.el7 base 1.5 M
  232. mokutil x86_64 -.el7.centos base k
  233. mpfr x86_64 3.1.-.el7 base k
  234. neon x86_64 0.30.-.el7 base k
  235. nettle x86_64 2.7.-.el7 base k
  236. pakchois x86_64 0.4-.el7 base k
  237. perl-Error noarch :0.17020-.el7 base k
  238. perl-Git noarch 1.8.3.1-.el7 base k
  239. perl-TermReadKey x86_64 2.30-.el7 base k
  240. perl-Thread-Queue noarch 3.02-.el7 base k
  241. perl-XML-Parser x86_64 2.41-.el7 base k
  242. perl-srpm-macros noarch -.el7 base 4.6 k
  243. python-srpm-macros noarch -.el7 base 8.4 k
  244. rsync x86_64 3.1.-.el7_6. base k
  245. subversion-libs x86_64 1.7.-.el7 base k
  246. systemtap-client x86_64 4.0-.el7_7 updates 3.6 M
  247. systemtap-devel x86_64 4.0-.el7_7 updates 2.2 M
  248. systemtap-runtime x86_64 4.0-.el7_7 updates k
  249. trousers x86_64 0.3.-.el7 base k
  250. Updating for dependencies:
  251. elfutils-libelf x86_64 0.176-.el7 base k
  252. elfutils-libs x86_64 0.176-.el7 base k
  253. libgcc x86_64 4.8.-.el7 base k
  254. libgomp x86_64 4.8.-.el7 base k
  255. libstdc++ x86_64 4.8.-.el7 base k
  256. rpm x86_64 4.11.-.el7 base 1.2 M
  257. rpm-build-libs x86_64 4.11.-.el7 base k
  258. rpm-libs x86_64 4.11.-.el7 base k
  259. rpm-python x86_64 4.11.-.el7 base k
  260.  
  261. Transaction Summary
  262. =============================================================================================================================================
  263. Install Packages (+ Dependent packages)
  264. Upgrade ( Dependent packages)
  265.  
  266. Total download size: M
  267. Downloading packages:
  268. Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
  269. (/): apr-1.4.-.el7.x86_64.rpm | kB ::
  270. (/): autoconf-2.69-.el7.noarch.rpm | kB ::
  271. (/): apr-util-1.5.-.el7.x86_64.rpm | kB ::
  272. (/): bison-3.0.-.el7.x86_64.rpm | kB ::
  273. (/): boost-date-time-1.53.-.el7.x86_64.rpm | kB ::
  274. (/): boost-system-1.53.-.el7.x86_64.rpm | kB ::
  275. (/): boost-thread-1.53.-.el7.x86_64.rpm | kB ::
  276. (/): byacc-1.9.-.el7.x86_64.rpm | kB ::
  277. (/): bzip2-1.0.-.el7.x86_64.rpm | kB ::
  278. (/): automake-1.13.-.el7.noarch.rpm | kB ::
  279. (/): cscope-15.8-.el7.x86_64.rpm | kB ::
  280. (/): cpp-4.8.-.el7.x86_64.rpm | 5.9 MB ::
  281. (/): diffstat-1.57-.el7.x86_64.rpm | kB ::
  282. (/): ctags-5.8-.el7.x86_64.rpm | kB ::
  283. (/): dwz-0.11-.el7.x86_64.rpm | kB ::
  284. (/): dyninst-9.3.-.el7.x86_64.rpm | 3.5 MB ::
  285. (/): efivar-libs--.el7.x86_64.rpm | kB ::
  286. (/): elfutils-0.176-.el7.x86_64.rpm | kB ::
  287. (/): doxygen-1.8.-.el7.x86_64.rpm | 3.6 MB ::
  288. (/): elfutils-libs-0.176-.el7.x86_64.rpm | kB ::
  289. (/): elfutils-libelf-0.176-.el7.x86_64.rpm | kB ::
  290. (/): flex-2.5.-.el7.x86_64.rpm | kB ::
  291. (/): gcc-c++-4.8.-.el7.x86_64.rpm | 7.2 MB ::
  292. (/): gcc-gfortran-4.8.-.el7.x86_64.rpm | 6.7 MB ::
  293. (/): gdb-7.6.-.el7.x86_64.rpm | 2.4 MB ::
  294. (/): gettext-common-devel-0.19.8.1-.el7.noarch.rpm | kB ::
  295. (/): gettext-devel-0.19.8.1-.el7.x86_64.rpm | kB ::
  296. (/): git-1.8.3.1-.el7.x86_64.rpm | 4.4 MB ::
  297. (/): gnutls-3.3.-.el7_6.x86_64.rpm | kB ::
  298. (/): indent-2.2.-.el7.x86_64.rpm | kB ::
  299. (/): intltool-0.50.-.el7.noarch.rpm | kB ::
  300. (/): libdwarf--.el7.x86_64.rpm | kB ::
  301. (/): libgcc-4.8.-.el7.x86_64.rpm | kB ::
  302. (/): libgfortran-4.8.-.el7.x86_64.rpm | kB ::
  303. (/): libgomp-4.8.-.el7.x86_64.rpm | kB ::
  304. (/): libmodman-2.0.-.el7.x86_64.rpm | kB ::
  305. (/): libmpc-1.0.-.el7.x86_64.rpm | kB ::
  306. (/): libproxy-0.4.-.el7.x86_64.rpm | kB ::
  307. (/): libquadmath-4.8.-.el7.x86_64.rpm | kB ::
  308. (/): libquadmath-devel-4.8.-.el7.x86_64.rpm | kB ::
  309. (/): libstdc++-4.8.-.el7.x86_64.rpm | kB ::
  310. (/): libstdc++-devel-4.8.-.el7.x86_64.rpm | 1.5 MB ::
  311. (/): libtool-2.4.-.el7_3.x86_64.rpm | kB ::
  312. (/): mokutil--.el7.centos.x86_64.rpm | kB ::
  313. (/): mpfr-3.1.-.el7.x86_64.rpm | kB ::
  314. (/): neon-0.30.-.el7.x86_64.rpm | kB ::
  315. (/): nettle-2.7.-.el7.x86_64.rpm | kB ::
  316. (/): pakchois-0.4-.el7.x86_64.rpm | kB ::
  317. (/): patchutils-0.3.-.el7.x86_64.rpm | kB ::
  318. (/): perl-Error-0.17020-.el7.noarch.rpm | kB ::
  319. (/): perl-Git-1.8.3.1-.el7.noarch.rpm | kB ::
  320. (/): perl-TermReadKey-2.30-.el7.x86_64.rpm | kB ::
  321. (/): perl-Thread-Queue-3.02-.el7.noarch.rpm | kB ::
  322. (/): perl-XML-Parser-2.41-.el7.x86_64.rpm | kB ::
  323. (/): perl-srpm-macros--.el7.noarch.rpm | 4.6 kB ::
  324. (/): python-srpm-macros--.el7.noarch.rpm | 8.4 kB ::
  325. (/): rcs-5.9.-.el7.x86_64.rpm | kB ::
  326. (/): redhat-rpm-config-9.1.-.el7.centos.noarch.rpm | kB ::
  327. (/): rpm-4.11.-.el7.x86_64.rpm | 1.2 MB ::
  328. (/): rpm-build-4.11.-.el7.x86_64.rpm | kB ::
  329. (/): rpm-build-libs-4.11.-.el7.x86_64.rpm | kB ::
  330. (/): rpm-libs-4.11.-.el7.x86_64.rpm | kB ::
  331. (/): rpm-python-4.11.-.el7.x86_64.rpm | kB ::
  332. (/): rpm-sign-4.11.-.el7.x86_64.rpm | kB ::
  333. (/): rsync-3.1.-.el7_6..x86_64.rpm | kB ::
  334. (/): subversion-1.7.-.el7.x86_64.rpm | 1.0 MB ::
  335. (/): subversion-libs-1.7.-.el7.x86_64.rpm | kB ::
  336. (/): systemtap-4.0-.el7_7.x86_64.rpm | kB ::
  337. (/): systemtap-devel-4.0-.el7_7.x86_64.rpm | 2.2 MB ::
  338. (/): systemtap-runtime-4.0-.el7_7.x86_64.rpm | kB ::
  339. (/): systemtap-client-4.0-.el7_7.x86_64.rpm | 3.6 MB ::
  340. (/): swig-2.0.-.el7.x86_64.rpm | 1.3 MB ::
  341. (/): trousers-0.3.-.el7.x86_64.rpm | kB ::
  342. (/): gcc-4.8.-.el7.x86_64.rpm | MB ::
  343. (/): kernel-debug-devel-3.10.-1062.9..el7.x86_64.rpm | MB ::
  344. ---------------------------------------------------------------------------------------------------------------------------------------------
  345. Total 2.7 MB/s | MB ::
  346. Running transaction check
  347. Running transaction test
  348. Transaction test succeeded
  349. Running transaction
  350. Updating : libgcc-4.8.-.el7.x86_64 /
  351. Updating : libstdc++-4.8.-.el7.x86_64 /
  352. Updating : elfutils-libelf-0.176-.el7.x86_64 /
  353. Updating : rpm-4.11.-.el7.x86_64 /
  354. Updating : rpm-libs-4.11.-.el7.x86_64 /
  355. Installing : mpfr-3.1.-.el7.x86_64 /
  356. Installing : libmpc-1.0.-.el7.x86_64 /
  357. Updating : rpm-build-libs-4.11.-.el7.x86_64 /
  358. Updating : elfutils-libs-0.176-.el7.x86_64 /
  359. Installing : libquadmath-4.8.-.el7.x86_64 /
  360. Installing : apr-1.4.-.el7.x86_64 /
  361. Installing : apr-util-1.5.-.el7.x86_64 /
  362. Installing : boost-system-1.53.-.el7.x86_64 /
  363. Installing : autoconf-2.69-.el7.noarch /
  364. Installing : :perl-Error-0.17020-.el7.noarch /
  365. Installing : perl-Thread-Queue-3.02-.el7.noarch /
  366. Installing : automake-1.13.-.el7.noarch /
  367. Installing : boost-thread-1.53.-.el7.x86_64 /
  368. Installing : libgfortran-4.8.-.el7.x86_64 /
  369. Installing : elfutils-0.176-.el7.x86_64 /
  370. Installing : cpp-4.8.-.el7.x86_64 /
  371. Installing : dwz-0.11-.el7.x86_64 /
  372. Installing : libdwarf--.el7.x86_64 /
  373. Installing : libstdc++-devel-4.8.-.el7.x86_64 /
  374. Installing : libmodman-2.0.-.el7.x86_64 /
  375. Installing : libproxy-0.4.-.el7.x86_64 /
  376. Installing : boost-date-time-1.53.-.el7.x86_64 /
  377. Installing : dyninst-9.3.-.el7.x86_64 /
  378. Installing : systemtap-runtime-4.0-.el7_7.x86_64 /
  379. Installing : gdb-7.6.-.el7.x86_64 /
  380. Installing : perl-srpm-macros--.el7.noarch /
  381. Installing : pakchois-0.4-.el7.x86_64 /
  382. Installing : efivar-libs--.el7.x86_64 /
  383. Installing : mokutil--.el7.centos.x86_64 /
  384. Installing : systemtap-client-4.0-.el7_7.x86_64 /
  385. Installing : perl-TermReadKey-2.30-.el7.x86_64 /
  386. Installing : bzip2-1.0.-.el7.x86_64 /
  387. Installing : python-srpm-macros--.el7.noarch /
  388. Installing : redhat-rpm-config-9.1.-.el7.centos.noarch /
  389. Updating : libgomp-4.8.-.el7.x86_64 /
  390. Installing : gcc-4.8.-.el7.x86_64 /
  391. Installing : libquadmath-devel-4.8.-.el7.x86_64 /
  392. Installing : gettext-common-devel-0.19.8.1-.el7.noarch /
  393. Installing : nettle-2.7.-.el7.x86_64 /
  394. Installing : perl-XML-Parser-2.41-.el7.x86_64 /
  395. Installing : kernel-debug-devel-3.10.-1062.9..el7.x86_64 /
  396. Installing : systemtap-devel-4.0-.el7_7.x86_64 /
  397. Installing : trousers-0.3.-.el7.x86_64 /
  398. Installing : gnutls-3.3.-.el7_6.x86_64 /
  399. Installing : neon-0.30.-.el7.x86_64 /
  400. Installing : subversion-libs-1.7.-.el7.x86_64 /
  401. Installing : rsync-3.1.-.el7_6..x86_64 /
  402. Installing : perl-Git-1.8.3.1-.el7.noarch /
  403. Installing : git-1.8.3.1-.el7.x86_64 /
  404. Installing : gettext-devel-0.19.8.1-.el7.x86_64 /
  405. Installing : intltool-0.50.-.el7.noarch /
  406. Installing : subversion-1.7.-.el7.x86_64 /
  407. Installing : systemtap-4.0-.el7_7.x86_64 /
  408. Installing : gcc-gfortran-4.8.-.el7.x86_64 /
  409. Installing : libtool-2.4.-.el7_3.x86_64 /
  410. Installing : gcc-c++-4.8.-.el7.x86_64 /
  411. Installing : rpm-build-4.11.-.el7.x86_64 /
  412. Updating : rpm-python-4.11.-.el7.x86_64 /
  413. Installing : rpm-sign-4.11.-.el7.x86_64 /
  414. Installing : :doxygen-1.8.-.el7.x86_64 /
  415. Installing : swig-2.0.-.el7.x86_64 /
  416. Installing : diffstat-1.57-.el7.x86_64 /
  417. Installing : bison-3.0.-.el7.x86_64 /
  418. Installing : cscope-15.8-.el7.x86_64 /
  419. Installing : patchutils-0.3.-.el7.x86_64 /
  420. Installing : flex-2.5.-.el7.x86_64 /
  421. Installing : indent-2.2.-.el7.x86_64 /
  422. Installing : rcs-5.9.-.el7.x86_64 /
  423. Installing : byacc-1.9.-.el7.x86_64 /
  424. Installing : ctags-5.8-.el7.x86_64 /
  425. Cleanup : rpm-python-4.11.-.el7.x86_64 /
  426. Cleanup : rpm-build-libs-4.11.-.el7.x86_64 /
  427. Cleanup : rpm-4.11.-.el7.x86_64 /
  428. Cleanup : rpm-libs-4.11.-.el7.x86_64 /
  429. Cleanup : elfutils-libs-0.172-.el7.x86_64 /
  430. Cleanup : libstdc++-4.8.-.el7.x86_64 /
  431. Cleanup : libgcc-4.8.-.el7.x86_64 /
  432. Cleanup : elfutils-libelf-0.172-.el7.x86_64 /
  433. Cleanup : libgomp-4.8.-.el7.x86_64 /
  434. Verifying : rsync-3.1.-.el7_6..x86_64 /
  435. Verifying : trousers-0.3.-.el7.x86_64 /
  436. Verifying : ctags-5.8-.el7.x86_64 /
  437. Verifying : subversion-libs-1.7.-.el7.x86_64 /
  438. Verifying : kernel-debug-devel-3.10.-1062.9..el7.x86_64 /
  439. Verifying : perl-XML-Parser-2.41-.el7.x86_64 /
  440. Verifying : gettext-devel-0.19.8.1-.el7.x86_64 /
  441. Verifying : mpfr-3.1.-.el7.x86_64 /
  442. Verifying : byacc-1.9.-.el7.x86_64 /
  443. Verifying : libgfortran-4.8.-.el7.x86_64 /
  444. Verifying : nettle-2.7.-.el7.x86_64 /
  445. Verifying : boost-system-1.53.-.el7.x86_64 /
  446. Verifying : automake-1.13.-.el7.noarch /
  447. Verifying : gcc-4.8.-.el7.x86_64 /
  448. Verifying : libstdc++-devel-4.8.-.el7.x86_64 /
  449. Verifying : libstdc++-4.8.-.el7.x86_64 /
  450. Verifying : :doxygen-1.8.-.el7.x86_64 /
  451. Verifying : dyninst-9.3.-.el7.x86_64 /
  452. Verifying : rpm-build-libs-4.11.-.el7.x86_64 /
  453. Verifying : rpm-python-4.11.-.el7.x86_64 /
  454. Verifying : subversion-1.7.-.el7.x86_64 /
  455. Verifying : systemtap-4.0-.el7_7.x86_64 /
  456. Verifying : boost-thread-1.53.-.el7.x86_64 /
  457. Verifying : perl-Thread-Queue-3.02-.el7.noarch /
  458. Verifying : gettext-common-devel-0.19.8.1-.el7.noarch /
  459. Verifying : perl-Git-1.8.3.1-.el7.noarch /
  460. Verifying : libgcc-4.8.-.el7.x86_64 /
  461. Verifying : libgomp-4.8.-.el7.x86_64 /
  462. Verifying : intltool-0.50.-.el7.noarch /
  463. Verifying : gnutls-3.3.-.el7_6.x86_64 /
  464. Verifying : rcs-5.9.-.el7.x86_64 /
  465. Verifying : swig-2.0.-.el7.x86_64 /
  466. Verifying : python-srpm-macros--.el7.noarch /
  467. Verifying : libtool-2.4.-.el7_3.x86_64 /
  468. Verifying : libmodman-2.0.-.el7.x86_64 /
  469. Verifying : gcc-c++-4.8.-.el7.x86_64 /
  470. Verifying : apr-1.4.-.el7.x86_64 /
  471. Verifying : libproxy-0.4.-.el7.x86_64 /
  472. Verifying : rpm-build-4.11.-.el7.x86_64 /
  473. Verifying : :perl-Error-0.17020-.el7.noarch /
  474. Verifying : indent-2.2.-.el7.x86_64 /
  475. Verifying : git-1.8.3.1-.el7.x86_64 /
  476. Verifying : bzip2-1.0.-.el7.x86_64 /
  477. Verifying : gcc-gfortran-4.8.-.el7.x86_64 /
  478. Verifying : apr-util-1.5.-.el7.x86_64 /
  479. Verifying : flex-2.5.-.el7.x86_64 /
  480. Verifying : rpm-libs-4.11.-.el7.x86_64 /
  481. Verifying : libmpc-1.0.-.el7.x86_64 /
  482. Verifying : libquadmath-devel-4.8.-.el7.x86_64 /
  483. Verifying : systemtap-runtime-4.0-.el7_7.x86_64 /
  484. Verifying : systemtap-client-4.0-.el7_7.x86_64 /
  485. Verifying : patchutils-0.3.-.el7.x86_64 /
  486. Verifying : systemtap-devel-4.0-.el7_7.x86_64 /
  487. Verifying : cscope-15.8-.el7.x86_64 /
  488. Verifying : bison-3.0.-.el7.x86_64 /
  489. Verifying : mokutil--.el7.centos.x86_64 /
  490. Verifying : autoconf-2.69-.el7.noarch /
  491. Verifying : elfutils-0.176-.el7.x86_64 /
  492. Verifying : perl-TermReadKey-2.30-.el7.x86_64 /
  493. Verifying : rpm-4.11.-.el7.x86_64 /
  494. Verifying : elfutils-libs-0.176-.el7.x86_64 /
  495. Verifying : libquadmath-4.8.-.el7.x86_64 /
  496. Verifying : cpp-4.8.-.el7.x86_64 /
  497. Verifying : boost-date-time-1.53.-.el7.x86_64 /
  498. Verifying : gdb-7.6.-.el7.x86_64 /
  499. Verifying : dwz-0.11-.el7.x86_64 /
  500. Verifying : efivar-libs--.el7.x86_64 /
  501. Verifying : diffstat-1.57-.el7.x86_64 /
  502. Verifying : elfutils-libelf-0.176-.el7.x86_64 /
  503. Verifying : pakchois-0.4-.el7.x86_64 /
  504. Verifying : neon-0.30.-.el7.x86_64 /
  505. Verifying : rpm-sign-4.11.-.el7.x86_64 /
  506. Verifying : perl-srpm-macros--.el7.noarch /
  507. Verifying : libdwarf--.el7.x86_64 /
  508. Verifying : redhat-rpm-config-9.1.-.el7.centos.noarch /
  509. Verifying : rpm-python-4.11.-.el7.x86_64 /
  510. Verifying : libgcc-4.8.-.el7.x86_64 /
  511. Verifying : elfutils-libelf-0.172-.el7.x86_64 /
  512. Verifying : rpm-libs-4.11.-.el7.x86_64 /
  513. Verifying : libstdc++-4.8.-.el7.x86_64 /
  514. Verifying : rpm-4.11.-.el7.x86_64 /
  515. Verifying : rpm-build-libs-4.11.-.el7.x86_64 /
  516. Verifying : libgomp-4.8.-.el7.x86_64 /
  517. Verifying : elfutils-libs-0.172-.el7.x86_64 /
  518.  
  519. Installed:
  520. autoconf.noarch :2.69-.el7 automake.noarch :1.13.-.el7 bison.x86_64 :3.0.-.el7
  521. byacc.x86_64 :1.9.-.el7 cscope.x86_64 :15.8-.el7 ctags.x86_64 :5.8-.el7
  522. diffstat.x86_64 :1.57-.el7 doxygen.x86_64 :1.8.-.el7 elfutils.x86_64 :0.176-.el7
  523. flex.x86_64 :2.5.-.el7 gcc.x86_64 :4.8.-.el7 gcc-c++.x86_64 :4.8.-.el7
  524. gcc-gfortran.x86_64 :4.8.-.el7 git.x86_64 :1.8.3.1-.el7 indent.x86_64 :2.2.-.el7
  525. intltool.noarch :0.50.-.el7 libtool.x86_64 :2.4.-.el7_3 patchutils.x86_64 :0.3.-.el7
  526. rcs.x86_64 :5.9.-.el7 redhat-rpm-config.noarch :9.1.-.el7.centos rpm-build.x86_64 :4.11.-.el7
  527. rpm-sign.x86_64 :4.11.-.el7 subversion.x86_64 :1.7.-.el7 swig.x86_64 :2.0.-.el7
  528. systemtap.x86_64 :4.0-.el7_7
  529.  
  530. Dependency Installed:
  531. apr.x86_64 :1.4.-.el7 apr-util.x86_64 :1.5.-.el7 boost-date-time.x86_64 :1.53.-.el7
  532. boost-system.x86_64 :1.53.-.el7 boost-thread.x86_64 :1.53.-.el7 bzip2.x86_64 :1.0.-.el7
  533. cpp.x86_64 :4.8.-.el7 dwz.x86_64 :0.11-.el7 dyninst.x86_64 :9.3.-.el7
  534. efivar-libs.x86_64 :-.el7 gdb.x86_64 :7.6.-.el7 gettext-common-devel.noarch :0.19.8.1-.el7
  535. gettext-devel.x86_64 :0.19.8.1-.el7 gnutls.x86_64 :3.3.-.el7_6 kernel-debug-devel.x86_64 :3.10.-1062.9..el7
  536. libdwarf.x86_64 :-.el7 libgfortran.x86_64 :4.8.-.el7 libmodman.x86_64 :2.0.-.el7
  537. libmpc.x86_64 :1.0.-.el7 libproxy.x86_64 :0.4.-.el7 libquadmath.x86_64 :4.8.-.el7
  538. libquadmath-devel.x86_64 :4.8.-.el7 libstdc++-devel.x86_64 :4.8.-.el7 mokutil.x86_64 :-.el7.centos
  539. mpfr.x86_64 :3.1.-.el7 neon.x86_64 :0.30.-.el7 nettle.x86_64 :2.7.-.el7
  540. pakchois.x86_64 :0.4-.el7 perl-Error.noarch :0.17020-.el7 perl-Git.noarch :1.8.3.1-.el7
  541. perl-TermReadKey.x86_64 :2.30-.el7 perl-Thread-Queue.noarch :3.02-.el7 perl-XML-Parser.x86_64 :2.41-.el7
  542. perl-srpm-macros.noarch :-.el7 python-srpm-macros.noarch :-.el7 rsync.x86_64 :3.1.-.el7_6.
  543. subversion-libs.x86_64 :1.7.-.el7 systemtap-client.x86_64 :4.0-.el7_7 systemtap-devel.x86_64 :4.0-.el7_7
  544. systemtap-runtime.x86_64 :4.0-.el7_7 trousers.x86_64 :0.3.-.el7
  545.  
  546. Dependency Updated:
  547. elfutils-libelf.x86_64 :0.176-.el7 elfutils-libs.x86_64 :0.176-.el7 libgcc.x86_64 :4.8.-.el7
  548. libgomp.x86_64 :4.8.-.el7 libstdc++.x86_64 :4.8.-.el7 rpm.x86_64 :4.11.-.el7
  549. rpm-build-libs.x86_64 :4.11.-.el7 rpm-libs.x86_64 :4.11.-.el7 rpm-python.x86_64 :4.11.-.el7
  550.  
  551. Complete!
  552. [root@node101.yinzhengjie.org.cn ~]#

[root@node101.yinzhengjie.org.cn ~]# yum -y groupinstall "development tools"              #安装开发包组

  1. [root@node101.yinzhengjie.org.cn ~]#
  2. [root@node101.yinzhengjie.org.cn ~]# yum -y install pcre-devel openssl-devel expat-devel
  3. Loaded plugins: fastestmirror
  4. Loading mirror speeds from cached hostfile
  5. * base: mirror.bit.edu.cn
  6. * extras: mirrors.huaweicloud.com
  7. * updates: mirrors.huaweicloud.com
  8. Resolving Dependencies
  9. --> Running transaction check
  10. ---> Package expat-devel.x86_64 :2.1.-.el7_3 will be installed
  11. ---> Package openssl-devel.x86_64 :1.0.2k-.el7 will be installed
  12. --> Processing Dependency: openssl-libs(x86-) = :1.0.2k-.el7 for package: :openssl-devel-1.0.2k-.el7.x86_64
  13. --> Processing Dependency: zlib-devel(x86-) for package: :openssl-devel-1.0.2k-.el7.x86_64
  14. --> Processing Dependency: krb5-devel(x86-) for package: :openssl-devel-1.0.2k-.el7.x86_64
  15. ---> Package pcre-devel.x86_64 :8.32-.el7 will be installed
  16. --> Running transaction check
  17. ---> Package krb5-devel.x86_64 :1.15.-.el7_7. will be installed
  18. --> Processing Dependency: libkadm5(x86-) = 1.15.-.el7_7. for package: krb5-devel-1.15.-.el7_7..x86_64
  19. --> Processing Dependency: krb5-libs(x86-) = 1.15.-.el7_7. for package: krb5-devel-1.15.-.el7_7..x86_64
  20. --> Processing Dependency: libverto-devel for package: krb5-devel-1.15.-.el7_7..x86_64
  21. --> Processing Dependency: libselinux-devel for package: krb5-devel-1.15.-.el7_7..x86_64
  22. --> Processing Dependency: libcom_err-devel for package: krb5-devel-1.15.-.el7_7..x86_64
  23. --> Processing Dependency: keyutils-libs-devel for package: krb5-devel-1.15.-.el7_7..x86_64
  24. ---> Package openssl-libs.x86_64 :1.0.2k-.el7 will be updated
  25. --> Processing Dependency: openssl-libs(x86-) = :1.0.2k-.el7 for package: :openssl-1.0.2k-.el7.x86_64
  26. ---> Package openssl-libs.x86_64 :1.0.2k-.el7 will be an update
  27. ---> Package zlib-devel.x86_64 :1.2.-.el7 will be installed
  28. --> Running transaction check
  29. ---> Package keyutils-libs-devel.x86_64 :1.5.-.el7 will be installed
  30. ---> Package krb5-libs.x86_64 :1.15.-.el7 will be updated
  31. ---> Package krb5-libs.x86_64 :1.15.-.el7_7. will be an update
  32. ---> Package libcom_err-devel.x86_64 :1.42.-.el7 will be installed
  33. --> Processing Dependency: libcom_err(x86-) = 1.42.-.el7 for package: libcom_err-devel-1.42.-.el7.x86_64
  34. ---> Package libkadm5.x86_64 :1.15.-.el7_7. will be installed
  35. ---> Package libselinux-devel.x86_64 :2.5-14.1.el7 will be installed
  36. --> Processing Dependency: libsepol-devel(x86-) >= 2.5- for package: libselinux-devel-2.5-14.1.el7.x86_64
  37. --> Processing Dependency: pkgconfig(libsepol) for package: libselinux-devel-2.5-14.1.el7.x86_64
  38. ---> Package libverto-devel.x86_64 :0.2.-.el7 will be installed
  39. ---> Package openssl.x86_64 :1.0.2k-.el7 will be updated
  40. ---> Package openssl.x86_64 :1.0.2k-.el7 will be an update
  41. --> Running transaction check
  42. ---> Package libcom_err.x86_64 :1.42.-.el7 will be updated
  43. --> Processing Dependency: libcom_err(x86-) = 1.42.-.el7 for package: e2fsprogs-1.42.-.el7.x86_64
  44. --> Processing Dependency: libcom_err(x86-) = 1.42.-.el7 for package: e2fsprogs-libs-1.42.-.el7.x86_64
  45. --> Processing Dependency: libcom_err(x86-) = 1.42.-.el7 for package: libss-1.42.-.el7.x86_64
  46. ---> Package libcom_err.x86_64 :1.42.-.el7 will be an update
  47. ---> Package libsepol-devel.x86_64 :2.5-.el7 will be installed
  48. --> Running transaction check
  49. ---> Package e2fsprogs.x86_64 :1.42.-.el7 will be updated
  50. ---> Package e2fsprogs.x86_64 :1.42.-.el7 will be an update
  51. ---> Package e2fsprogs-libs.x86_64 :1.42.-.el7 will be updated
  52. ---> Package e2fsprogs-libs.x86_64 :1.42.-.el7 will be an update
  53. ---> Package libss.x86_64 :1.42.-.el7 will be updated
  54. ---> Package libss.x86_64 :1.42.-.el7 will be an update
  55. --> Finished Dependency Resolution
  56.  
  57. Dependencies Resolved
  58.  
  59. =============================================================================================================================================
  60. Package Arch Version Repository Size
  61. =============================================================================================================================================
  62. Installing:
  63. expat-devel x86_64 2.1.-.el7_3 base k
  64. openssl-devel x86_64 :1.0.2k-.el7 base 1.5 M
  65. pcre-devel x86_64 8.32-.el7 base k
  66. Installing for dependencies:
  67. keyutils-libs-devel x86_64 1.5.-.el7 base k
  68. krb5-devel x86_64 1.15.-.el7_7. updates k
  69. libcom_err-devel x86_64 1.42.-.el7 base k
  70. libkadm5 x86_64 1.15.-.el7_7. updates k
  71. libselinux-devel x86_64 2.5-14.1.el7 base k
  72. libsepol-devel x86_64 2.5-.el7 base k
  73. libverto-devel x86_64 0.2.-.el7 base k
  74. zlib-devel x86_64 1.2.-.el7 base k
  75. Updating for dependencies:
  76. e2fsprogs x86_64 1.42.-.el7 base k
  77. e2fsprogs-libs x86_64 1.42.-.el7 base k
  78. krb5-libs x86_64 1.15.-.el7_7. updates k
  79. libcom_err x86_64 1.42.-.el7 base k
  80. libss x86_64 1.42.-.el7 base k
  81. openssl x86_64 :1.0.2k-.el7 base k
  82. openssl-libs x86_64 :1.0.2k-.el7 base 1.2 M
  83.  
  84. Transaction Summary
  85. =============================================================================================================================================
  86. Install Packages (+ Dependent packages)
  87. Upgrade ( Dependent packages)
  88.  
  89. Total download size: 6.3 M
  90. Downloading packages:
  91. Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
  92. (/): e2fsprogs-libs-1.42.-.el7.x86_64.rpm | kB ::
  93. (/): expat-devel-2.1.-.el7_3.x86_64.rpm | kB ::
  94. (/): keyutils-libs-devel-1.5.-.el7.x86_64.rpm | kB ::
  95. (/): libcom_err-1.42.-.el7.x86_64.rpm | kB ::
  96. (/): e2fsprogs-1.42.-.el7.x86_64.rpm | kB ::
  97. (/): libselinux-devel-2.5-14.1.el7.x86_64.rpm | kB ::
  98. (/): libsepol-devel-2.5-.el7.x86_64.rpm | kB ::
  99. (/): krb5-libs-1.15.-.el7_7..x86_64.rpm | kB ::
  100. (/): libcom_err-devel-1.42.-.el7.x86_64.rpm | kB ::
  101. (/): libss-1.42.-.el7.x86_64.rpm | kB ::
  102. (/): openssl-1.0.2k-.el7.x86_64.rpm | kB ::
  103. (/): krb5-devel-1.15.-.el7_7..x86_64.rpm | kB ::
  104. (/): libkadm5-1.15.-.el7_7..x86_64.rpm | kB ::
  105. (/): openssl-devel-1.0.2k-.el7.x86_64.rpm | 1.5 MB ::
  106. (/): openssl-libs-1.0.2k-.el7.x86_64.rpm | 1.2 MB ::
  107. (/): libverto-devel-0.2.-.el7.x86_64.rpm | kB ::
  108. (/): zlib-devel-1.2.-.el7.x86_64.rpm | kB ::
  109. (/): pcre-devel-8.32-.el7.x86_64.rpm | kB ::
  110. ---------------------------------------------------------------------------------------------------------------------------------------------
  111. Total 2.6 MB/s | 6.3 MB ::
  112. Running transaction check
  113. Running transaction test
  114. Transaction test succeeded
  115. Running transaction
  116. Updating : libcom_err-1.42.-.el7.x86_64 /
  117. Updating : krb5-libs-1.15.-.el7_7..x86_64 /
  118. Updating : :openssl-libs-1.0.2k-.el7.x86_64 /
  119. Installing : libkadm5-1.15.-.el7_7..x86_64 /
  120. Installing : libcom_err-devel-1.42.-.el7.x86_64 /
  121. Updating : libss-1.42.-.el7.x86_64 /
  122. Updating : e2fsprogs-libs-1.42.-.el7.x86_64 /
  123. Installing : libsepol-devel-2.5-.el7.x86_64 /
  124. Installing : zlib-devel-1.2.-.el7.x86_64 /
  125. Installing : libverto-devel-0.2.-.el7.x86_64 /
  126. Installing : pcre-devel-8.32-.el7.x86_64 /
  127. Installing : libselinux-devel-2.5-14.1.el7.x86_64 /
  128. Installing : keyutils-libs-devel-1.5.-.el7.x86_64 /
  129. Installing : krb5-devel-1.15.-.el7_7..x86_64 /
  130. Installing : :openssl-devel-1.0.2k-.el7.x86_64 /
  131. Updating : e2fsprogs-1.42.-.el7.x86_64 /
  132. Updating : :openssl-1.0.2k-.el7.x86_64 /
  133. Installing : expat-devel-2.1.-.el7_3.x86_64 /
  134. Cleanup : :openssl-1.0.2k-.el7.x86_64 /
  135. Cleanup : e2fsprogs-1.42.-.el7.x86_64 /
  136. Cleanup : krb5-libs-1.15.-.el7.x86_64 /
  137. Cleanup : :openssl-libs-1.0.2k-.el7.x86_64 /
  138. Cleanup : e2fsprogs-libs-1.42.-.el7.x86_64 /
  139. Cleanup : libss-1.42.-.el7.x86_64 /
  140. Cleanup : libcom_err-1.42.-.el7.x86_64 /
  141. Verifying : keyutils-libs-devel-1.5.-.el7.x86_64 /
  142. Verifying : krb5-devel-1.15.-.el7_7..x86_64 /
  143. Verifying : libcom_err-devel-1.42.-.el7.x86_64 /
  144. Verifying : :openssl-libs-1.0.2k-.el7.x86_64 /
  145. Verifying : pcre-devel-8.32-.el7.x86_64 /
  146. Verifying : expat-devel-2.1.-.el7_3.x86_64 /
  147. Verifying : libverto-devel-0.2.-.el7.x86_64 /
  148. Verifying : zlib-devel-1.2.-.el7.x86_64 /
  149. Verifying : e2fsprogs-1.42.-.el7.x86_64 /
  150. Verifying : krb5-libs-1.15.-.el7_7..x86_64 /
  151. Verifying : libss-1.42.-.el7.x86_64 /
  152. Verifying : :openssl-1.0.2k-.el7.x86_64 /
  153. Verifying : :openssl-devel-1.0.2k-.el7.x86_64 /
  154. Verifying : libcom_err-1.42.-.el7.x86_64 /
  155. Verifying : libsepol-devel-2.5-.el7.x86_64 /
  156. Verifying : e2fsprogs-libs-1.42.-.el7.x86_64 /
  157. Verifying : libkadm5-1.15.-.el7_7..x86_64 /
  158. Verifying : libselinux-devel-2.5-14.1.el7.x86_64 /
  159. Verifying : :openssl-libs-1.0.2k-.el7.x86_64 /
  160. Verifying : e2fsprogs-1.42.-.el7.x86_64 /
  161. Verifying : :openssl-1.0.2k-.el7.x86_64 /
  162. Verifying : libss-1.42.-.el7.x86_64 /
  163. Verifying : e2fsprogs-libs-1.42.-.el7.x86_64 /
  164. Verifying : krb5-libs-1.15.-.el7.x86_64 /
  165. Verifying : libcom_err-1.42.-.el7.x86_64 /
  166.  
  167. Installed:
  168. expat-devel.x86_64 :2.1.-.el7_3 openssl-devel.x86_64 :1.0.2k-.el7 pcre-devel.x86_64 :8.32-.el7
  169.  
  170. Dependency Installed:
  171. keyutils-libs-devel.x86_64 :1.5.-.el7 krb5-devel.x86_64 :1.15.-.el7_7. libcom_err-devel.x86_64 :1.42.-.el7
  172. libkadm5.x86_64 :1.15.-.el7_7. libselinux-devel.x86_64 :2.5-14.1.el7 libsepol-devel.x86_64 :2.5-.el7
  173. libverto-devel.x86_64 :0.2.-.el7 zlib-devel.x86_64 :1.2.-.el7
  174.  
  175. Dependency Updated:
  176. e2fsprogs.x86_64 :1.42.-.el7 e2fsprogs-libs.x86_64 :1.42.-.el7 krb5-libs.x86_64 :1.15.-.el7_7.
  177. libcom_err.x86_64 :1.42.-.el7 libss.x86_64 :1.42.-.el7 openssl.x86_64 :1.0.2k-.el7
  178. openssl-libs.x86_64 :1.0.2k-.el7
  179.  
  180. Complete!
  181. [root@node101.yinzhengjie.org.cn ~]#

[root@node101.yinzhengjie.org.cn ~]# yum -y install pcre-devel openssl-devel expat-devel       #别忘记安装这3个依赖包

3>.解压httpd服务相关软件

  1. [root@node101.yinzhengjie.org.cn ~]# ll
  2. total
  3. -rw-r--r-- root root Oct : apr-1.6..tar.bz2
  4. -rw-r--r-- root root Oct : apr-util-1.6..tar.bz2
  5. -rw-r--r-- root root Oct : httpd-2.4..tar.bz2
  6. -rw-r--r-- root root Oct : php-7.1..tar.bz2
  7. -rw-r--r-- root root Oct : wordpress-4.9.-zh_CN.tar.gz
  8. [root@node101.yinzhengjie.org.cn ~]#
  9. [root@node101.yinzhengjie.org.cn ~]# tar xf apr-1.6..tar.bz2
  10. [root@node101.yinzhengjie.org.cn ~]#
  11. [root@node101.yinzhengjie.org.cn ~]# tar xf apr-util-1.6..tar.bz2
  12. [root@node101.yinzhengjie.org.cn ~]#
  13. [root@node101.yinzhengjie.org.cn ~]# tar xf httpd-2.4..tar.bz2
  14. [root@node101.yinzhengjie.org.cn ~]#
  15. [root@node101.yinzhengjie.org.cn ~]# ll
  16. total
  17. drwxr-xr-x Sep apr-1.6.
  18. -rw-r--r-- root root Oct : apr-1.6..tar.bz2
  19. drwxr-xr-x Oct apr-util-1.6.
  20. -rw-r--r-- root root Oct : apr-util-1.6..tar.bz2
  21. drwxr-sr-x root Oct httpd-2.4.
  22. -rw-r--r-- root root Oct : httpd-2.4..tar.bz2
  23. -rw-r--r-- root root Oct : php-7.1..tar.bz2
  24. -rw-r--r-- root root Oct : wordpress-4.9.-zh_CN.tar.gz
  25. [root@node101.yinzhengjie.org.cn ~]#
  26. [root@node101.yinzhengjie.org.cn ~]# cp -r apr-1.6. httpd-2.4./srclib/apr
  27. [root@node101.yinzhengjie.org.cn ~]#
  28. [root@node101.yinzhengjie.org.cn ~]# cp -r apr-util-1.6. httpd-2.4./srclib/apr-util
  29. [root@node101.yinzhengjie.org.cn ~]#
  30. [root@node101.yinzhengjie.org.cn ~]# cd httpd-2.4.
  31. [root@node101.yinzhengjie.org.cn ~/httpd-2.4.]#
  32. [root@node101.yinzhengjie.org.cn ~/httpd-2.4.]# ls
  33. ABOUT_APACHE apache_probes.d BuildBin.dsp config.layout emacs-style httpd.spec LAYOUT LICENSE NOTICE README.cmake srclib
  34. acinclude.m4 ap.d buildconf configure httpd.dep include libhttpd.dep Makefile.in NWGNUmakefile README.platforms support
  35. Apache-apr2.dsw build CHANGES configure.in httpd.dsp INSTALL libhttpd.dsp Makefile.win os ROADMAP test
  36. Apache.dsw BuildAll.dsp CMakeLists.txt docs httpd.mak InstallBin.dsp libhttpd.mak modules README server VERSIONING
  37. [root@node101.yinzhengjie.org.cn ~/httpd-2.4.]#
  38. [root@node101.yinzhengjie.org.cn ~/httpd-2.4.]#

4>.编译安装httpd服务

  1. [root@node101.yinzhengjie.org.cn ~]# ll
  2. total
  3. drwxr-xr-x Sep apr-1.6.
  4. -rw-r--r-- root root Oct : apr-1.6..tar.bz2
  5. drwxr-xr-x Oct apr-util-1.6.
  6. -rw-r--r-- root root Oct : apr-util-1.6..tar.bz2
  7. drwxr-sr-x root Oct httpd-2.4.
  8. -rw-r--r-- root root Oct : httpd-2.4..tar.bz2
  9. -rw-r--r-- root root Oct : php-7.1..tar.bz2
  10. -rw-r--r-- root root Oct : wordpress-4.9.-zh_CN.tar.gz
  11. [root@node101.yinzhengjie.org.cn ~]#
  12. [root@node101.yinzhengjie.org.cn ~]#
  13. [root@node101.yinzhengjie.org.cn ~]# cd httpd-2.4.
  14. [root@node101.yinzhengjie.org.cn ~/httpd-2.4.]#
  15. [root@node101.yinzhengjie.org.cn ~/httpd-2.4.]# ./configure \
  16. > --prefix=/yinzhengjie/softwares/httpd24 \        #配置指定的安装路径,以后要是不用了直接删除即可,方便咱们管理。
  17. > --enable-so \                         #启用动态库,即配置支持基于DSO方式动态加载模块。
  18. > --enable-ssl \                        #启用加密,即配置支持https协议。
  19. > --enable-cgi \                        #启用CGI,即配置支持CGI机制。
  20. > --enable-rewrite \                      #启用重定向功能,即配置支持URL重写机制。
  21. > --with-zlib \                         #启用压缩功能,即配置zlib(它是网络上发送数据报文通用压缩库的API)库,你可以理解是支持压缩功能。
  22. > --with-pcre \                         #启用正则表达式,即配置支持prel(支持正则)
  23. > --with-included-apr \                    #表示在httpd的安装包里面继承了apr软件,说白了就是我们上一步骤的mv操作。
  24. > --enable-modules=most \                   #配置大多数常用的模块
  25. > --enable-mpms-shared=all \                 #配置所有的mpm模块都编译进来
  26. > --with-mpm=prefork                      #配置指定使用prefork模式,当然你也可以选择worker模式或者event模式均可,由于event是该版本的新特性,因此我们就用新的来测试一下吧。
  27. ......
  28. config.status: executing default commands
  29. configure: summary of build options:
  30.  
  31. Server Version: 2.4.
  32. Install prefix: /yinzhengjie/softwares/httpd24
  33. C compiler: gcc -std=gnu99
  34. CFLAGS: -g -O2 -pthread
  35. CPPFLAGS: -DLINUX -D_REENTRANT -D_GNU_SOURCE
  36. LDFLAGS:
  37. LIBS:
  38. C preprocessor: gcc -E
  39.  
  40. [root@node101.yinzhengjie.org.cn ~/httpd-2.4.]#
  1. [root@node101.yinzhengjie.org.cn ~/httpd-2.4.]# lscpu
  2. Architecture: x86_64
  3. CPU op-mode(s): -bit, -bit
  4. Byte Order: Little Endian
  5. CPU(s):
  6. On-line CPU(s) list: -
  7. Thread(s) per core:
  8. Core(s) per socket:
  9. Socket(s):
  10. NUMA node(s):
  11. Vendor ID: GenuineIntel
  12. CPU family:
  13. Model:
  14. Model name: Intel(R) Core(TM) i7-8750H CPU @ .20GHz
  15. Stepping:
  16. CPU MHz: 2208.004
  17. BogoMIPS: 4416.00
  18. Hypervisor vendor: KVM
  19. Virtualization type: full
  20. L1d cache: 32K
  21. L1i cache: 32K
  22. L2 cache: 256K
  23. L3 cache: 9216K
  24. NUMA node0 CPU(s): -
  25. Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl
  26. xtopology nonstop_tsc eagerfpu pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx rdrand hypervisor lahf_lm abm 3dnowprefetch fsgsbase avx2 invpcid rdseed clflushopt flush_l1d[root@node101.yinzhengjie.org.cn ~/httpd-2.4.]#
  27. [root@node101.yinzhengjie.org.cn ~/httpd-2.4.]# make -j && make install  #同时启用4个CPU来编译源代码,这个数字根据你的服务器cpu核心数而定,可以通过上面lscpu的命令查看你的CPU核心数
  28. ......
  29. Installing configuration files
  30. mkdir /yinzhengjie/softwares/httpd24/conf
  31. mkdir /yinzhengjie/softwares/httpd24/conf/extra
  32. mkdir /yinzhengjie/softwares/httpd24/conf/original
  33. mkdir /yinzhengjie/softwares/httpd24/conf/original/extra
  34. Installing HTML documents
  35. mkdir /yinzhengjie/softwares/httpd24/htdocs
  36. Installing error documents
  37. mkdir /yinzhengjie/softwares/httpd24/error
  38. Installing icons
  39. mkdir /yinzhengjie/softwares/httpd24/icons
  40. mkdir /yinzhengjie/softwares/httpd24/logs
  41. Installing CGIs
  42. mkdir /yinzhengjie/softwares/httpd24/cgi-bin
  43. Installing header files
  44. Installing build system files
  45. Installing man pages and online manual
  46. mkdir /yinzhengjie/softwares/httpd24/man
  47. mkdir /yinzhengjie/softwares/httpd24/man/man1
  48. mkdir /yinzhengjie/softwares/httpd24/man/man8
  49. mkdir /yinzhengjie/softwares/httpd24/manual
  50. make[]: Leaving directory `/root/httpd-2.4.'
  51. [root@node101.yinzhengjie.org.cn ~/httpd-2.4.]#
  52. [root@node101.yinzhengjie.org.cn ~/httpd-2.4.]# cd
  53. [root@node101.yinzhengjie.org.cn ~]#
  54. [root@node101.yinzhengjie.org.cn ~]# ll /yinzhengjie/softwares/httpd24
  55. total
  56. drwxr-xr-x root root Dec : bin
  57. drwxr-xr-x root root Dec : build
  58. drwxr-xr-x root root Dec : cgi-bin
  59. drwxr-xr-x root root Dec : conf
  60. drwxr-xr-x root root Dec : error
  61. drwxr-sr-x root root Oct htdocs
  62. drwxr-xr-x root root Dec : icons
  63. drwxr-xr-x root root Dec : include
  64. drwxr-xr-x root root Dec : lib
  65. drwxr-xr-x root root Dec : logs
  66. drwxr-xr-x root root Dec : man
  67. drwxr-sr-x root root Oct manual
  68. drwxr-xr-x root root Dec : modules
  69. [root@node101.yinzhengjie.org.cn ~]#

[root@node101.yinzhengjie.org.cn ~/httpd-2.4.37]# make -j 4 && make install  #同时启用4个CPU来编译源代码

  1. [root@node101.yinzhengjie.org.cn ~]# ll /yinzhengjie/softwares/httpd24/ #软件安装成功啦
  2. total
  3. drwxr-xr-x root root Dec : bin #可以使用的工具,基本上都是可执行脚本
  4. drwxr-xr-x root root Dec : build #编译时的一些工具
  5. drwxr-xr-x root root Dec : cgi-bin #存放CGI执行脚本的目录
  6. drwxr-xr-x root root Dec : conf #存放配置文件的目录,如果我们使用了"--sysconfdir=/yinzhengjie/etc/http24"则会在configure时指定配置文件的存放处,那么该目录也将不存在啦~
  7. drwxr-xr-x root root Dec : error #存放错误页面的目录
  8. drwxr-sr-x root root Aug : htdocs #存放网页的目录
  9. drwxr-xr-x root root Dec : icons #存放一些二进制文件的目录
  10. drwxr-xr-x root root Dec : include #存放头部文件的目录
  11. drwxr-xr-x root root Dec : lib #存放相关依赖库目录
  12. drwxr-xr-x root root Dec : logs #存放日志的目录
  13. drwxr-xr-x root root Dec : man #存放帮助文档目录
  14. drwxr-sr-x root root Aug : manual #存放手册的目录
  15. drwxr-xr-x root root Dec : modules #存放模块的目录
  16. [root@node101.yinzhengjie.org.cn ~]#

5>.为httpd服务配置环境变量

  1. [root@node101.yinzhengjie.org.cn ~]# echo 'PATH=/yinzhengjie/softwares/httpd24/bin:$PATH' > /etc/profile.d/lamp.sh
  2. [root@node101.yinzhengjie.org.cn ~]#
  3. [root@node101.yinzhengjie.org.cn ~]# . /etc/profile.d/lamp.sh
  4. [root@node101.yinzhengjie.org.cn ~]#
  5. [root@node101.yinzhengjie.org.cn ~]# cat /etc/profile.d/lamp.sh
  6. PATH=/yinzhengjie/softwares/httpd24/bin:$PATH
  7. [root@node101.yinzhengjie.org.cn ~]#
  8. [root@node101.yinzhengjie.org.cn ~]# echo $PATH
  9. /yinzhengjie/softwares/httpd24/bin:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/home/softwares/jdk1..0_201/bin:/root/bin:/home/softwares/mysql/bin/
    [root@node101.yinzhengjie.org.cn ~]#
  10. [root@node101.yinzhengjie.org.cn ~]#

6>.启动apache服务

  1. [root@node101.yinzhengjie.org.cn ~]# source /etc/profile.d/lamp.sh
  2. [root@node101.yinzhengjie.org.cn ~]#
  3. [root@node101.yinzhengjie.org.cn ~]# ss -ntl
  4. State Recv-Q Send-Q Local Address:Port Peer Address:Port
  5. LISTEN *: *:*
  6. LISTEN ::: :::*
  7. [root@node101.yinzhengjie.org.cn ~]#
  8. [root@node101.yinzhengjie.org.cn ~]# apachectl start          #启动服务后,客户端可以访问apache的网页啦~
  9. [root@node101.yinzhengjie.org.cn ~]#
  10. [root@node101.yinzhengjie.org.cn ~]# ss -ntl
  11. State Recv-Q Send-Q Local Address:Port Peer Address:Port
  12. LISTEN *: *:*
  13. LISTEN *: *:*
  14. LISTEN ::: :::*
  15. [root@node101.yinzhengjie.org.cn ~]#

7>.修改apache默认的启动用户

  1. [root@node101.yinzhengjie.org.cn ~]# ps aux | grep httpd
  2. root 0.0 0.0 ? Ss : : /yinzhengjie/softwares/httpd24/bin/httpd -k start
  3. daemon 0.0 0.0 ? S : : /yinzhengjie/softwares/httpd24/bin/httpd -k start
  4. daemon 0.0 0.0 ? S : : /yinzhengjie/softwares/httpd24/bin/httpd -k start
  5. daemon 0.0 0.0 ? S : : /yinzhengjie/softwares/httpd24/bin/httpd -k start
  6. daemon 0.0 0.0 ? S : : /yinzhengjie/softwares/httpd24/bin/httpd -k start
  7. daemon 0.0 0.0 ? S : : /yinzhengjie/softwares/httpd24/bin/httpd -k start
  8. daemon 0.0 0.0 ? S : : /yinzhengjie/softwares/httpd24/bin/httpd -k start
  9. root 0.0 0.0 pts/ S+ : : grep --color=auto httpd
  10. [root@node101.yinzhengjie.org.cn ~]#
  11. [root@node101.yinzhengjie.org.cn ~]# useradd -r -s /sbin/nologin apache
  12. [root@node101.yinzhengjie.org.cn ~]#
  13. [root@node101.yinzhengjie.org.cn ~]# egrep -v "^#| ^$|LogFormat" /yinzhengjie/softwares/httpd24/conf/httpd.conf | grep User        #很显然,该配置文件中已经定义了httpd服务是由daemon用户管理
  14. User daemon
  15. [root@node101.yinzhengjie.org.cn ~]#
  16. [root@node101.yinzhengjie.org.cn ~]# vim /yinzhengjie/softwares/httpd24/conf/httpd.conf                              #咱们可以修改httpd默认的启动用户。
  17. [root@node101.yinzhengjie.org.cn ~]#
  18. [root@node101.yinzhengjie.org.cn ~]# egrep -v "^#| ^$|LogFormat" /yinzhengjie/softwares/httpd24/conf/httpd.conf | grep User
  19. User apache
  20. [root@node101.yinzhengjie.org.cn ~]#
  21. [root@node101.yinzhengjie.org.cn ~]# apachectl restart
  22. [root@node101.yinzhengjie.org.cn ~]#
  23. [root@node101.yinzhengjie.org.cn ~]# ps aux | grep httpd
  24. root 0.0 0.0 ? Ss : : /yinzhengjie/softwares/httpd24/bin/httpd -k start
  25. apache 0.0 0.0 ? S : : /yinzhengjie/softwares/httpd24/bin/httpd -k start
  26. apache 0.0 0.0 ? S : : /yinzhengjie/softwares/httpd24/bin/httpd -k start
  27. apache 0.0 0.0 ? S : : /yinzhengjie/softwares/httpd24/bin/httpd -k start
  28. apache 0.0 0.0 ? S : : /yinzhengjie/softwares/httpd24/bin/httpd -k start
  29. apache 0.0 0.0 ? S : : /yinzhengjie/softwares/httpd24/bin/httpd -k start
  30. root 0.0 0.0 pts/ S+ : : grep --color=auto httpd
  31. [root@node101.yinzhengjie.org.cn ~]#

 

三.以二进制方式安装mariadb服务

1>.创建mysql用户

  1. [root@node108.yinzhengjie.org.cn ~]# useradd -s /sbin/nologin -r mysql -d /data/mysql
  2. [root@node108.yinzhengjie.org.cn ~]#
  3. [root@node108.yinzhengjie.org.cn ~]# mkdir /data/mysql -pv
  4. mkdir: created directory ‘/data
  5. mkdir: created directory ‘/data/mysql
  6. [root@node108.yinzhengjie.org.cn ~]#
  7. [root@node108.yinzhengjie.org.cn ~]# chown mysql.mysql /data/mysql/
  8. [root@node108.yinzhengjie.org.cn ~]#
  9. [root@node108.yinzhengjie.org.cn ~]# ll -d /data/mysql/
  10. drwxr-xr-x mysql mysql Dec : /data/mysql/
  11. [root@node108.yinzhengjie.org.cn ~]#
  12. [root@node108.yinzhengjie.org.cn ~]#

2>.将二进制的mariadb数据包创建软连接并授权给mysql用户

  1. [root@node108.yinzhengjie.org.cn ~]# ll
  2. total
  3. -rw-r--r-- root root Oct : mariadb-10.2.-linux-x86_64.tar.gz
  4. [root@node108.yinzhengjie.org.cn ~]#
  5. [root@node108.yinzhengjie.org.cn ~]# tar xf mariadb-10.2.-linux-x86_64.tar.gz -C /usr/local/
  6. [root@node108.yinzhengjie.org.cn ~]#
  7. [root@node108.yinzhengjie.org.cn ~]# ll /usr/local/mariadb-10.2.-linux-x86_64/ -d
  8. drwxr-xr-x root root Dec : /usr/local/mariadb-10.2.-linux-x86_64/
  9. [root@node108.yinzhengjie.org.cn ~]#
  10. [root@node108.yinzhengjie.org.cn ~]# chown -R mysql.mysql /usr/local/mariadb-10.2.-linux-x86_64/
  11. [root@node108.yinzhengjie.org.cn ~]#
  12. [root@node108.yinzhengjie.org.cn ~]# ln -s /usr/local/mariadb-10.2.-linux-x86_64/ /usr/local/mysql
  13. [root@node108.yinzhengjie.org.cn ~]#
  14. [root@node108.yinzhengjie.org.cn ~]# ll /usr/local/mysql/ -d
  15. drwxr-xr-x mysql mysql Dec : /usr/local/mysql/
  16. [root@node108.yinzhengjie.org.cn ~]#

3>.初始化mariadb的数据库

  1. [root@node108.yinzhengjie.org.cn ~]# cd /usr/local/mysql/
  2. [root@node108.yinzhengjie.org.cn /usr/local/mysql]#
  3. [root@node108.yinzhengjie.org.cn /usr/local/mysql]# scripts/mysql_install_db --user=mysql --datadir=/data/mysql/
  4. Installing MariaDB/MySQL system tables in '/data/mysql/' ...
  5. OK
  6.  
  7. To start mysqld at boot time you have to copy
  8. support-files/mysql.server to the right place for your system
  9.  
  10. PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
  11. To do so, start the server, then issue the following commands:
  12.  
  13. './bin/mysqladmin' -u root password 'new-password'
  14. './bin/mysqladmin' -u root -h node108.yinzhengjie.org.cn password 'new-password'
  15.  
  16. Alternatively you can run:
  17. './bin/mysql_secure_installation'
  18.  
  19. which will also give you the option of removing the test
  20. databases and anonymous user created by default. This is
  21. strongly recommended for production servers.
  22.  
  23. See the MariaDB Knowledgebase at http://mariadb.com/kb or the
  24. MySQL manual for more instructions.
  25.  
  26. You can start the MariaDB daemon with:
  27. cd '.' ; ./bin/mysqld_safe --datadir='/data/mysql/'
  28.  
  29. You can test the MariaDB daemon with mysql-test-run.pl
  30. cd './mysql-test' ; perl mysql-test-run.pl
  31.  
  32. Please report any problems at http://mariadb.org/jira
  33.  
  34. The latest information about MariaDB is available at http://mariadb.org/.
  35. You can find additional information about the MySQL part at:
  36. http://dev.mysql.com
  37. Consider joining MariaDB's strong and vibrant community:
  38. https://mariadb.org/get-involved/
  39.  
  40. [root@node108.yinzhengjie.org.cn /usr/local/mysql]#
  41. [root@node108.yinzhengjie.org.cn /usr/local/mysql]# ll /data/mysql/
  42. total
  43. -rw-rw---- mysql mysql Dec : aria_log.
  44. -rw-rw---- mysql mysql Dec : aria_log_control
  45. -rw-rw---- mysql mysql Dec : ib_buffer_pool
  46. -rw-rw---- mysql mysql Dec : ibdata1
  47. -rw-rw---- mysql mysql Dec : ib_logfile0
  48. -rw-rw---- mysql mysql Dec : ib_logfile1
  49. drwx------ mysql root Dec : mysql
  50. drwx------ mysql mysql Dec : performance_schema
  51. drwx------ mysql root Dec : test
  52. [root@node108.yinzhengjie.org.cn /usr/local/mysql]#

4>.创建mysql的配置文件

  1. [root@node108.yinzhengjie.org.cn /usr/local/mysql]# mkdir /etc/mysql
  2. [root@node108.yinzhengjie.org.cn /usr/local/mysql]#
  3. [root@node108.yinzhengjie.org.cn /usr/local/mysql]# cp support-files/my-huge.cnf /etc/mysql/my.cnf
  4. [root@node108.yinzhengjie.org.cn /usr/local/mysql]#
  5. [root@node108.yinzhengjie.org.cn /usr/local/mysql]# vim /etc/mysql/my.cnf
  6. [root@node108.yinzhengjie.org.cn /usr/local/mysql]#
  7. [root@node108.yinzhengjie.org.cn /usr/local/mysql]# egrep -v "^ *#|^$" /etc/mysql/my.cnf
  8. [client]
  9. port =
  10. socket = /tmp/mysql.sock
  11. [mysqld]
  12. datadir=/data/mysql                #手动添加改行数据即可启动数据库,因为咱们修改了MySQL数据库默认存放位置,你可以自行调优其它参数,但这并不是本篇博客的主题。
  13. port =
  14. socket = /tmp/mysql.sock
  15. skip-external-locking
  16. key_buffer_size = 384M
  17. max_allowed_packet = 1M
  18. table_open_cache =
  19. sort_buffer_size = 2M
  20. read_buffer_size = 2M
  21. read_rnd_buffer_size = 8M
  22. myisam_sort_buffer_size = 64M
  23. thread_cache_size =
  24. query_cache_size = 32M
  25. thread_concurrency =
  26. log-bin=mysql-bin
  27. server-id =
  28. [mysqldump]
  29. quick
  30. max_allowed_packet = 16M
  31. [mysql]
  32. no-auto-rehash
  33. [myisamchk]
  34. key_buffer_size = 256M
  35. sort_buffer_size = 256M
  36. read_buffer = 2M
  37. write_buffer = 2M
  38. [mysqlhotcopy]
  39. interactive-timeout
  40. [root@node108.yinzhengjie.org.cn /usr/local/mysql]#

5>.拷贝启动脚本并启动数据库

  1. [root@node108.yinzhengjie.org.cn /usr/local/mysql]# cp support-files/mysql.server /etc/init.d/mysqld
  2. [root@node108.yinzhengjie.org.cn /usr/local/mysql]#
  3. [root@node108.yinzhengjie.org.cn /usr/local/mysql]# ll /etc/init.d/mysqld
  4. -rwxr-xr-x root root Dec : /etc/init.d/mysqld
  5. [root@node108.yinzhengjie.org.cn /usr/local/mysql]#
  6. [root@node108.yinzhengjie.org.cn /usr/local/mysql]# chkconfig --list
  7.  
  8. Note: This output shows SysV services only and does not include native
  9. systemd services. SysV configuration data might be overridden by native
  10. systemd configuration.
  11.  
  12. If you want to list systemd services use 'systemctl list-unit-files'.
  13. To see services enabled on particular target use
  14. 'systemctl list-dependencies [target]'.
  15.  
  16. netconsole :off :off :off :off :off :off :off
  17. network :off :off :on :on :on :on :off
  18. [root@node108.yinzhengjie.org.cn /usr/local/mysql]#
  19. [root@node108.yinzhengjie.org.cn /usr/local/mysql]# chkconfig --add mysqld
  20. [root@node108.yinzhengjie.org.cn /usr/local/mysql]#
  21. [root@node108.yinzhengjie.org.cn /usr/local/mysql]# chkconfig --list
  22.  
  23. Note: This output shows SysV services only and does not include native
  24. systemd services. SysV configuration data might be overridden by native
  25. systemd configuration.
  26.  
  27. If you want to list systemd services use 'systemctl list-unit-files'.
  28. To see services enabled on particular target use
  29. 'systemctl list-dependencies [target]'.
  30.  
  31. mysqld :off :off :on :on :on :on :off
  32. netconsole :off :off :off :off :off :off :off
  33. network :off :off :on :on :on :on :off
  34. [root@node108.yinzhengjie.org.cn /usr/local/mysql]#
  35. [root@node108.yinzhengjie.org.cn /usr/local/mysql]# service mysqld start
  36. Starting MariaDB. :: mysqld_safe Logging to '/var/log/mariadb/mariadb.log'.
  37. :: mysqld_safe Starting mysqld daemon with databases from /data/mysql
  38. [ OK ]
  39. [root@node108.yinzhengjie.org.cn /usr/local/mysql]#
  40. [root@node108.yinzhengjie.org.cn /usr/local/mysql]# ss -ntl
  41. State Recv-Q Send-Q Local Address:Port Peer Address:Port
  42. LISTEN *: *:*
  43. LISTEN ::: :::*
  44. LISTEN ::: :::*
  45. [root@node108.yinzhengjie.org.cn /usr/local/mysql]#

6>.配置mariadb的环境变量

  1. [root@node108.yinzhengjie.org.cn /usr/local/mysql]# echo PATH=/usr/local/mysql/bin/:$PATH > /etc/profile.d/mysql.sh
  2. [root@node108.yinzhengjie.org.cn /usr/local/mysql]#
  3. [root@node108.yinzhengjie.org.cn /usr/local/mysql]# ll /etc/profile.d/mysql.sh
  4. -rw-r--r-- root root Dec : /etc/profile.d/mysql.sh
  5. [root@node108.yinzhengjie.org.cn /usr/local/mysql]#
  6. [root@node108.yinzhengjie.org.cn /usr/local/mysql]# cat /etc/profile.d/mysql.sh
  7. PATH=/usr/local/mysql/bin/:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/home/softwares/jdk1..0_201/bin:/root/bin
  8. [root@node108.yinzhengjie.org.cn /usr/local/mysql]#
  9. [root@node108.yinzhengjie.org.cn /usr/local/mysql]# . /etc/profile.d/mysql.sh
  10. [root@node108.yinzhengjie.org.cn /usr/local/mysql]#
  11. [root@node108.yinzhengjie.org.cn /usr/local/mysql]# mysql
  12. Welcome to the MariaDB monitor. Commands end with ; or \g.
  13. Your MariaDB connection id is
  14. Server version: 10.2.-MariaDB-log MariaDB Server
  15.  
  16. Copyright (c) , , Oracle, MariaDB Corporation Ab and others.
  17.  
  18. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  19.  
  20. MariaDB [(none)]>

7>.在数据库授权,允许咱们的wordpress服务可以在服务器上安装

  1. [root@node108.yinzhengjie.org.cn /usr/local/mysql]# mysql
  2. Welcome to the MariaDB monitor. Commands end with ; or \g.
  3. Your MariaDB connection id is
  4. Server version: 10.2.-MariaDB-log MariaDB Server
  5.  
  6. Copyright (c) , , Oracle, MariaDB Corporation Ab and others.
  7.  
  8. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  9.  
  10. MariaDB [(none)]> CREATE DATABASE wordpress DEFAULT CHARACTER SET = utf8mb4;
  11. Query OK, row affected (0.00 sec)
  12.  
  13. MariaDB [(none)]> GRANT ALL ON wordpress.* TO jason@'172.30.1.%' IDENTIFIED BY 'yinzhengjie';
  14. Query OK, rows affected (0.00 sec)
  15.  
  16. MariaDB [(none)]> QUIT
  17. Bye
  18. [root@node108.yinzhengjie.org.cn /usr/local/mysql]#

四.PHP的安装方式概述

1>.php模块方式编译安装LAMP概述(不推荐)

  1. 编译安装php-5.6
  2. 相关依赖包:
  3.     libxml2-devel bzip2-devel libmcrypt-devel (epel)
      配置安装参数:
  4.     ./configure --prefix=/app/php --with-mysql=/usr/local/mysql --with-openssl --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-mbstring --with-png-dir --with-jpeg-dir --with-freetype-dir --with-zlib --with-libxml-dir=/usr --enable-xml --enable-sockets --with-apxs2=/app/httpd24/bin/apxs --with-mcrypt --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --with-bz2
  5.   编译并安装:
  6.     make -j && make install
  7.  
  8. 编译安装php-7.1.7
      配置:
        ./configure --prefix=/app/php --enable-mysqlnd --with-mysqli=mysqlnd --with-openssl --with-pdo-mysql=mysqlnd --enable-mbstring --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --enable-sockets --with-apxs2=/app/httpd24/bin/apxs --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --enable-maintainer-zts --disable-fileinfo
  9.   注意:
        php-.0以上版本使用--enable-mysqlnd --with-mysqli=mysqlnd ,原--with-mysql不再支持
  10.  
  11. php提供配置文件
  12.   cp php.ini-production /etc/php.ini
  13.  
  14. 编辑apache配置文件httpd.conf,以使apache支持php
  15.   vim /etc/httpd24/conf/httpd.conf
  16.     1>.加二行
  17.       AddType application/x-httpd-php .php
  18.       AddType application/x-httpd-php-source .phps
  19.   2>.定位至DirectoryIndex index.html
  20.       修改为DirectoryIndex index.php index.html
  21.  
  22. 编译安装完成后需要重启httpd服务,因为基于模块方式安装的php模块是依赖于httpd服务的。
  23.     apachectl restart

2>.fpm方式编译安装LAMP概述(强烈推荐)

  1. tar xvf php-7.1..tar.bz2
  2. cd php-7.1./
  3. ./configure --prefix=/app/php \
  4. --enable-mysqlnd \
  5. --with-mysqli=mysqlnd \
  6. --with-openssl \
  7. --with-pdo-mysql=mysqlnd \
  8. --enable-mbstring \
  9. --with-freetype-dir \
  10. --with-jpeg-dir \
  11. --with-png-dir \
  12. --with-zlib \
  13. --with-libxml-dir=/usr \
  14. --enable-xml \
  15. --enable-sockets \
  16. --enable-fpm \
  17. --with-config-file-path=/etc \
  18. --with-config-file-scan-dir=/etc/php.d \
  19. --enable-maintainer-zts \
  20. --disable-fileinfo
  21.  
  22. cp php.ini-production /etc/php.ini
  23. cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
  24. chmod +x /etc/init.d/php-fpm
  25. chkconfig --add php-fpm
  26. chkconfig php-fpm on
  27. cd /app/php/etc
  28. cp php-fpm.conf.default php-fpm.conf
  29. cp php-fpm.d/www.conf.default php-fpm.d/www.conf
  30. service php-fpm start
  31.  
  32. 配置httpd支持php
  33.   vim /app/httpd24/conf/httpd.conf
  34.     取消下面两行的注释
  35.       LoadModule proxy_module modules/mod_proxy.so
  36.       LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
  37.     修改下面行
  38.       <IfModule dir_module>
  39.       DirectoryIndex index.php index.html
  40.       </IfModule>
  41.     加下面四行
  42.       AddType application/x-httpd-php .php
  43.       AddType application/x-httpd-php-source .phps
  44.       ProxyRequests Off
  45.       ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:9000/app/httpd24/htdocs/$1

 

五.编译安装PHP-FPM模式(基于fastcgi模式)

1>.安装依赖包

  1. [root@node101.yinzhengjie.org.cn ~]# yum -y install epel-release
  2. Loaded plugins: fastestmirror
  3. Loading mirror speeds from cached hostfile
  4. * base: mirror.bit.edu.cn
  5. * extras: mirror.bit.edu.cn
  6. * updates: mirror.jdcloud.com
  7. Resolving Dependencies
  8. --> Running transaction check
  9. ---> Package epel-release.noarch :- will be installed
  10. --> Finished Dependency Resolution
  11.  
  12. Dependencies Resolved
  13.  
  14. ============================================================================================================================================================================
  15. Package Arch Version Repository Size
  16. ============================================================================================================================================================================
  17. Installing:
  18. epel-release noarch - extras k
  19.  
  20. Transaction Summary
  21. ============================================================================================================================================================================
  22. Install Package
  23.  
  24. Total download size: k
  25. Installed size: k
  26. Downloading packages:
  27. epel-release--.noarch.rpm | kB ::
  28. Running transaction check
  29. Running transaction test
  30. Transaction test succeeded
  31. Running transaction
  32. Installing : epel-release--.noarch /
  33. Verifying : epel-release--.noarch /
  34.  
  35. Installed:
  36. epel-release.noarch :-
  37.  
  38. Complete!
  39. [root@node101.yinzhengjie.org.cn ~]#

[root@node101.yinzhengjie.org.cn ~]# yum -y install epel-release

  1. [root@node101.yinzhengjie.org.cn ~]# yum -y install libxml2-devel bzip2-devel libmcrypt-devel
  2. Loaded plugins: fastestmirror
  3. Loading mirror speeds from cached hostfile
  4. epel/x86_64/metalink | 7.2 kB ::
  5. * base: mirror.bit.edu.cn
  6. * epel: mirrors.yun-idc.com
  7. * extras: mirror.bit.edu.cn
  8. * updates: mirror.jdcloud.com
  9. epel | 5.3 kB ::
  10. (/): epel/x86_64/group_gz | kB ::
  11. (/): epel/x86_64/primary_db | 6.9 MB ::
  12. epel/x86_64/updateinfo FAILED
  13. http://my.mirrors.thegigabit.com/epel/7/x86_64/repodata/51d82b56117bd789590c071ce452588fa7f9f9f22971b3c3d568a8e37f28a6be-updateinfo.xml.bz2: [Errno 14] HTTP Error 404 - Not
  14. FoundTrying other mirror.
  15. To address this issue please refer to the below wiki article
  16.  
  17. https://wiki.centos.org/yum-errors
  18.  
  19. If above article doesn't help to resolve this issue please use https://bugs.centos.org/.
  20.  
  21. (/): epel/x86_64/updateinfo | 1.0 MB ::
  22. Resolving Dependencies
  23. --> Running transaction check
  24. ---> Package bzip2-devel.x86_64 :1.0.-.el7 will be installed
  25. ---> Package libmcrypt-devel.x86_64 :2.5.-.el7 will be installed
  26. --> Processing Dependency: libmcrypt = 2.5.-.el7 for package: libmcrypt-devel-2.5.-.el7.x86_64
  27. --> Processing Dependency: libmcrypt.so.()(64bit) for package: libmcrypt-devel-2.5.-.el7.x86_64
  28. ---> Package libxml2-devel.x86_64 :2.9.-.el7_2. will be installed
  29. --> Processing Dependency: xz-devel for package: libxml2-devel-2.9.-.el7_2..x86_64
  30. --> Running transaction check
  31. ---> Package libmcrypt.x86_64 :2.5.-.el7 will be installed
  32. ---> Package xz-devel.x86_64 :5.2.-.el7 will be installed
  33. --> Finished Dependency Resolution
  34.  
  35. Dependencies Resolved
  36.  
  37. ============================================================================================================================================================================
  38. Package Arch Version Repository Size
  39. ============================================================================================================================================================================
  40. Installing:
  41. bzip2-devel x86_64 1.0.-.el7 base k
  42. libmcrypt-devel x86_64 2.5.-.el7 epel k
  43. libxml2-devel x86_64 2.9.-.el7_2. base 1.0 M
  44. Installing for dependencies:
  45. libmcrypt x86_64 2.5.-.el7 epel k
  46. xz-devel x86_64 5.2.-.el7 base k
  47.  
  48. Transaction Summary
  49. ============================================================================================================================================================================
  50. Install Packages (+ Dependent packages)
  51.  
  52. Total download size: 1.4 M
  53. Installed size: 9.6 M
  54. Downloading packages:
  55. warning: /var/cache/yum/x86_64//epel/packages/libmcrypt-2.5.-.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY ] 0.0 B/s | B --:--:-- ETA
  56. Public key for libmcrypt-2.5.-.el7.x86_64.rpm is not installed
  57. (/): libmcrypt-2.5.-.el7.x86_64.rpm | kB ::
  58. (/): libmcrypt-devel-2.5.-.el7.x86_64.rpm | kB ::
  59. (/): bzip2-devel-1.0.-.el7.x86_64.rpm | kB ::
  60. (/): xz-devel-5.2.-.el7.x86_64.rpm | kB ::
  61. (/): libxml2-devel-2.9.-.el7_2..x86_64.rpm | 1.0 MB ::
  62. ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  63. Total kB/s | 1.4 MB ::
  64. Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
  65. Importing GPG key 0x352C64E5:
  66. Userid : "Fedora EPEL (7) <epel@fedoraproject.org>"
  67. Fingerprint: 91e9 7d7c 4a5e 96f1 7f3e 888f 6a2f aea2 352c 64e5
  68. Package : epel-release--.noarch (@extras)
  69. From : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-
  70. Running transaction check
  71. Running transaction test
  72. Transaction test succeeded
  73. Running transaction
  74. Installing : xz-devel-5.2.-.el7.x86_64 /
  75. Installing : libmcrypt-2.5.-.el7.x86_64 /
  76. Installing : libmcrypt-devel-2.5.-.el7.x86_64 /
  77. Installing : libxml2-devel-2.9.-.el7_2..x86_64 /
  78. Installing : bzip2-devel-1.0.-.el7.x86_64 /
  79. Verifying : bzip2-devel-1.0.-.el7.x86_64 /
  80. Verifying : libmcrypt-devel-2.5.-.el7.x86_64 /
  81. Verifying : libmcrypt-2.5.-.el7.x86_64 /
  82. Verifying : xz-devel-5.2.-.el7.x86_64 /
  83. Verifying : libxml2-devel-2.9.-.el7_2..x86_64 /
  84.  
  85. Installed:
  86. bzip2-devel.x86_64 :1.0.-.el7 libmcrypt-devel.x86_64 :2.5.-.el7 libxml2-devel.x86_64 :2.9.-.el7_2.
  87.  
  88. Dependency Installed:
  89. libmcrypt.x86_64 :2.5.-.el7 xz-devel.x86_64 :5.2.-.el7
  90.  
  91. Complete!
  92. [root@node101.yinzhengjie.org.cn ~]#

[root@node101.yinzhengjie.org.cn ~]# yum -y install libxml2-devel bzip2-devel libmcrypt-devel        #注意libmcrypt-devel包依赖于epel源哟~

2>.解压php软件包

  1. [root@node101.yinzhengjie.org.cn ~]# ll
  2. total
  3. drwxr-xr-x Sep apr-1.6.
  4. -rw-r--r-- root root Oct : apr-1.6..tar.bz2
  5. drwxr-xr-x Oct apr-util-1.6.
  6. -rw-r--r-- root root Oct : apr-util-1.6..tar.bz2
  7. drwxr-sr-x root Dec : httpd-2.4.
  8. -rw-r--r-- root root Oct : httpd-2.4..tar.bz2
  9. -rw-r--r-- root root Oct : php-7.1..tar.bz2
  10. -rw-r--r-- root root Oct : wordpress-4.9.-zh_CN.tar.gz
  11. [root@node101.yinzhengjie.org.cn ~]#
  12. [root@node101.yinzhengjie.org.cn ~]# tar xf php-7.1..tar.bz2
  13. [root@node101.yinzhengjie.org.cn ~]#
  14. [root@node101.yinzhengjie.org.cn ~]# cd php-7.1.
  15. [root@node101.yinzhengjie.org.cn ~/php-7.1.]#
  16. [root@node101.yinzhengjie.org.cn ~/php-7.1.]#

3>.配置php编译时参数

  1. [root@node101.yinzhengjie.org.cn ~/php-7.1.]# ./configure --help
  2. `configure' configures this package to adapt to many kinds of systems.
  3.  
  4. Usage: ./configure [OPTION]... [VAR=VALUE]...
  5.  
  6. To assign environment variables (e.g., CC, CFLAGS...), specify them as
  7. VAR=VALUE. See below for descriptions of some of the useful variables.
  8.  
  9. Defaults for the options are specified in brackets.
  10.  
  11. Configuration:
  12. -h, --help display this help and exit
  13. --help=short display options specific to this package
  14. --help=recursive display the short help of all the included packages
  15. -V, --version display version information and exit
  16. -q, --quiet, --silent do not print `checking ...' messages
  17. --cache-file=FILE cache test results in FILE [disabled]
  18. -C, --config-cache alias for `--cache-file=config.cache'
  19. -n, --no-create do not create output files
  20. --srcdir=DIR find the sources in DIR [configure dir or `..']
  21.  
  22. Installation directories:
  23. --prefix=PREFIX install architecture-independent files in PREFIX
  24. [/usr/local]
  25. --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
  26. [PREFIX]
  27.  
  28. By default, `make install' will install all the files in
  29. `/usr/local/bin', `/usr/local/lib' etc. You can specify
  30. an installation prefix other than `/usr/local' using `--prefix',
  31. for instance `--prefix=$HOME'.
  32.  
  33. For better control, use the options below.
  34.  
  35. Fine tuning of the installation directories:
  36. --bindir=DIR user executables [EPREFIX/bin]
  37. --sbindir=DIR system admin executables [EPREFIX/sbin]
  38. --libexecdir=DIR program executables [EPREFIX/libexec]
  39. --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
  40. --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
  41. --localstatedir=DIR modifiable single-machine data [PREFIX/var]
  42. --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
  43. --libdir=DIR object code libraries [EPREFIX/lib]
  44. --includedir=DIR C header files [PREFIX/include]
  45. --oldincludedir=DIR C header files for non-gcc [/usr/include]
  46. --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
  47. --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
  48. --infodir=DIR info documentation [DATAROOTDIR/info]
  49. --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
  50. --mandir=DIR man documentation [DATAROOTDIR/man]
  51. --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE]
  52. --htmldir=DIR html documentation [DOCDIR]
  53. --dvidir=DIR dvi documentation [DOCDIR]
  54. --pdfdir=DIR pdf documentation [DOCDIR]
  55. --psdir=DIR ps documentation [DOCDIR]
  56.  
  57. System types:
  58. --build=BUILD configure for building on BUILD [guessed]
  59. --host=HOST cross-compile to build programs to run on HOST [BUILD]
  60. --target=TARGET configure for building compilers for TARGET [HOST]
  61.  
  62. Optional Features and Packages:
  63. --disable-option-checking ignore unrecognized --enable/--with options
  64. --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
  65. --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
  66. --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
  67. --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
  68. --with-libdir=NAME Look for libraries in .../NAME rather than .../lib
  69. --disable-rpath Disable passing additional runtime library
  70. search paths
  71. --enable-re2c-cgoto Enable -g flag to re2c to use computed goto gcc extension
  72. --disable-gcc-global-regs
  73. whether to enable GCC global register variables
  74.  
  75. SAPI modules:
  76.  
  77. --with-apxs2=FILE Build shared Apache 2.0 Handler module. FILE is the optional
  78. pathname to the Apache apxs tool apxs
  79. --disable-cli Disable building CLI version of PHP
  80. (this forces --without-pear)
  81. --enable-embed=TYPE EXPERIMENTAL: Enable building of embedded SAPI library
  82. TYPE is either 'shared' or 'static'. TYPE=shared
  83. --enable-fpm Enable building of the fpm SAPI executable
  84. --with-fpm-user=USER Set the user for php-fpm to run as. (default: nobody)
  85. --with-fpm-group=GRP Set the group for php-fpm to run as. For a system user, this
  86. should usually be set to match the fpm username (default: nobody)
  87. --with-fpm-systemd Activate systemd integration
  88. --with-fpm-acl Use POSIX Access Control Lists
  89. --with-litespeed Build PHP as litespeed module
  90. --enable-phpdbg Build phpdbg
  91. --enable-phpdbg-webhelper Build phpdbg web SAPI support
  92. --enable-phpdbg-debug Build phpdbg in debug mode
  93. --disable-cgi Disable building CGI version of PHP
  94.  
  95. General settings:
  96.  
  97. --enable-gcov Enable GCOV code coverage (requires LTP) - FOR DEVELOPERS ONLY!!
  98. --enable-debug Compile with debugging symbols
  99. --with-layout=TYPE Set how installed files will be laid out. Type can
  100. be either PHP or GNU [PHP]
  101. --with-config-file-path=PATH
  102. Set the path in which to look for php.ini [PREFIX/lib]
  103. --with-config-file-scan-dir=PATH
  104. Set the path where to scan for configuration files
  105. --enable-sigchild Enable PHP's own SIGCHLD handler
  106. --enable-libgcc Enable explicitly linking against libgcc
  107. --disable-short-tags Disable the short-form <? start tag by default
  108. --enable-dmalloc Enable dmalloc
  109. --disable-ipv6 Disable IPv6 support
  110. --enable-dtrace Enable DTrace support
  111. --enable-fd-setsize Set size of descriptor sets
  112.  
  113. Extensions:
  114.  
  115. --with-EXTENSION=shared[,PATH]
  116.  
  117. NOTE: Not all extensions can be build as 'shared'.
  118.  
  119. Example: --with-foobar=shared,/usr/local/foobar/
  120.  
  121. o Builds the foobar extension as shared extension.
  122. o foobar package install prefix is /usr/local/foobar/
  123.  
  124. --disable-all Disable all extensions which are enabled by default
  125.  
  126. --disable-libxml Disable LIBXML support
  127. --with-libxml-dir=DIR LIBXML: libxml2 install prefix
  128. --with-openssl=DIR Include OpenSSL support (requires OpenSSL >= 1.0.)
  129. --with-kerberos=DIR OPENSSL: Include Kerberos support
  130. --with-system-ciphers OPENSSL: Use system default cipher list instead of hardcoded value
  131. --with-pcre-regex=DIR Include Perl Compatible Regular Expressions support.
  132. DIR is the PCRE install prefix BUNDLED
  133. --with-pcre-jit Enable PCRE JIT functionality
  134. --without-sqlite3=DIR Do not include SQLite3 support. DIR is the prefix to
  135. SQLite3 installation directory.
  136. --with-zlib=DIR Include ZLIB support (requires zlib >= 1.0.)
  137. --with-zlib-dir=<DIR> Define the location of zlib install directory
  138. --enable-bcmath Enable bc style precision math functions
  139. --with-bz2=DIR Include BZip2 support
  140. --enable-calendar Enable support for calendar conversion
  141. --disable-ctype Disable ctype functions
  142. --with-curl=DIR Include cURL support
  143. --enable-dba Build DBA with bundled modules. To build shared DBA
  144. extension use --enable-dba=shared
  145. --with-qdbm=DIR DBA: QDBM support
  146. --with-gdbm=DIR DBA: GDBM support
  147. --with-ndbm=DIR DBA: NDBM support
  148. --with-db4=DIR DBA: Oracle Berkeley DB .x or .x support
  149. --with-db3=DIR DBA: Oracle Berkeley DB .x support
  150. --with-db2=DIR DBA: Oracle Berkeley DB .x support
  151. --with-db1=DIR DBA: Oracle Berkeley DB .x support/emulation
  152. --with-dbm=DIR DBA: DBM support
  153. --with-tcadb=DIR DBA: Tokyo Cabinet abstract DB support
  154. --without-cdb=DIR DBA: CDB support (bundled)
  155. --disable-inifile DBA: INI support (bundled)
  156. --disable-flatfile DBA: FlatFile support (bundled)
  157. --disable-dom Disable DOM support
  158. --with-libxml-dir=DIR DOM: libxml2 install prefix
  159. --with-enchant=DIR Include enchant support.
  160. GNU Aspell version 1.1. or higher required.
  161. --enable-exif Enable EXIF (metadata from images) support
  162. --disable-fileinfo Disable fileinfo support
  163. --disable-filter Disable input filter support
  164. --with-pcre-dir FILTER: pcre install prefix
  165. --enable-ftp Enable FTP support
  166. --with-openssl-dir=DIR FTP: openssl install prefix
  167. --with-gd=DIR Include GD support. DIR is the GD library base
  168. install directory BUNDLED
  169. --with-webp-dir=DIR GD: Set the path to libwebp install prefix
  170. --with-jpeg-dir=DIR GD: Set the path to libjpeg install prefix
  171. --with-png-dir=DIR GD: Set the path to libpng install prefix
  172. --with-zlib-dir=DIR GD: Set the path to libz install prefix
  173. --with-xpm-dir=DIR GD: Set the path to libXpm install prefix
  174. --with-freetype-dir=DIR GD: Set the path to FreeType install prefix
  175. --enable-gd-native-ttf GD: Enable TrueType string function
  176. --enable-gd-jis-conv GD: Enable JIS-mapped Japanese font support
  177. --with-gettext=DIR Include GNU gettext support
  178. --with-gmp=DIR Include GNU MP support
  179. --with-mhash=DIR Include mhash support
  180. --disable-hash Disable hash support
  181. --without-iconv=DIR Exclude iconv support
  182. --with-imap=DIR Include IMAP support. DIR is the c-client install prefix
  183. --with-kerberos=DIR IMAP: Include Kerberos support. DIR is the Kerberos install prefix
  184. --with-imap-ssl=DIR IMAP: Include SSL support. DIR is the OpenSSL install prefix
  185. --with-interbase=DIR Include Firebird support. DIR is the Firebird base
  186. install directory /opt/firebird
  187. --enable-intl Enable internationalization support
  188. --with-icu-dir=DIR Specify where ICU libraries and headers can be found
  189. --disable-json Disable JavaScript Object Serialization support
  190. --with-ldap=DIR Include LDAP support
  191. --with-ldap-sasl=DIR LDAP: Include Cyrus SASL support
  192. --enable-mbstring Enable multibyte string support
  193. --disable-mbregex MBSTRING: Disable multibyte regex support
  194. --disable-mbregex-backtrack
  195. MBSTRING: Disable multibyte regex backtrack check
  196. --with-libmbfl=DIR MBSTRING: Use external libmbfl. DIR is the libmbfl base
  197. install directory BUNDLED
  198. --with-onig=DIR MBSTRING: Use external oniguruma. DIR is the oniguruma install prefix.
  199. If DIR is not set, the bundled oniguruma will be used
  200. --with-mcrypt=DIR Include mcrypt support
  201. --with-mysqli=FILE Include MySQLi support. FILE is the path
  202. to mysql_config. If no value or mysqlnd is passed
  203. as FILE, the MySQL native driver will be used
  204. --enable-embedded-mysqli
  205. MYSQLi: Enable embedded support
  206. Note: Does not work with MySQL native driver!
  207. --with-mysql-sock=SOCKPATH
  208. MySQLi/PDO_MYSQL: Location of the MySQL unix socket pointer.
  209. If unspecified, the default locations are searched
  210. --with-oci8=DIR Include Oracle Database OCI8 support. DIR defaults to $ORACLE_HOME.
  211. Use --with-oci8=instantclient,/path/to/instant/client/lib
  212. to use an Oracle Instant Client installation
  213. --with-odbcver=HEX Force support for the passed ODBC version. A hex number is expected, default 0x0350.
  214. Use the special value of to prevent an explicit ODBCVER to be defined.
  215. --with-adabas=DIR Include Adabas D support /usr/local
  216. --with-sapdb=DIR Include SAP DB support /usr/local
  217. --with-solid=DIR Include Solid support /usr/local/solid
  218. --with-ibm-db2=DIR Include IBM DB2 support /home/db2inst1/sqllib
  219. --with-ODBCRouter=DIR Include ODBCRouter.com support /usr
  220. --with-empress=DIR Include Empress support \$EMPRESSPATH
  221. (Empress Version >= 8.60 required)
  222. --with-empress-bcs=DIR
  223. Include Empress Local Access support \$EMPRESSPATH
  224. (Empress Version >= 8.60 required)
  225. --with-birdstep=DIR Include Birdstep support /usr/local/birdstep
  226. --with-custom-odbc=DIR Include user defined ODBC support. DIR is ODBC install base
  227. directory /usr/local. Make sure to define CUSTOM_ODBC_LIBS and
  228. have some odbc.h in your include dirs. f.e. you should define
  229. following for Sybase SQL Anywhere 5.5. on QNX, prior to
  230. running this configure script:
  231. CPPFLAGS=\"-DODBC_QNX -DSQLANY_BUG\"
  232. LDFLAGS=-lunix
  233. CUSTOM_ODBC_LIBS=\"-ldblib -lodbc\"
  234. --with-iodbc=DIR Include iODBC support /usr/local
  235. --with-esoob=DIR Include Easysoft OOB support /usr/local/easysoft/oob/client
  236. --with-unixODBC=DIR Include unixODBC support /usr/local
  237. --with-dbmaker=DIR Include DBMaker support
  238. --disable-opcache Disable Zend OPcache support
  239. --disable-opcache-file Disable file based caching
  240. --disable-huge-code-pages
  241. Disable copying PHP CODE pages into HUGE PAGES
  242. --enable-pcntl Enable pcntl support (CLI/CGI only)
  243. --disable-pdo Disable PHP Data Objects support
  244. --with-pdo-dblib=DIR PDO: DBLIB-DB support. DIR is the FreeTDS home directory
  245. --with-pdo-firebird=DIR PDO: Firebird support. DIR is the Firebird base
  246. install directory /opt/firebird
  247. --with-pdo-mysql=DIR PDO: MySQL support. DIR is the MySQL base directory
  248. If no value or mysqlnd is passed as DIR, the
  249. MySQL native driver will be used
  250. --with-zlib-dir=DIR PDO_MySQL: Set the path to libz install prefix
  251. --with-pdo-oci=DIR PDO: Oracle OCI support. DIR defaults to \$ORACLE_HOME.
  252. Use --with-pdo-oci=instantclient,prefix,version
  253. for an Oracle Instant Client SDK.
  254. For example on Linux with 11.2 RPMs use:
  255. --with-pdo-oci=instantclient,/usr,11.2
  256. With 10.2 RPMs use:
  257. --with-pdo-oci=instantclient,/usr,10.2.0.4
  258. --with-pdo-odbc=flavour,dir
  259. PDO: Support for 'flavour' ODBC driver.
  260. include and lib dirs are looked for under 'dir'.
  261.  
  262. 'flavour' can be one of: ibm-db2, iODBC, unixODBC, generic
  263. If ',dir' part is omitted, default for the flavour
  264. you have selected will be used. e.g.:
  265.  
  266. --with-pdo-odbc=unixODBC
  267.  
  268. will check for unixODBC under /usr/local. You may attempt
  269. to use an otherwise unsupported driver using the \"generic\"
  270. flavour. The syntax for generic ODBC support is:
  271.  
  272. --with-pdo-odbc=generic,dir,libname,ldflags,cflags
  273.  
  274. When built as 'shared' the extension filename is always pdo_odbc.so
  275. --with-pdo-pgsql=DIR PDO: PostgreSQL support. DIR is the PostgreSQL base
  276. install directory or the path to pg_config
  277. --without-pdo-sqlite=DIR
  278. PDO: sqlite support. DIR is the sqlite base
  279. install directory BUNDLED
  280. --with-pgsql=DIR Include PostgreSQL support. DIR is the PostgreSQL
  281. base install directory or the path to pg_config
  282. --disable-phar Disable phar support
  283. --disable-posix Disable POSIX-like functions
  284. --with-pspell=DIR Include PSPELL support.
  285. GNU Aspell version 0.50. or higher required
  286. --with-libedit=DIR Include libedit readline replacement (CLI/CGI only)
  287. --with-readline=DIR Include readline support (CLI/CGI only)
  288. --with-recode=DIR Include recode support
  289. --disable-session Disable session support
  290. --with-mm=DIR SESSION: Include mm support for session storage
  291. --enable-shmop Enable shmop support
  292. --disable-simplexml Disable SimpleXML support
  293. --with-libxml-dir=DIR SimpleXML: libxml2 install prefix
  294. --with-snmp=DIR Include SNMP support
  295. --with-openssl-dir=DIR SNMP: openssl install prefix
  296. --enable-soap Enable SOAP support
  297. --with-libxml-dir=DIR SOAP: libxml2 install prefix
  298. --enable-sockets Enable sockets support
  299. --enable-sysvmsg Enable sysvmsg support
  300. --enable-sysvsem Enable System V semaphore support
  301. --enable-sysvshm Enable the System V shared memory support
  302. --with-tidy=DIR Include TIDY support
  303. --disable-tokenizer Disable tokenizer support
  304. --enable-wddx Enable WDDX support
  305. --with-libxml-dir=DIR WDDX: libxml2 install prefix
  306. --with-libexpat-dir=DIR WDDX: libexpat dir for XMLRPC-EPI (deprecated)
  307. --disable-xml Disable XML support
  308. --with-libxml-dir=DIR XML: libxml2 install prefix
  309. --with-libexpat-dir=DIR XML: libexpat install prefix (deprecated)
  310. --disable-xmlreader Disable XMLReader support
  311. --with-libxml-dir=DIR XMLReader: libxml2 install prefix
  312. --with-xmlrpc=DIR Include XMLRPC-EPI support
  313. --with-libxml-dir=DIR XMLRPC-EPI: libxml2 install prefix
  314. --with-libexpat-dir=DIR XMLRPC-EPI: libexpat dir for XMLRPC-EPI (deprecated)
  315. --with-iconv-dir=DIR XMLRPC-EPI: iconv dir for XMLRPC-EPI
  316. --disable-xmlwriter Disable XMLWriter support
  317. --with-libxml-dir=DIR XMLWriter: libxml2 install prefix
  318. --with-xsl=DIR Include XSL support. DIR is the libxslt base
  319. install directory (libxslt >= 1.1. required)
  320. --enable-zip Include Zip read/write support
  321. --with-zlib-dir=DIR ZIP: Set the path to libz install prefix
  322. --with-pcre-dir ZIP: pcre install prefix
  323. --with-libzip=DIR ZIP: use libzip
  324. --enable-mysqlnd Enable mysqlnd explicitly, will be done implicitly
  325. when required by other extensions
  326. --disable-mysqlnd-compression-support
  327. Disable support for the MySQL compressed protocol in mysqlnd
  328. --with-zlib-dir=DIR mysqlnd: Set the path to libz install prefix
  329.  
  330. PEAR:
  331.  
  332. --with-pear=DIR Install PEAR in DIR [PREFIX/lib/php]
  333. --without-pear Do not install PEAR
  334.  
  335. Zend:
  336.  
  337. --enable-maintainer-zts Enable thread safety - for code maintainers only!!
  338. --disable-inline-optimization
  339. If building zend_execute.lo fails, try this switch
  340. --disable-zend-signals whether to enable zend signal handling
  341.  
  342. TSRM:
  343.  
  344. --with-tsrm-pth=pth-config
  345. Use GNU Pth
  346. --with-tsrm-st Use SGI's State Threads
  347. --with-tsrm-pthreads Use POSIX threads (default)
  348.  
  349. Libtool:
  350.  
  351. --enable-shared=PKGS Build shared libraries default=yes
  352. --enable-static=PKGS Build static libraries default=yes
  353. --enable-fast-install=PKGS
  354. Optimize for fast installation default=yes
  355. --with-gnu-ld Assume the C compiler uses GNU ld default=no
  356. --disable-libtool-lock Avoid locking (might break parallel builds)
  357. --with-pic Try to use only PIC/non-PIC objects default=use both
  358. --with-tags=TAGS Include additional configurations automatic
  359.  
  360. Some influential environment variables:
  361. CC C compiler command
  362. CFLAGS C compiler flags
  363. LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
  364. nonstandard directory <lib dir>
  365. LIBS libraries to pass to the linker, e.g. -l<library>
  366. CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
  367. you have headers in a nonstandard directory <include dir>
  368. CPP C preprocessor
  369. YACC The `Yet Another Compiler Compiler' implementation to use.
  370. Defaults to the first program found out of: `bison -y', `byacc',
  371. `yacc'.
  372. YFLAGS The list of arguments that will be passed by default to $YACC.
  373. This script will default YFLAGS to the empty string to avoid a
  374. default value of `-d' given by some make applications.
  375. CXX C++ compiler command
  376. CXXFLAGS C++ compiler flags
  377. CXXCPP C++ preprocessor
  378.  
  379. Use these variables to override the choices made by `configure' or to help
  380. it to find libraries and programs with nonstandard names/locations.
  381.  
  382. Report bugs to the package provider.
  383. [root@node101.yinzhengjie.org.cn ~/php-7.1.]#

[root@node101.yinzhengjie.org.cn ~/php-7.1.18]# ./configure --help

  1. [root@node101.yinzhengjie.org.cn ~/php-7.1.]# ./configure --prefix=/yinzhengjie/softwares/php \
  2. > --enable-mysqlnd \                        #启用mysql数据库连接功能
  3. > --with-mysqli=mysqlnd \                     #支持mysqli的方式连接数据库
  4. > --with-openssl \   #支持加密功能
  5. > --with-pdo-mysql=mysqlnd \   #支持pdo的方式连接数据库
  6. > --enable-mbstring \                        #启用多字节字符串功能
  7. > --with-freetype-dir \                       #支持各种文件类型
  8. > --with-jpeg-dir \                       #支持jpeg格式图片
  9. > --with-png-dir \                         #支持png格式图片
  10. > --with-zlib \                           #支持zlib压缩功能
  11. > --with-libxml-dir=/usr \                    #支持xml的相关库
  12. > --enable-xml \                          #启用xml功能
  13. > --enable-sockets \                        #支持套接字
  14. > --enable-fpm \                          #启用fastcgi模式
  15. > --with-config-file-path=/etc \                 #指定配置文件存放目录未"/etc/",若不指定则会默认存放在安装目录的conf目录下哟~
  16. > --with-config-file-scan-dir=/etc/php.d \           #也可以将配置文件放在"/etc/php.d"目录   
  17. > --enable-maintainer-zts \
  18. > --disable-fileinfo
  19. ......
  20. Thank you for using PHP.
  21.  
  22. config.status: creating php7.spec
  23. config.status: creating main/build-defs.h
  24. config.status: creating scripts/phpize
  25. config.status: creating scripts/man1/phpize.
  26. config.status: creating scripts/php-config
  27. config.status: creating scripts/man1/php-config.
  28. config.status: creating sapi/cli/php.
  29. config.status: creating sapi/fpm/php-fpm.conf
  30. config.status: creating sapi/fpm/www.conf
  31. config.status: creating sapi/fpm/init.d.php-fpm
  32. config.status: creating sapi/fpm/php-fpm.service
  33. config.status: creating sapi/fpm/php-fpm.
  34. config.status: creating sapi/fpm/status.html
  35. config.status: creating sapi/cgi/php-cgi.
  36. config.status: creating ext/phar/phar.
  37. config.status: creating ext/phar/phar.phar.
  38. config.status: creating main/php_config.h
  39. config.status: executing default commands
  40. [root@node101.yinzhengjie.org.cn ~/php-7.1.]#

4>.安装并编译

  1. [root@node101.yinzhengjie.org.cn ~/php-7.1.]# lscpu
  2. Architecture: x86_64
  3. CPU op-mode(s): -bit, -bit
  4. Byte Order: Little Endian
  5. CPU(s):
  6. On-line CPU(s) list: -
  7. Thread(s) per core:
  8. Core(s) per socket:
  9. Socket(s):
  10. NUMA node(s):
  11. Vendor ID: GenuineIntel
  12. CPU family:
  13. Model:
  14. Model name: Intel(R) Core(TM) i7-8750H CPU @ .20GHz
  15. Stepping:
  16. CPU MHz: 2208.004
  17. BogoMIPS: 4416.00
  18. Hypervisor vendor: KVM
  19. Virtualization type: full
  20. L1d cache: 32K
  21. L1i cache: 32K
  22. L2 cache: 256K
  23. L3 cache: 9216K
  24. NUMA node0 CPU(s): -
  25. Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl
  26. xtopology nonstop_tsc eagerfpu pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx rdrand hypervisor lahf_lm abm 3dnowprefetch fsgsbase avx2 invpcid rdseed clflushopt flush_l1d[root@node101.yinzhengjie.org.cn ~/php-7.1.]#

[root@node101.yinzhengjie.org.cn ~/php-7.1.18]# lscpu

  1. [root@node101.yinzhengjie.org.cn ~/php-7.1.]# make -j && make install
  2. ......
  3. Installing shared extensions: /yinzhengjie/softwares/php/lib/php/extensions/no-debug-zts-/
  4. Installing PHP CLI binary: /yinzhengjie/softwares/php/bin/
  5. Installing PHP CLI man page: /yinzhengjie/softwares/php/php/man/man1/
  6. Installing PHP FPM binary: /yinzhengjie/softwares/php/sbin/
  7. Installing PHP FPM defconfig: /yinzhengjie/softwares/php/etc/
  8. Installing PHP FPM man page: /yinzhengjie/softwares/php/php/man/man8/
  9. Installing PHP FPM status page: /yinzhengjie/softwares/php/php/php/fpm/
  10. Installing phpdbg binary: /yinzhengjie/softwares/php/bin/
  11. Installing phpdbg man page: /yinzhengjie/softwares/php/php/man/man1/
  12. Installing PHP CGI binary: /yinzhengjie/softwares/php/bin/
  13. Installing PHP CGI man page: /yinzhengjie/softwares/php/php/man/man1/
  14. Installing build environment: /yinzhengjie/softwares/php/lib/php/build/
  15. Installing header files: /yinzhengjie/softwares/php/include/php/
  16. Installing helper programs: /yinzhengjie/softwares/php/bin/
  17. program: phpize
  18. program: php-config
  19. Installing man pages: /yinzhengjie/softwares/php/php/man/man1/
  20. page: phpize.
  21. page: php-config.
  22. Installing PEAR environment: /yinzhengjie/softwares/php/lib/php/
  23. [PEAR] Archive_Tar - installed: 1.4.
  24. [PEAR] Console_Getopt - installed: 1.4.
  25. [PEAR] Structures_Graph- installed: 1.1.
  26. [PEAR] XML_Util - installed: 1.4.
  27. [PEAR] PEAR - installed: 1.10.
  28. Wrote PEAR system config file at: /yinzhengjie/softwares/php/etc/pear.conf
  29. You may want to add: /yinzhengjie/softwares/php/lib/php to your php.ini include_path
  30. /root/php-7.1./build/shtool install -c ext/phar/phar.phar /yinzhengjie/softwares/php/bin
  31. ln -s -f phar.phar /yinzhengjie/softwares/php/bin/phar
  32. Installing PDO headers: /yinzhengjie/softwares/php/include/php/ext/pdo/
  33. [root@node101.yinzhengjie.org.cn ~/php-7.1.]#

[root@node101.yinzhengjie.org.cn ~/php-7.1.18]# make -j 4 && make install

5>.拷贝默认的php配置文件

  1. [root@node101.yinzhengjie.org.cn ~/php-7.1.]# cp php.ini-production /etc/php.ini

6>.配置fastcgi的启动脚本

  1. [root@node101.yinzhengjie.org.cn ~/php-7.1.]# cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
  2. [root@node101.yinzhengjie.org.cn ~/php-7.1.]#
  3. [root@node101.yinzhengjie.org.cn ~/php-7.1.]# ll /etc/init.d/php-fpm
  4. -rw-r--r-- root root Dec : /etc/init.d/php-fpm
  5. [root@node101.yinzhengjie.org.cn ~/php-7.1.]#
  6. [root@node101.yinzhengjie.org.cn ~/php-7.1.]# chmod +x /etc/init.d/php-fpm
  7. [root@node101.yinzhengjie.org.cn ~/php-7.1.]#
  8. [root@node101.yinzhengjie.org.cn ~/php-7.1.]# ll /etc/init.d/php-fpm
  9. -rwxr-xr-x root root Dec : /etc/init.d/php-fpm
  10. [root@node101.yinzhengjie.org.cn ~/php-7.1.]#
  11. [root@node101.yinzhengjie.org.cn ~/php-7.1.]# chkconfig --add php-fpm
  12. [root@node101.yinzhengjie.org.cn ~/php-7.1.]#
  13. [root@node101.yinzhengjie.org.cn ~/php-7.1.]# chkconfig --list
  14.  
  15. Note: This output shows SysV services only and does not include native
  16. systemd services. SysV configuration data might be overridden by native
  17. systemd configuration.
  18.  
  19. If you want to list systemd services use 'systemctl list-unit-files'.
  20. To see services enabled on particular target use
  21. 'systemctl list-dependencies [target]'.
  22.  
  23. netconsole :off :off :off :off :off :off :off
  24. network :off :off :on :on :on :on :off
  25. php-fpm :off :off :on :on :on :on :off
  26. [root@node101.yinzhengjie.org.cn ~/php-7.1.]#

7>.拷贝php默认的配置文件

  1. [root@node101.yinzhengjie.org.cn ~/php-7.1.]# cd /yinzhengjie/softwares/php/etc/
  2. [root@node101.yinzhengjie.org.cn /yinzhengjie/softwares/php/etc]#
  3. [root@node101.yinzhengjie.org.cn /yinzhengjie/softwares/php/etc]# cp php-fpm.conf.default php-fpm.conf
  4. [root@node101.yinzhengjie.org.cn /yinzhengjie/softwares/php/etc]#
  5. [root@node101.yinzhengjie.org.cn /yinzhengjie/softwares/php/etc]# cd php-fpm.d/
  6. [root@node101.yinzhengjie.org.cn /yinzhengjie/softwares/php/etc/php-fpm.d]#
  7. [root@node101.yinzhengjie.org.cn /yinzhengjie/softwares/php/etc/php-fpm.d]# cp www.conf.default www.conf
  8. [root@node101.yinzhengjie.org.cn /yinzhengjie/softwares/php/etc/php-fpm.d]#

8>.启动php服务

  1. [root@node101.yinzhengjie.org.cn ~]# ss -ntl
  2. State Recv-Q Send-Q Local Address:Port Peer Address:Port
  3. LISTEN *: *:*
  4. LISTEN *: *:*
  5. LISTEN ::: :::*
  6. [root@node101.yinzhengjie.org.cn ~]#
  7. [root@node101.yinzhengjie.org.cn ~]# service php-fpm start
  8. Starting php-fpm done
  9. [root@node101.yinzhengjie.org.cn ~]#
  10. [root@node101.yinzhengjie.org.cn ~]# ss -ntl
  11. State Recv-Q Send-Q Local Address:Port Peer Address:Port
  12. LISTEN 127.0.0.1: *:*
  13. LISTEN *: *:*
  14. LISTEN *: *:*
  15. LISTEN ::: :::*
  16. [root@node101.yinzhengjie.org.cn ~]#
  17. [root@node101.yinzhengjie.org.cn ~]#

六.配置httpd支持php

1>.修改httpd服务主页文件名称

  1. [root@node101.yinzhengjie.org.cn ~]# grep index.html /yinzhengjie/softwares/httpd24/conf/httpd.conf
  2. DirectoryIndex index.html
  3. [root@node101.yinzhengjie.org.cn ~]#
  4. [root@node101.yinzhengjie.org.cn ~]# vim /yinzhengjie/softwares/httpd24/conf/httpd.conf
  5. [root@node101.yinzhengjie.org.cn ~]#
  6. [root@node101.yinzhengjie.org.cn ~]# grep index.html /yinzhengjie/softwares/httpd24/conf/httpd.conf
  7. DirectoryIndex index.php index.html
  8. [root@node101.yinzhengjie.org.cn ~]#

2>.配置httpd支持的php文件类型

  1. [root@node101.yinzhengjie.org.cn ~]# tail - /yinzhengjie/softwares/httpd24/conf/httpd.conf
  2. #Add by yinzhengjie
  3. AddType application/x-httpd-php .php
  4. AddType application/x-httpd-php-source .phps
  5. [root@node101.yinzhengjie.org.cn ~]#

3>.让httpd服务启用对fastcgi支持的相关模块(默认是被注释的,即不启用)

  1. [root@node101.yinzhengjie.org.cn ~]# grep proxy_module /yinzhengjie/softwares/httpd24/conf/httpd.conf
  2. #LoadModule proxy_module modules/mod_proxy.so
  3. [root@node101.yinzhengjie.org.cn ~]#
  4. [root@node101.yinzhengjie.org.cn ~]# grep proxy_fcgi_module /yinzhengjie/softwares/httpd24/conf/httpd.conf
  5. #LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
  6. [root@node101.yinzhengjie.org.cn ~]#
  7. [root@node101.yinzhengjie.org.cn ~]# vim /yinzhengjie/softwares/httpd24/conf/httpd.conf
  8. [root@node101.yinzhengjie.org.cn ~]#
  9. [root@node101.yinzhengjie.org.cn ~]# grep proxy_module /yinzhengjie/softwares/httpd24/conf/httpd.conf
  10. LoadModule proxy_module modules/mod_proxy.so
  11. [root@node101.yinzhengjie.org.cn ~]#
  12. [root@node101.yinzhengjie.org.cn ~]# grep proxy_fcgi_module /yinzhengjie/softwares/httpd24/conf/httpd.conf
  13. LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
  14. [root@node101.yinzhengjie.org.cn ~]#

4>.解压wordpress项目到httpd服务的项目根目录中

  1. [root@node101.yinzhengjie.org.cn ~]# ll
  2. total 31800
  3. drwxr-xr-x 27 1001 1001 4096 Sep 11 2018 apr-1.6.5
  4. -rw-r--r-- 1 root root 855393 Oct 24 08:51 apr-1.6.5.tar.bz2
  5. drwxr-xr-x 20 1001 1001 4096 Oct 18 2017 apr-util-1.6.1
  6. -rw-r--r-- 1 root root 428595 Oct 24 08:51 apr-util-1.6.1.tar.bz2
  7. drwxr-sr-x 12 root 40 4096 Dec 13 15:11 httpd-2.4.37
  8. -rw-r--r-- 1 root root 7031632 Oct 24 08:51 httpd-2.4.37.tar.bz2
  9. drwxr-xr-x 18 mysql mysql 4096 Dec 13 16:30 php-7.1.18
  10. -rw-r--r-- 1 root root 15140158 Oct 24 08:51 php-7.1.18.tar.bz2
  11. -rw-r--r-- 1 root root 9082696 Oct 24 08:50 wordpress-4.9.4-zh_CN.tar.gz
  12. [root@node101.yinzhengjie.org.cn ~]#
  13. [root@node101.yinzhengjie.org.cn ~]# tar xf wordpress-4.9.4-zh_CN.tar.gz
  14. [root@node101.yinzhengjie.org.cn ~]#
  15. [root@node101.yinzhengjie.org.cn ~]# mv wordpress/* /yinzhengjie/softwares/httpd24/htdocs/
  16. [root@node101.yinzhengjie.org.cn ~]#

5>.修改配置wordpress博客程序的配置文件

  1. [root@node101.yinzhengjie.org.cn ~]# cd /yinzhengjie/softwares/httpd24/htdocs/
  2. [root@node101.yinzhengjie.org.cn /yinzhengjie/softwares/httpd24/htdocs]#
  3. [root@node101.yinzhengjie.org.cn /yinzhengjie/softwares/httpd24/htdocs]# mv wp-config-sample.php wp-config.php
  4. [root@node101.yinzhengjie.org.cn /yinzhengjie/softwares/httpd24/htdocs]#
  5. [root@node101.yinzhengjie.org.cn /yinzhengjie/softwares/httpd24/htdocs]# vim wp-config.php           #如下图所示,修改wordpress连接MySQL数据库的相关信息

6>.配置httpd服务动态页面对应的php服务器信息

  1. [root@node101.yinzhengjie.org.cn ~]# tail - /yinzhengjie/softwares/httpd24/conf/httpd.conf
  2. #Add by yinzhengjie
  3. AddType application/x-httpd-php .php
  4. AddType application/x-httpd-php-source .phps
  5. ProxyRequests Off
  6. ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:9000/yinzhengjie/softwares/httpd24/htdocs/$1
  7. [root@node101.yinzhengjie.org.cn ~]#

7>.重启httpd服务

  1. [root@node101.yinzhengjie.org.cn ~]# apachectl restart          #如下图所示,访问服务器的IP地址,进入到wordpress安装向导界面
  2. [root@node101.yinzhengjie.org.cn ~]#
  3. [root@node101.yinzhengjie.org.cn ~]# ss -ntl
  4. State Recv-Q Send-Q Local Address:Port Peer Address:Port
  5. LISTEN 127.0.0.1: *:*
  6. LISTEN *: *:*
  7. LISTEN *: *:*
  8. LISTEN ::: :::*
  9. [root@node101.yinzhengjie.org.cn ~]#
  10. [root@node101.yinzhengjie.org.cn ~]#

8>.wordpress服务安装成功后可以正常访问httpd的首页

9>.基于socket套接字连接php服务的方式对wordpress服务进行压力测试

  1. [root@node101.yinzhengjie.org.cn ~]# ab -c -n http://node101.yinzhengjie.org.cn/
  2. This is ApacheBench, Version 2.3 <$Revision: $>
  3. Copyright Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
  4. Licensed to The Apache Software Foundation, http://www.apache.org/
  5.  
  6. Benchmarking node101.yinzhengjie.org.cn (be patient)
  7. Completed requests
  8. Completed requests
  9. Finished requests
  10.  
  11. Server Software: Apache/2.4.
  12. Server Hostname: node101.yinzhengjie.org.cn
  13. Server Port:
  14.  
  15. Document Path: /
  16. Document Length: bytes
  17.  
  18. Concurrency Level:
  19. Time taken for tests: 8.381 seconds
  20. Complete requests:
  21. Failed requests:
  22. Total transferred: bytes
  23. HTML transferred: bytes
  24. Requests per second: 23.86 [#/sec] (mean)          #我们发现尽管使用最新版本的PHP7.1也没有使用xcache加速器要快,但性能上的确是有提示的。
  25. Time per request: 419.060 [ms] (mean)
  26. Time per request: 41.906 [ms] (mean, across all concurrent requests)
  27. Transfer rate: 1247.63 [Kbytes/sec] received
  28.  
  29. Connection Times (ms)
  30. min mean[+/-sd] median max
  31. Connect: 0.0
  32. Processing: 65.1
  33. Waiting: 64.5
  34. Total: 65.1
  35.  
  36. Percentage of the requests served within a certain time (ms)
  37. %
  38. %
  39. %
  40. %
  41. %
  42. %
  43. %
  44. %
  45. % (longest request)
  46. [root@node101.yinzhengjie.org.cn ~]#

七.基于本地套接字连接php服务的方式对wordpress服务进行压力测试

1>.让php服务支持本地文件套接字功能

  1. [root@node101.yinzhengjie.org.cn /yinzhengjie/softwares/php/etc/php-fpm.d]#               #默认php是监听9000端口的
  2. State Recv-Q Send-Q Local Address:Port Peer Address:Port
  3. LISTEN 127.0.0.1: *:*
  4. LISTEN *: *:*
  5. LISTEN *: *:*
  6. LISTEN ::: :::*
  7. [root@node101.yinzhengjie.org.cn /yinzhengjie/softwares/php/etc/php-fpm.d]#
  8. [root@node101.yinzhengjie.org.cn /yinzhengjie/softwares/php/etc/php-fpm.d]# egrep -v "^;|^$" www.conf
  9. [www]
  10. user = nobody
  11. group = nobody
  12. listen = 127.0.0.1:
  13. pm = dynamic
  14. pm.max_children =
  15. pm.start_servers =
  16. pm.min_spare_servers =
  17. pm.max_spare_servers =
  18. [root@node101.yinzhengjie.org.cn /yinzhengjie/softwares/php/etc/php-fpm.d]#
  19. [root@node101.yinzhengjie.org.cn /yinzhengjie/softwares/php/etc/php-fpm.d]# vim www.conf
  20. [root@node101.yinzhengjie.org.cn /yinzhengjie/softwares/php/etc/php-fpm.d]#
  21. [root@node101.yinzhengjie.org.cn /yinzhengjie/softwares/php/etc/php-fpm.d]# egrep -v "^;|^$" www.conf
  22. [www]
  23. user = nobody
  24. group = nobody
  25. listen = 127.0.0.1:
  26. listen = /tmp/php-fpm.sock          #添加该行即可,可以将上面那行注释掉,因为就算不注释改行也会覆盖掉上一行的配置哟,即会让监听端口的配置失效,之启用本地套接字监听
  27. pm = dynamic
  28. pm.max_children =
  29. pm.start_servers =
  30. pm.min_spare_servers =
  31. pm.max_spare_servers =
  32. [root@node101.yinzhengjie.org.cn /yinzhengjie/softwares/php/etc/php-fpm.d]#
  33. [root@node101.yinzhengjie.org.cn /yinzhengjie/softwares/php/etc/php-fpm.d]# service php-fpm restart        #别忘记重启服务
  34. Gracefully shutting down php-fpm . done
  35. Starting php-fpm done
  36. [root@node101.yinzhengjie.org.cn /yinzhengjie/softwares/php/etc/php-fpm.d]#
  37. [root@node101.yinzhengjie.org.cn /yinzhengjie/softwares/php/etc/php-fpm.d]# ll /tmp/php-fpm.sock           #服务启动成功后,默认会自动生成该套接字文件
  38. srw-rw---- root root Dec : /tmp/php-fpm.sock
  39. [root@node101.yinzhengjie.org.cn /yinzhengjie/softwares/php/etc/php-fpm.d]#
  40. [root@node101.yinzhengjie.org.cn /yinzhengjie/softwares/php/etc/php-fpm.d]#
  41. [root@node101.yinzhengjie.org.cn /yinzhengjie/softwares/php/etc/php-fpm.d]# ss -ntl                  #我们发现服务启动成功后,php-fpm之前默认的9000端口是没有启动的
  42. State Recv-Q Send-Q Local Address:Port Peer Address:Port
  43. LISTEN *: *:*
  44. LISTEN *: *:*
  45. LISTEN ::: :::*
  46. [root@node101.yinzhengjie.org.cn /yinzhengjie/softwares/php/etc/php-fpm.d]#

2>.修改httpd的主配置文件将基于socket套接字连接php服务的方式修改为基于本地文件套接字连接php服务的方式

  1. [root@node101.yinzhengjie.org.cn ~]# tail - /yinzhengjie/softwares/httpd24/conf/httpd.conf
  2. #Add by yinzhengjie
  3. AddType application/x-httpd-php .php
  4. AddType application/x-httpd-php-source .phps
  5. ProxyRequests Off
  6. ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:9000/yinzhengjie/softwares/httpd24/htdocs/$1
  7. [root@node101.yinzhengjie.org.cn ~]#
  8. [root@node101.yinzhengjie.org.cn ~]# vim /yinzhengjie/softwares/httpd24/conf/httpd.conf
  9. [root@node101.yinzhengjie.org.cn ~]#
  10. [root@node101.yinzhengjie.org.cn ~]# tail - /yinzhengjie/softwares/httpd24/conf/httpd.conf
  11. #Add by yinzhengjie
  12. AddType application/x-httpd-php .php
  13. AddType application/x-httpd-php-source .phps
  14. ProxyRequests Off
  15. #ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:9000/yinzhengjie/softwares/httpd24/htdocs/$1
  16. ProxyPassMatch "^/(.*\.php(/.*)?)$" "unix:/tmp/php-fpm.sock|fcgi://localhost/yinzhengjie/softwares/httpd24/htdocs/"
  17. [root@node101.yinzhengjie.org.cn ~]#
  18. [root@node101.yinzhengjie.org.cn ~]#
  19. [root@node101.yinzhengjie.org.cn ~]# apachectl restart
  20. [root@node101.yinzhengjie.org.cn ~]#
  21. [root@node101.yinzhengjie.org.cn ~]# ss -ntl
  22. State Recv-Q Send-Q Local Address:Port Peer Address:Port
  23. LISTEN *: *:*
  24. LISTEN *: *:*
  25. LISTEN ::: :::*
  26. [root@node101.yinzhengjie.org.cn ~]#
  27. [root@node101.yinzhengjie.org.cn ~]# ll /tmp/php-fpm.sock
  28. srw-rw---- root root Dec : /tmp/php-fpm.sock
  29. [root@node101.yinzhengjie.org.cn ~]#
  30. [root@node101.yinzhengjie.org.cn ~]# chmod /tmp/php-fpm.sock         #温馨提示:需要给该套接字授权777,否则可能会出现如下图所示的报错界面,但治标不治本,因为一旦服务重启还得执行该操作,正确的解决方案请继续往下看。
  31. [root@node101.yinzhengjie.org.cn ~]#
  32. [root@node101.yinzhengjie.org.cn ~]# ll /tmp/php-fpm.sock
  33. srwxrwxrwx root root Dec : /tmp/php-fpm.sock
  34. [root@node101.yinzhengjie.org.cn ~]#

  1. 上面的方式的确可以让服务临时正常访问了,但只要我们重启httpd服务后会发现依旧得重新授权才能使用,这一点很让人头疼,因此想要彻底解决这个问题,还得修改配置文件内容,具体操作如下:
  2.   vim /yinzhengjie/softwares/php/etc/php-fpm.d/www.conf
        user=apache
        group=apache
        listen=/tmp/php-fpm.sock      #或者你也可以写官网的/var/run/fpm.sock路径,但别忘记修改httpd服务对应socket文件路径即可。
        listen.mode=0666           #这一步很关键,因为它记录了监听到接字的权限哟~

3>.访问wordpress博客主页面,如下图所示,可以正常访问,至此基于套接字方式连接php-fpm服务完成(如果遇到问题看日志,日志会告诉你错误原因哟~)

4>.对wordpress服务进行压力测试

  1. [root@node101.yinzhengjie.org.cn ~]# ab -c -n http://node101.yinzhengjie.org.cn/
  2. This is ApacheBench, Version 2.3 <$Revision: $>
  3. Copyright Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
  4. Licensed to The Apache Software Foundation, http://www.apache.org/
  5.  
  6. Benchmarking node101.yinzhengjie.org.cn (be patient)
  7. Completed requests
  8. Completed requests
  9. Finished requests
  10.  
  11. Server Software: Apache/2.4.
  12. Server Hostname: node101.yinzhengjie.org.cn
  13. Server Port:
  14.  
  15. Document Path: /
  16. Document Length: bytes
  17.  
  18. Concurrency Level:
  19. Time taken for tests: 8.273 seconds
  20. Complete requests:
  21. Failed requests:
  22. Total transferred: bytes
  23. HTML transferred: bytes
  24. Requests per second: 24.17 [#/sec] (mean)                  #发现基于本地套接字的连接php-fpm程序,测试性能并没有什么提升,但如果php5不使用xcache加速的话,php7的性能提升稍微还是有一点的,但只要php5通过php-xache加速器加速后从结果来说要比直接使用php7要好。所以生产环境不建议追求新版本。
  25. Time per request: 413.655 [ms] (mean)
  26. Time per request: 41.366 [ms] (mean, across all concurrent requests)
  27. Transfer rate: 1263.93 [Kbytes/sec] received
  28.  
  29. Connection Times (ms)
  30. min mean[+/-sd] median max
  31. Connect: 0.0
  32. Processing: 63.1
  33. Waiting: 62.1
  34. Total: 63.1
  35.  
  36. Percentage of the requests served within a certain time (ms)
  37. %
  38. %
  39. %
  40. %
  41. %
  42. %
  43. %
  44. %
  45. % (longest request)
  46. [root@node101.yinzhengjie.org.cn ~]#

Httpd服务进阶知识-LAMP源码编译安装的更多相关文章

  1. Httpd服务进阶知识-LAMP架构概述

    Httpd服务进阶知识-LAMP架构概述  作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.LAMP架构概述 1>.什么是LAM(M)P架构 L: linux A: apa ...

  2. LAMP源码编译安装

    php加速器 XCache 快速而且稳定的PHP opcode缓存,经过严格测试且被大量用于生产环境. 项目地址:http://xcache.lighttpd.net/,收录EPEL源 实现XCach ...

  3. Httpd服务进阶知识-基于Apache Modele的LAMP架构之PhpMyAdmin案例

    Httpd服务进阶知识-基于Apache Modele的LAMP架构之PhpMyAdmin案例 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.常见LAMP应用 PhpMyAdm ...

  4. Httpd服务进阶知识-基于FASTCGI实现的LAMP架构

    Httpd服务进阶知识-基于FASTCGI实现的LAMP架构 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.httpd+php结合的方式 module: php fastcgi ...

  5. Httpd服务进阶知识-基于Apache Modele的LAMP架构之Discuz!案例

    Httpd服务进阶知识-基于Apache Modele的LAMP架构之Discuz!论坛案例 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.安装依赖包及数据库  博主推荐阅读: ...

  6. Httpd服务进阶知识-基于Apache Modele的LAMP架构之WordPress案例

    Httpd服务进阶知识-基于Apache Modele的LAMP架构之WordPress案例 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.安装依赖包及数据库授权 博主推荐阅读 ...

  7. bash-2 httpd服务的源码编译安装脚本

    httpd服务的源码编译安装脚本 #!/bin/bash # #******************************************************************** ...

  8. LAMP环境源码编译安装过程

    LAMP环境源码编译安装过程 一.Apache的安装 1.1.apache软件包及依赖包准备 httpd-2.4.29.tar.bz2       apr-1.6.3.tar.gz      apr- ...

  9. LAMP架构—源码编译安装 (爱情受过伤,为爱跳过鸭绿江)

    LAMP架构--源码编译安装 1.LAMP架构概述 2.编译安装Apache httpd 服务 3.编译安装mysql 服务 4.编译安装PHP 解析服务 5.利用LAMP搭建论坛 1.LAMP架构概 ...

随机推荐

  1. Visual Studio报错/plugin.vs.js,行:1074,错误:缺少标识符、字符串或数字

    C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\PrivateAssemblies/plugin. ...

  2. 用Python 绘制分布(折线)图

    用Python 绘制分布(折线)图,使用的是 plot()函数. 一个简单的例子: # encoding=utf-8 import matplotlib.pyplot as plt from pyla ...

  3. storm单机运行报错 ERROR backtype.storm.daemon.executor -

    单机本地运行storm报错: 错误如下: java.lang.NullPointerException: null at test2.Spot2.nextTuple(Spot2.java:) ~[cl ...

  4. [工具]法国神器mimikatz 2.1.1 一键版 & PowerShell版

    无需任何参数,运行EXE即可自动读取Windows系统密码 EXE版需要其它功能请使用原版 (参数已写死仅读密码) 结果保存于当前目录mz.log EXE https://github.com/k8g ...

  5. springmvc流程图以及配置

    springmvc:是完成数据的封装和跳转的功能 流程图如下: springmvc的配置流程 1.导入jar包 二.配置servlet文件 init-param的作用是在启动servlet启动时规定其 ...

  6. QT攻略——我在QT中遇到的那些坑

    (1)QUdpSocket接收数据 进入槽后,要用这种方式读取,否则可能会导致不发readyRead()信号 .while(udpSocket->bytesAvailable()){ udpSo ...

  7. SocketChannel简述

    前言 在前面的Channel概述的分类中提到过SocketChannel主要是用来基于TCP通信的通道.这篇文章详细介绍下SocketChannel SocketChannel是什么 SocketCh ...

  8. Web负载均衡学习笔记之K8S内Ngnix微服务服务超时问题

    0x00 概述 本文是从K8S内微服务的角度讨论Nginx超时的问题 0x01 问题 在K8S内部署微服务后,发现部分微服务链接超时,Connection Time Out. 最近碰到了一个 Ngin ...

  9. vs2012新建单元测试

    多写单元测试也是算向优秀程序员迈进吧((ˇˍˇ)),就像我们小时候做算算术一样,老师会交给我们怎么样检验答案是否正确性.那么我们做程序员也一样,检验自己写的代码是否和我们预期的结果一样!项目小还行,但 ...

  10. jQuery中cookie的简单操作

    jQuery 可以通过 jquery.cookie.js 插件来操作 Cookie. 用NuGet安装:PM>Install-Package js-cookie -Version 官网:http ...