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

时间:2023-12-28 10:18:14

            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默认的源

[root@node101.yinzhengjie.org.cn ~]# yum info httpd
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.tuna.tsinghua.edu.cn
* epel: mirrors.yun-idc.com
* extras: mirrors.tuna.tsinghua.edu.cn
* updates: mirrors.tuna.tsinghua.edu.cn
Installed Packages
Name : httpd
Arch : x86_64
Version : 2.4.
Release : .el7.centos
Size : 9.4 M
Repo : installed
From repo : base
Summary : Apache HTTP Server
URL : http://httpd.apache.org/
License : ASL 2.0
Description : The Apache HTTP Server is a powerful, efficient, and extensible
: web server. [root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# rpm -q httpd
httpd-2.4.-.el7.centos.x86_64
[root@node101.yinzhengjie.org.cn ~]#

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

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

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

二.编译安装httpd服务

1>.安装环境说明

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

2>.安装相关依赖包

[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# yum -y groupinstall "development tools"
Loaded plugins: fastestmirror
There is no installed groups file.
Maybe run: yum groups mark convert (see man yum)
Loading mirror speeds from cached hostfile
* base: mirror.bit.edu.cn
* extras: mirrors.huaweicloud.com
* updates: mirrors.huaweicloud.com
Resolving Dependencies
--> Running transaction check
---> Package autoconf.noarch :2.69-.el7 will be installed
---> Package automake.noarch :1.13.-.el7 will be installed
--> Processing Dependency: perl(Thread::Queue) for package: automake-1.13.-.el7.noarch
---> Package bison.x86_64 :3.0.-.el7 will be installed
---> Package byacc.x86_64 :1.9.-.el7 will be installed
---> Package cscope.x86_64 :15.8-.el7 will be installed
---> Package ctags.x86_64 :5.8-.el7 will be installed
---> Package diffstat.x86_64 :1.57-.el7 will be installed
---> Package doxygen.x86_64 :1.8.-.el7 will be installed
---> Package elfutils.x86_64 :0.176-.el7 will be installed
--> Processing Dependency: elfutils-libs(x86-) = 0.176-.el7 for package: elfutils-0.176-.el7.x86_64
--> Processing Dependency: elfutils-libelf(x86-) = 0.176-.el7 for package: elfutils-0.176-.el7.x86_64
--> Processing Dependency: libdw.so.(ELFUTILS_0.)(64bit) for package: elfutils-0.176-.el7.x86_64
--> Processing Dependency: libdw.so.(ELFUTILS_0.)(64bit) for package: elfutils-0.176-.el7.x86_64
---> Package flex.x86_64 :2.5.-.el7 will be installed
---> Package gcc.x86_64 :4.8.-.el7 will be installed
--> Processing Dependency: libgomp = 4.8.-.el7 for package: gcc-4.8.-.el7.x86_64
--> Processing Dependency: cpp = 4.8.-.el7 for package: gcc-4.8.-.el7.x86_64
--> Processing Dependency: libgcc >= 4.8.-.el7 for package: gcc-4.8.-.el7.x86_64
--> Processing Dependency: libmpfr.so.()(64bit) for package: gcc-4.8.-.el7.x86_64
--> Processing Dependency: libmpc.so.()(64bit) for package: gcc-4.8.-.el7.x86_64
---> Package gcc-c++.x86_64 :4.8.-.el7 will be installed
--> Processing Dependency: libstdc++-devel = 4.8.-.el7 for package: gcc-c++-4.8.-.el7.x86_64
--> Processing Dependency: libstdc++ = 4.8.-.el7 for package: gcc-c++-4.8.-.el7.x86_64
---> Package gcc-gfortran.x86_64 :4.8.-.el7 will be installed
--> Processing Dependency: libquadmath-devel = 4.8.-.el7 for package: gcc-gfortran-4.8.-.el7.x86_64
--> Processing Dependency: libquadmath = 4.8.-.el7 for package: gcc-gfortran-4.8.-.el7.x86_64
--> Processing Dependency: libgfortran = 4.8.-.el7 for package: gcc-gfortran-4.8.-.el7.x86_64
--> Processing Dependency: libgfortran.so.()(64bit) for package: gcc-gfortran-4.8.-.el7.x86_64
---> Package git.x86_64 :1.8.3.1-.el7 will be installed
--> Processing Dependency: perl-Git = 1.8.3.1-.el7 for package: git-1.8.3.1-.el7.x86_64
--> Processing Dependency: rsync for package: git-1.8.3.1-.el7.x86_64
--> Processing Dependency: perl(Term::ReadKey) for package: git-1.8.3.1-.el7.x86_64
--> Processing Dependency: perl(Git) for package: git-1.8.3.1-.el7.x86_64
--> Processing Dependency: perl(Error) for package: git-1.8.3.1-.el7.x86_64
---> Package indent.x86_64 :2.2.-.el7 will be installed
---> Package intltool.noarch :0.50.-.el7 will be installed
--> Processing Dependency: perl(XML::Parser) for package: intltool-0.50.-.el7.noarch
--> Processing Dependency: gettext-devel for package: intltool-0.50.-.el7.noarch
---> Package libtool.x86_64 :2.4.-.el7_3 will be installed
---> Package patchutils.x86_64 :0.3.-.el7 will be installed
---> Package rcs.x86_64 :5.9.-.el7 will be installed
---> Package redhat-rpm-config.noarch :9.1.-.el7.centos will be installed
--> Processing Dependency: dwz >= 0.4 for package: redhat-rpm-config-9.1.-.el7.centos.noarch
--> Processing Dependency: python-srpm-macros for package: redhat-rpm-config-9.1.-.el7.centos.noarch
--> Processing Dependency: perl-srpm-macros for package: redhat-rpm-config-9.1.-.el7.centos.noarch
---> Package rpm-build.x86_64 :4.11.-.el7 will be installed
--> Processing Dependency: rpm = 4.11.-.el7 for package: rpm-build-4.11.-.el7.x86_64
--> Processing Dependency: bzip2 for package: rpm-build-4.11.-.el7.x86_64
--> Processing Dependency: /usr/bin/gdb-add-index for package: rpm-build-4.11.-.el7.x86_64
---> Package rpm-sign.x86_64 :4.11.-.el7 will be installed
--> Processing Dependency: rpm-build-libs(x86-) = 4.11.-.el7 for package: rpm-sign-4.11.-.el7.x86_64
---> Package subversion.x86_64 :1.7.-.el7 will be installed
--> Processing Dependency: subversion-libs(x86-) = 1.7.-.el7 for package: subversion-1.7.-.el7.x86_64
--> Processing Dependency: libsvn_wc-.so.()(64bit) for package: subversion-1.7.-.el7.x86_64
--> Processing Dependency: libsvn_subr-.so.()(64bit) for package: subversion-1.7.-.el7.x86_64
--> Processing Dependency: libsvn_repos-.so.()(64bit) for package: subversion-1.7.-.el7.x86_64
--> Processing Dependency: libsvn_ra_svn-.so.()(64bit) for package: subversion-1.7.-.el7.x86_64
--> Processing Dependency: libsvn_ra_neon-.so.()(64bit) for package: subversion-1.7.-.el7.x86_64
--> Processing Dependency: libsvn_ra_local-.so.()(64bit) for package: subversion-1.7.-.el7.x86_64
--> Processing Dependency: libsvn_ra-.so.()(64bit) for package: subversion-1.7.-.el7.x86_64
--> Processing Dependency: libsvn_fs_util-.so.()(64bit) for package: subversion-1.7.-.el7.x86_64
--> Processing Dependency: libsvn_fs_fs-.so.()(64bit) for package: subversion-1.7.-.el7.x86_64
--> Processing Dependency: libsvn_fs_base-.so.()(64bit) for package: subversion-1.7.-.el7.x86_64
--> Processing Dependency: libsvn_fs-.so.()(64bit) for package: subversion-1.7.-.el7.x86_64
--> Processing Dependency: libsvn_diff-.so.()(64bit) for package: subversion-1.7.-.el7.x86_64
--> Processing Dependency: libsvn_delta-.so.()(64bit) for package: subversion-1.7.-.el7.x86_64
--> Processing Dependency: libsvn_client-.so.()(64bit) for package: subversion-1.7.-.el7.x86_64
--> Processing Dependency: libneon.so.()(64bit) for package: subversion-1.7.-.el7.x86_64
--> Processing Dependency: libaprutil-.so.()(64bit) for package: subversion-1.7.-.el7.x86_64
--> Processing Dependency: libapr-.so.()(64bit) for package: subversion-1.7.-.el7.x86_64
---> Package swig.x86_64 :2.0.-.el7 will be installed
---> Package systemtap.x86_64 :4.0-.el7_7 will be installed
--> Processing Dependency: systemtap-devel = 4.0-.el7_7 for package: systemtap-4.0-.el7_7.x86_64
--> Processing Dependency: systemtap-client = 4.0-.el7_7 for package: systemtap-4.0-.el7_7.x86_64
--> Running transaction check
---> Package apr.x86_64 :1.4.-.el7 will be installed
---> Package apr-util.x86_64 :1.5.-.el7 will be installed
---> Package bzip2.x86_64 :1.0.-.el7 will be installed
---> Package cpp.x86_64 :4.8.-.el7 will be installed
---> Package dwz.x86_64 :0.11-.el7 will be installed
---> Package elfutils-libelf.x86_64 :0.172-.el7 will be updated
---> Package elfutils-libelf.x86_64 :0.176-.el7 will be an update
---> Package elfutils-libs.x86_64 :0.172-.el7 will be updated
---> Package elfutils-libs.x86_64 :0.176-.el7 will be an update
---> Package gdb.x86_64 :7.6.-.el7 will be installed
---> Package gettext-devel.x86_64 :0.19.8.1-.el7 will be installed
--> Processing Dependency: gettext-common-devel = 0.19.8.1-.el7 for package: gettext-devel-0.19.8.1-.el7.x86_64
---> Package libgcc.x86_64 :4.8.-.el7 will be updated
---> Package libgcc.x86_64 :4.8.-.el7 will be an update
---> Package libgfortran.x86_64 :4.8.-.el7 will be installed
---> Package libgomp.x86_64 :4.8.-.el7 will be updated
---> Package libgomp.x86_64 :4.8.-.el7 will be an update
---> Package libmpc.x86_64 :1.0.-.el7 will be installed
---> Package libquadmath.x86_64 :4.8.-.el7 will be installed
---> Package libquadmath-devel.x86_64 :4.8.-.el7 will be installed
---> Package libstdc++.x86_64 :4.8.-.el7 will be updated
---> Package libstdc++.x86_64 :4.8.-.el7 will be an update
---> Package libstdc++-devel.x86_64 :4.8.-.el7 will be installed
---> Package mpfr.x86_64 :3.1.-.el7 will be installed
---> Package neon.x86_64 :0.30.-.el7 will be installed
--> Processing Dependency: libgnutls.so.(GNUTLS_3_0_0)(64bit) for package: neon-0.30.-.el7.x86_64
--> Processing Dependency: libgnutls.so.(GNUTLS_2_12)(64bit) for package: neon-0.30.-.el7.x86_64
--> Processing Dependency: libgnutls.so.(GNUTLS_1_4)(64bit) for package: neon-0.30.-.el7.x86_64
--> Processing Dependency: libproxy.so.()(64bit) for package: neon-0.30.-.el7.x86_64
--> Processing Dependency: libpakchois.so.()(64bit) for package: neon-0.30.-.el7.x86_64
--> Processing Dependency: libgnutls.so.()(64bit) for package: neon-0.30.-.el7.x86_64
---> Package perl-Error.noarch :0.17020-.el7 will be installed
---> Package perl-Git.noarch :1.8.3.1-.el7 will be installed
---> Package perl-TermReadKey.x86_64 :2.30-.el7 will be installed
---> Package perl-Thread-Queue.noarch :3.02-.el7 will be installed
---> Package perl-XML-Parser.x86_64 :2.41-.el7 will be installed
---> Package perl-srpm-macros.noarch :-.el7 will be installed
---> Package python-srpm-macros.noarch :-.el7 will be installed
---> Package rpm.x86_64 :4.11.-.el7 will be updated
--> Processing Dependency: rpm = 4.11.-.el7 for package: rpm-python-4.11.-.el7.x86_64
--> Processing Dependency: rpm = 4.11.-.el7 for package: rpm-libs-4.11.-.el7.x86_64
---> Package rpm.x86_64 :4.11.-.el7 will be an update
---> Package rpm-build-libs.x86_64 :4.11.-.el7 will be updated
---> Package rpm-build-libs.x86_64 :4.11.-.el7 will be an update
---> Package rsync.x86_64 :3.1.-.el7_6. will be installed
---> Package subversion-libs.x86_64 :1.7.-.el7 will be installed
---> Package systemtap-client.x86_64 :4.0-.el7_7 will be installed
--> Processing Dependency: systemtap-runtime = 4.0-.el7_7 for package: systemtap-client-4.0-.el7_7.x86_64
--> Processing Dependency: mokutil for package: systemtap-client-4.0-.el7_7.x86_64
---> Package systemtap-devel.x86_64 :4.0-.el7_7 will be installed
--> Processing Dependency: kernel-devel-uname-r for package: systemtap-devel-4.0-.el7_7.x86_64
--> Running transaction check
---> Package gettext-common-devel.noarch :0.19.8.1-.el7 will be installed
---> Package gnutls.x86_64 :3.3.-.el7_6 will be installed
--> Processing Dependency: trousers >= 0.3.11.2 for package: gnutls-3.3.-.el7_6.x86_64
--> Processing Dependency: libnettle.so.()(64bit) for package: gnutls-3.3.-.el7_6.x86_64
--> Processing Dependency: libhogweed.so.()(64bit) for package: gnutls-3.3.-.el7_6.x86_64
---> Package kernel-debug-devel.x86_64 :3.10.-1062.9..el7 will be installed
---> Package libproxy.x86_64 :0.4.-.el7 will be installed
--> Processing Dependency: libmodman.so.()(64bit) for package: libproxy-0.4.-.el7.x86_64
---> Package mokutil.x86_64 :-.el7.centos will be installed
--> Processing Dependency: libefivar.so.(libefivar.so.)(64bit) for package: mokutil--.el7.centos.x86_64
--> Processing Dependency: libefivar.so.(LIBEFIVAR_0.)(64bit) for package: mokutil--.el7.centos.x86_64
--> Processing Dependency: libefivar.so.()(64bit) for package: mokutil--.el7.centos.x86_64
---> Package pakchois.x86_64 :0.4-.el7 will be installed
---> Package rpm-libs.x86_64 :4.11.-.el7 will be updated
---> Package rpm-libs.x86_64 :4.11.-.el7 will be an update
---> Package rpm-python.x86_64 :4.11.-.el7 will be updated
---> Package rpm-python.x86_64 :4.11.-.el7 will be an update
---> Package systemtap-runtime.x86_64 :4.0-.el7_7 will be installed
--> Processing Dependency: libsymtabAPI.so.9.3()(64bit) for package: systemtap-runtime-4.0-.el7_7.x86_64
--> Processing Dependency: libdyninstAPI.so.9.3()(64bit) for package: systemtap-runtime-4.0-.el7_7.x86_64
--> Running transaction check
---> Package dyninst.x86_64 :9.3.-.el7 will be installed
--> Processing Dependency: libdwarf.so.()(64bit) for package: dyninst-9.3.-.el7.x86_64
--> Processing Dependency: libboost_thread-mt.so.1.53.()(64bit) for package: dyninst-9.3.-.el7.x86_64
--> Processing Dependency: libboost_system-mt.so.1.53.()(64bit) for package: dyninst-9.3.-.el7.x86_64
--> Processing Dependency: libboost_date_time-mt.so.1.53.()(64bit) for package: dyninst-9.3.-.el7.x86_64
---> Package efivar-libs.x86_64 :-.el7 will be installed
---> Package libmodman.x86_64 :2.0.-.el7 will be installed
---> Package nettle.x86_64 :2.7.-.el7 will be installed
---> Package trousers.x86_64 :0.3.-.el7 will be installed
--> Running transaction check
---> Package boost-date-time.x86_64 :1.53.-.el7 will be installed
---> Package boost-system.x86_64 :1.53.-.el7 will be installed
---> Package boost-thread.x86_64 :1.53.-.el7 will be installed
---> Package libdwarf.x86_64 :-.el7 will be installed
--> Finished Dependency Resolution Dependencies Resolved =============================================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================================
Installing for group install "Development Tools":
autoconf noarch 2.69-.el7 base k
automake noarch 1.13.-.el7 base k
bison x86_64 3.0.-.el7 base k
byacc x86_64 1.9.-.el7 base k
cscope x86_64 15.8-.el7 base k
ctags x86_64 5.8-.el7 base k
diffstat x86_64 1.57-.el7 base k
doxygen x86_64 :1.8.-.el7 base 3.6 M
elfutils x86_64 0.176-.el7 base k
flex x86_64 2.5.-.el7 base k
gcc x86_64 4.8.-.el7 base M
gcc-c++ x86_64 4.8.-.el7 base 7.2 M
gcc-gfortran x86_64 4.8.-.el7 base 6.7 M
git x86_64 1.8.3.1-.el7 base 4.4 M
indent x86_64 2.2.-.el7 base k
intltool noarch 0.50.-.el7 base k
libtool x86_64 2.4.-.el7_3 base k
patchutils x86_64 0.3.-.el7 base k
rcs x86_64 5.9.-.el7 base k
redhat-rpm-config noarch 9.1.-.el7.centos base k
rpm-build x86_64 4.11.-.el7 base k
rpm-sign x86_64 4.11.-.el7 base k
subversion x86_64 1.7.-.el7 base 1.0 M
swig x86_64 2.0.-.el7 base 1.3 M
systemtap x86_64 4.0-.el7_7 updates k
Installing for dependencies:
apr x86_64 1.4.-.el7 base k
apr-util x86_64 1.5.-.el7 base k
boost-date-time x86_64 1.53.-.el7 base k
boost-system x86_64 1.53.-.el7 base k
boost-thread x86_64 1.53.-.el7 base k
bzip2 x86_64 1.0.-.el7 base k
cpp x86_64 4.8.-.el7 base 5.9 M
dwz x86_64 0.11-.el7 base k
dyninst x86_64 9.3.-.el7 base 3.5 M
efivar-libs x86_64 -.el7 base k
gdb x86_64 7.6.-.el7 base 2.4 M
gettext-common-devel noarch 0.19.8.1-.el7 base k
gettext-devel x86_64 0.19.8.1-.el7 base k
gnutls x86_64 3.3.-.el7_6 base k
kernel-debug-devel x86_64 3.10.-1062.9..el7 updates M
libdwarf x86_64 -.el7 base k
libgfortran x86_64 4.8.-.el7 base k
libmodman x86_64 2.0.-.el7 base k
libmpc x86_64 1.0.-.el7 base k
libproxy x86_64 0.4.-.el7 base k
libquadmath x86_64 4.8.-.el7 base k
libquadmath-devel x86_64 4.8.-.el7 base k
libstdc++-devel x86_64 4.8.-.el7 base 1.5 M
mokutil x86_64 -.el7.centos base k
mpfr x86_64 3.1.-.el7 base k
neon x86_64 0.30.-.el7 base k
nettle x86_64 2.7.-.el7 base k
pakchois x86_64 0.4-.el7 base k
perl-Error noarch :0.17020-.el7 base k
perl-Git noarch 1.8.3.1-.el7 base k
perl-TermReadKey x86_64 2.30-.el7 base k
perl-Thread-Queue noarch 3.02-.el7 base k
perl-XML-Parser x86_64 2.41-.el7 base k
perl-srpm-macros noarch -.el7 base 4.6 k
python-srpm-macros noarch -.el7 base 8.4 k
rsync x86_64 3.1.-.el7_6. base k
subversion-libs x86_64 1.7.-.el7 base k
systemtap-client x86_64 4.0-.el7_7 updates 3.6 M
systemtap-devel x86_64 4.0-.el7_7 updates 2.2 M
systemtap-runtime x86_64 4.0-.el7_7 updates k
trousers x86_64 0.3.-.el7 base k
Updating for dependencies:
elfutils-libelf x86_64 0.176-.el7 base k
elfutils-libs x86_64 0.176-.el7 base k
libgcc x86_64 4.8.-.el7 base k
libgomp x86_64 4.8.-.el7 base k
libstdc++ x86_64 4.8.-.el7 base k
rpm x86_64 4.11.-.el7 base 1.2 M
rpm-build-libs x86_64 4.11.-.el7 base k
rpm-libs x86_64 4.11.-.el7 base k
rpm-python x86_64 4.11.-.el7 base k Transaction Summary
=============================================================================================================================================
Install Packages (+ Dependent packages)
Upgrade ( Dependent packages) Total download size: M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(/): apr-1.4.-.el7.x86_64.rpm | kB ::
(/): autoconf-2.69-.el7.noarch.rpm | kB ::
(/): apr-util-1.5.-.el7.x86_64.rpm | kB ::
(/): bison-3.0.-.el7.x86_64.rpm | kB ::
(/): boost-date-time-1.53.-.el7.x86_64.rpm | kB ::
(/): boost-system-1.53.-.el7.x86_64.rpm | kB ::
(/): boost-thread-1.53.-.el7.x86_64.rpm | kB ::
(/): byacc-1.9.-.el7.x86_64.rpm | kB ::
(/): bzip2-1.0.-.el7.x86_64.rpm | kB ::
(/): automake-1.13.-.el7.noarch.rpm | kB ::
(/): cscope-15.8-.el7.x86_64.rpm | kB ::
(/): cpp-4.8.-.el7.x86_64.rpm | 5.9 MB ::
(/): diffstat-1.57-.el7.x86_64.rpm | kB ::
(/): ctags-5.8-.el7.x86_64.rpm | kB ::
(/): dwz-0.11-.el7.x86_64.rpm | kB ::
(/): dyninst-9.3.-.el7.x86_64.rpm | 3.5 MB ::
(/): efivar-libs--.el7.x86_64.rpm | kB ::
(/): elfutils-0.176-.el7.x86_64.rpm | kB ::
(/): doxygen-1.8.-.el7.x86_64.rpm | 3.6 MB ::
(/): elfutils-libs-0.176-.el7.x86_64.rpm | kB ::
(/): elfutils-libelf-0.176-.el7.x86_64.rpm | kB ::
(/): flex-2.5.-.el7.x86_64.rpm | kB ::
(/): gcc-c++-4.8.-.el7.x86_64.rpm | 7.2 MB ::
(/): gcc-gfortran-4.8.-.el7.x86_64.rpm | 6.7 MB ::
(/): gdb-7.6.-.el7.x86_64.rpm | 2.4 MB ::
(/): gettext-common-devel-0.19.8.1-.el7.noarch.rpm | kB ::
(/): gettext-devel-0.19.8.1-.el7.x86_64.rpm | kB ::
(/): git-1.8.3.1-.el7.x86_64.rpm | 4.4 MB ::
(/): gnutls-3.3.-.el7_6.x86_64.rpm | kB ::
(/): indent-2.2.-.el7.x86_64.rpm | kB ::
(/): intltool-0.50.-.el7.noarch.rpm | kB ::
(/): libdwarf--.el7.x86_64.rpm | kB ::
(/): libgcc-4.8.-.el7.x86_64.rpm | kB ::
(/): libgfortran-4.8.-.el7.x86_64.rpm | kB ::
(/): libgomp-4.8.-.el7.x86_64.rpm | kB ::
(/): libmodman-2.0.-.el7.x86_64.rpm | kB ::
(/): libmpc-1.0.-.el7.x86_64.rpm | kB ::
(/): libproxy-0.4.-.el7.x86_64.rpm | kB ::
(/): libquadmath-4.8.-.el7.x86_64.rpm | kB ::
(/): libquadmath-devel-4.8.-.el7.x86_64.rpm | kB ::
(/): libstdc++-4.8.-.el7.x86_64.rpm | kB ::
(/): libstdc++-devel-4.8.-.el7.x86_64.rpm | 1.5 MB ::
(/): libtool-2.4.-.el7_3.x86_64.rpm | kB ::
(/): mokutil--.el7.centos.x86_64.rpm | kB ::
(/): mpfr-3.1.-.el7.x86_64.rpm | kB ::
(/): neon-0.30.-.el7.x86_64.rpm | kB ::
(/): nettle-2.7.-.el7.x86_64.rpm | kB ::
(/): pakchois-0.4-.el7.x86_64.rpm | kB ::
(/): patchutils-0.3.-.el7.x86_64.rpm | kB ::
(/): perl-Error-0.17020-.el7.noarch.rpm | kB ::
(/): perl-Git-1.8.3.1-.el7.noarch.rpm | kB ::
(/): perl-TermReadKey-2.30-.el7.x86_64.rpm | kB ::
(/): perl-Thread-Queue-3.02-.el7.noarch.rpm | kB ::
(/): perl-XML-Parser-2.41-.el7.x86_64.rpm | kB ::
(/): perl-srpm-macros--.el7.noarch.rpm | 4.6 kB ::
(/): python-srpm-macros--.el7.noarch.rpm | 8.4 kB ::
(/): rcs-5.9.-.el7.x86_64.rpm | kB ::
(/): redhat-rpm-config-9.1.-.el7.centos.noarch.rpm | kB ::
(/): rpm-4.11.-.el7.x86_64.rpm | 1.2 MB ::
(/): rpm-build-4.11.-.el7.x86_64.rpm | kB ::
(/): rpm-build-libs-4.11.-.el7.x86_64.rpm | kB ::
(/): rpm-libs-4.11.-.el7.x86_64.rpm | kB ::
(/): rpm-python-4.11.-.el7.x86_64.rpm | kB ::
(/): rpm-sign-4.11.-.el7.x86_64.rpm | kB ::
(/): rsync-3.1.-.el7_6..x86_64.rpm | kB ::
(/): subversion-1.7.-.el7.x86_64.rpm | 1.0 MB ::
(/): subversion-libs-1.7.-.el7.x86_64.rpm | kB ::
(/): systemtap-4.0-.el7_7.x86_64.rpm | kB ::
(/): systemtap-devel-4.0-.el7_7.x86_64.rpm | 2.2 MB ::
(/): systemtap-runtime-4.0-.el7_7.x86_64.rpm | kB ::
(/): systemtap-client-4.0-.el7_7.x86_64.rpm | 3.6 MB ::
(/): swig-2.0.-.el7.x86_64.rpm | 1.3 MB ::
(/): trousers-0.3.-.el7.x86_64.rpm | kB ::
(/): gcc-4.8.-.el7.x86_64.rpm | MB ::
(/): kernel-debug-devel-3.10.-1062.9..el7.x86_64.rpm | MB ::
---------------------------------------------------------------------------------------------------------------------------------------------
Total 2.7 MB/s | MB ::
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Updating : libgcc-4.8.-.el7.x86_64 /
Updating : libstdc++-4.8.-.el7.x86_64 /
Updating : elfutils-libelf-0.176-.el7.x86_64 /
Updating : rpm-4.11.-.el7.x86_64 /
Updating : rpm-libs-4.11.-.el7.x86_64 /
Installing : mpfr-3.1.-.el7.x86_64 /
Installing : libmpc-1.0.-.el7.x86_64 /
Updating : rpm-build-libs-4.11.-.el7.x86_64 /
Updating : elfutils-libs-0.176-.el7.x86_64 /
Installing : libquadmath-4.8.-.el7.x86_64 /
Installing : apr-1.4.-.el7.x86_64 /
Installing : apr-util-1.5.-.el7.x86_64 /
Installing : boost-system-1.53.-.el7.x86_64 /
Installing : autoconf-2.69-.el7.noarch /
Installing : :perl-Error-0.17020-.el7.noarch /
Installing : perl-Thread-Queue-3.02-.el7.noarch /
Installing : automake-1.13.-.el7.noarch /
Installing : boost-thread-1.53.-.el7.x86_64 /
Installing : libgfortran-4.8.-.el7.x86_64 /
Installing : elfutils-0.176-.el7.x86_64 /
Installing : cpp-4.8.-.el7.x86_64 /
Installing : dwz-0.11-.el7.x86_64 /
Installing : libdwarf--.el7.x86_64 /
Installing : libstdc++-devel-4.8.-.el7.x86_64 /
Installing : libmodman-2.0.-.el7.x86_64 /
Installing : libproxy-0.4.-.el7.x86_64 /
Installing : boost-date-time-1.53.-.el7.x86_64 /
Installing : dyninst-9.3.-.el7.x86_64 /
Installing : systemtap-runtime-4.0-.el7_7.x86_64 /
Installing : gdb-7.6.-.el7.x86_64 /
Installing : perl-srpm-macros--.el7.noarch /
Installing : pakchois-0.4-.el7.x86_64 /
Installing : efivar-libs--.el7.x86_64 /
Installing : mokutil--.el7.centos.x86_64 /
Installing : systemtap-client-4.0-.el7_7.x86_64 /
Installing : perl-TermReadKey-2.30-.el7.x86_64 /
Installing : bzip2-1.0.-.el7.x86_64 /
Installing : python-srpm-macros--.el7.noarch /
Installing : redhat-rpm-config-9.1.-.el7.centos.noarch /
Updating : libgomp-4.8.-.el7.x86_64 /
Installing : gcc-4.8.-.el7.x86_64 /
Installing : libquadmath-devel-4.8.-.el7.x86_64 /
Installing : gettext-common-devel-0.19.8.1-.el7.noarch /
Installing : nettle-2.7.-.el7.x86_64 /
Installing : perl-XML-Parser-2.41-.el7.x86_64 /
Installing : kernel-debug-devel-3.10.-1062.9..el7.x86_64 /
Installing : systemtap-devel-4.0-.el7_7.x86_64 /
Installing : trousers-0.3.-.el7.x86_64 /
Installing : gnutls-3.3.-.el7_6.x86_64 /
Installing : neon-0.30.-.el7.x86_64 /
Installing : subversion-libs-1.7.-.el7.x86_64 /
Installing : rsync-3.1.-.el7_6..x86_64 /
Installing : perl-Git-1.8.3.1-.el7.noarch /
Installing : git-1.8.3.1-.el7.x86_64 /
Installing : gettext-devel-0.19.8.1-.el7.x86_64 /
Installing : intltool-0.50.-.el7.noarch /
Installing : subversion-1.7.-.el7.x86_64 /
Installing : systemtap-4.0-.el7_7.x86_64 /
Installing : gcc-gfortran-4.8.-.el7.x86_64 /
Installing : libtool-2.4.-.el7_3.x86_64 /
Installing : gcc-c++-4.8.-.el7.x86_64 /
Installing : rpm-build-4.11.-.el7.x86_64 /
Updating : rpm-python-4.11.-.el7.x86_64 /
Installing : rpm-sign-4.11.-.el7.x86_64 /
Installing : :doxygen-1.8.-.el7.x86_64 /
Installing : swig-2.0.-.el7.x86_64 /
Installing : diffstat-1.57-.el7.x86_64 /
Installing : bison-3.0.-.el7.x86_64 /
Installing : cscope-15.8-.el7.x86_64 /
Installing : patchutils-0.3.-.el7.x86_64 /
Installing : flex-2.5.-.el7.x86_64 /
Installing : indent-2.2.-.el7.x86_64 /
Installing : rcs-5.9.-.el7.x86_64 /
Installing : byacc-1.9.-.el7.x86_64 /
Installing : ctags-5.8-.el7.x86_64 /
Cleanup : rpm-python-4.11.-.el7.x86_64 /
Cleanup : rpm-build-libs-4.11.-.el7.x86_64 /
Cleanup : rpm-4.11.-.el7.x86_64 /
Cleanup : rpm-libs-4.11.-.el7.x86_64 /
Cleanup : elfutils-libs-0.172-.el7.x86_64 /
Cleanup : libstdc++-4.8.-.el7.x86_64 /
Cleanup : libgcc-4.8.-.el7.x86_64 /
Cleanup : elfutils-libelf-0.172-.el7.x86_64 /
Cleanup : libgomp-4.8.-.el7.x86_64 /
Verifying : rsync-3.1.-.el7_6..x86_64 /
Verifying : trousers-0.3.-.el7.x86_64 /
Verifying : ctags-5.8-.el7.x86_64 /
Verifying : subversion-libs-1.7.-.el7.x86_64 /
Verifying : kernel-debug-devel-3.10.-1062.9..el7.x86_64 /
Verifying : perl-XML-Parser-2.41-.el7.x86_64 /
Verifying : gettext-devel-0.19.8.1-.el7.x86_64 /
Verifying : mpfr-3.1.-.el7.x86_64 /
Verifying : byacc-1.9.-.el7.x86_64 /
Verifying : libgfortran-4.8.-.el7.x86_64 /
Verifying : nettle-2.7.-.el7.x86_64 /
Verifying : boost-system-1.53.-.el7.x86_64 /
Verifying : automake-1.13.-.el7.noarch /
Verifying : gcc-4.8.-.el7.x86_64 /
Verifying : libstdc++-devel-4.8.-.el7.x86_64 /
Verifying : libstdc++-4.8.-.el7.x86_64 /
Verifying : :doxygen-1.8.-.el7.x86_64 /
Verifying : dyninst-9.3.-.el7.x86_64 /
Verifying : rpm-build-libs-4.11.-.el7.x86_64 /
Verifying : rpm-python-4.11.-.el7.x86_64 /
Verifying : subversion-1.7.-.el7.x86_64 /
Verifying : systemtap-4.0-.el7_7.x86_64 /
Verifying : boost-thread-1.53.-.el7.x86_64 /
Verifying : perl-Thread-Queue-3.02-.el7.noarch /
Verifying : gettext-common-devel-0.19.8.1-.el7.noarch /
Verifying : perl-Git-1.8.3.1-.el7.noarch /
Verifying : libgcc-4.8.-.el7.x86_64 /
Verifying : libgomp-4.8.-.el7.x86_64 /
Verifying : intltool-0.50.-.el7.noarch /
Verifying : gnutls-3.3.-.el7_6.x86_64 /
Verifying : rcs-5.9.-.el7.x86_64 /
Verifying : swig-2.0.-.el7.x86_64 /
Verifying : python-srpm-macros--.el7.noarch /
Verifying : libtool-2.4.-.el7_3.x86_64 /
Verifying : libmodman-2.0.-.el7.x86_64 /
Verifying : gcc-c++-4.8.-.el7.x86_64 /
Verifying : apr-1.4.-.el7.x86_64 /
Verifying : libproxy-0.4.-.el7.x86_64 /
Verifying : rpm-build-4.11.-.el7.x86_64 /
Verifying : :perl-Error-0.17020-.el7.noarch /
Verifying : indent-2.2.-.el7.x86_64 /
Verifying : git-1.8.3.1-.el7.x86_64 /
Verifying : bzip2-1.0.-.el7.x86_64 /
Verifying : gcc-gfortran-4.8.-.el7.x86_64 /
Verifying : apr-util-1.5.-.el7.x86_64 /
Verifying : flex-2.5.-.el7.x86_64 /
Verifying : rpm-libs-4.11.-.el7.x86_64 /
Verifying : libmpc-1.0.-.el7.x86_64 /
Verifying : libquadmath-devel-4.8.-.el7.x86_64 /
Verifying : systemtap-runtime-4.0-.el7_7.x86_64 /
Verifying : systemtap-client-4.0-.el7_7.x86_64 /
Verifying : patchutils-0.3.-.el7.x86_64 /
Verifying : systemtap-devel-4.0-.el7_7.x86_64 /
Verifying : cscope-15.8-.el7.x86_64 /
Verifying : bison-3.0.-.el7.x86_64 /
Verifying : mokutil--.el7.centos.x86_64 /
Verifying : autoconf-2.69-.el7.noarch /
Verifying : elfutils-0.176-.el7.x86_64 /
Verifying : perl-TermReadKey-2.30-.el7.x86_64 /
Verifying : rpm-4.11.-.el7.x86_64 /
Verifying : elfutils-libs-0.176-.el7.x86_64 /
Verifying : libquadmath-4.8.-.el7.x86_64 /
Verifying : cpp-4.8.-.el7.x86_64 /
Verifying : boost-date-time-1.53.-.el7.x86_64 /
Verifying : gdb-7.6.-.el7.x86_64 /
Verifying : dwz-0.11-.el7.x86_64 /
Verifying : efivar-libs--.el7.x86_64 /
Verifying : diffstat-1.57-.el7.x86_64 /
Verifying : elfutils-libelf-0.176-.el7.x86_64 /
Verifying : pakchois-0.4-.el7.x86_64 /
Verifying : neon-0.30.-.el7.x86_64 /
Verifying : rpm-sign-4.11.-.el7.x86_64 /
Verifying : perl-srpm-macros--.el7.noarch /
Verifying : libdwarf--.el7.x86_64 /
Verifying : redhat-rpm-config-9.1.-.el7.centos.noarch /
Verifying : rpm-python-4.11.-.el7.x86_64 /
Verifying : libgcc-4.8.-.el7.x86_64 /
Verifying : elfutils-libelf-0.172-.el7.x86_64 /
Verifying : rpm-libs-4.11.-.el7.x86_64 /
Verifying : libstdc++-4.8.-.el7.x86_64 /
Verifying : rpm-4.11.-.el7.x86_64 /
Verifying : rpm-build-libs-4.11.-.el7.x86_64 /
Verifying : libgomp-4.8.-.el7.x86_64 /
Verifying : elfutils-libs-0.172-.el7.x86_64 / Installed:
autoconf.noarch :2.69-.el7 automake.noarch :1.13.-.el7 bison.x86_64 :3.0.-.el7
byacc.x86_64 :1.9.-.el7 cscope.x86_64 :15.8-.el7 ctags.x86_64 :5.8-.el7
diffstat.x86_64 :1.57-.el7 doxygen.x86_64 :1.8.-.el7 elfutils.x86_64 :0.176-.el7
flex.x86_64 :2.5.-.el7 gcc.x86_64 :4.8.-.el7 gcc-c++.x86_64 :4.8.-.el7
gcc-gfortran.x86_64 :4.8.-.el7 git.x86_64 :1.8.3.1-.el7 indent.x86_64 :2.2.-.el7
intltool.noarch :0.50.-.el7 libtool.x86_64 :2.4.-.el7_3 patchutils.x86_64 :0.3.-.el7
rcs.x86_64 :5.9.-.el7 redhat-rpm-config.noarch :9.1.-.el7.centos rpm-build.x86_64 :4.11.-.el7
rpm-sign.x86_64 :4.11.-.el7 subversion.x86_64 :1.7.-.el7 swig.x86_64 :2.0.-.el7
systemtap.x86_64 :4.0-.el7_7 Dependency Installed:
apr.x86_64 :1.4.-.el7 apr-util.x86_64 :1.5.-.el7 boost-date-time.x86_64 :1.53.-.el7
boost-system.x86_64 :1.53.-.el7 boost-thread.x86_64 :1.53.-.el7 bzip2.x86_64 :1.0.-.el7
cpp.x86_64 :4.8.-.el7 dwz.x86_64 :0.11-.el7 dyninst.x86_64 :9.3.-.el7
efivar-libs.x86_64 :-.el7 gdb.x86_64 :7.6.-.el7 gettext-common-devel.noarch :0.19.8.1-.el7
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
libdwarf.x86_64 :-.el7 libgfortran.x86_64 :4.8.-.el7 libmodman.x86_64 :2.0.-.el7
libmpc.x86_64 :1.0.-.el7 libproxy.x86_64 :0.4.-.el7 libquadmath.x86_64 :4.8.-.el7
libquadmath-devel.x86_64 :4.8.-.el7 libstdc++-devel.x86_64 :4.8.-.el7 mokutil.x86_64 :-.el7.centos
mpfr.x86_64 :3.1.-.el7 neon.x86_64 :0.30.-.el7 nettle.x86_64 :2.7.-.el7
pakchois.x86_64 :0.4-.el7 perl-Error.noarch :0.17020-.el7 perl-Git.noarch :1.8.3.1-.el7
perl-TermReadKey.x86_64 :2.30-.el7 perl-Thread-Queue.noarch :3.02-.el7 perl-XML-Parser.x86_64 :2.41-.el7
perl-srpm-macros.noarch :-.el7 python-srpm-macros.noarch :-.el7 rsync.x86_64 :3.1.-.el7_6.
subversion-libs.x86_64 :1.7.-.el7 systemtap-client.x86_64 :4.0-.el7_7 systemtap-devel.x86_64 :4.0-.el7_7
systemtap-runtime.x86_64 :4.0-.el7_7 trousers.x86_64 :0.3.-.el7 Dependency Updated:
elfutils-libelf.x86_64 :0.176-.el7 elfutils-libs.x86_64 :0.176-.el7 libgcc.x86_64 :4.8.-.el7
libgomp.x86_64 :4.8.-.el7 libstdc++.x86_64 :4.8.-.el7 rpm.x86_64 :4.11.-.el7
rpm-build-libs.x86_64 :4.11.-.el7 rpm-libs.x86_64 :4.11.-.el7 rpm-python.x86_64 :4.11.-.el7 Complete!
[root@node101.yinzhengjie.org.cn ~]#

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

[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# yum -y install pcre-devel openssl-devel expat-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.bit.edu.cn
* extras: mirrors.huaweicloud.com
* updates: mirrors.huaweicloud.com
Resolving Dependencies
--> Running transaction check
---> Package expat-devel.x86_64 :2.1.-.el7_3 will be installed
---> Package openssl-devel.x86_64 :1.0.2k-.el7 will be installed
--> Processing Dependency: openssl-libs(x86-) = :1.0.2k-.el7 for package: :openssl-devel-1.0.2k-.el7.x86_64
--> Processing Dependency: zlib-devel(x86-) for package: :openssl-devel-1.0.2k-.el7.x86_64
--> Processing Dependency: krb5-devel(x86-) for package: :openssl-devel-1.0.2k-.el7.x86_64
---> Package pcre-devel.x86_64 :8.32-.el7 will be installed
--> Running transaction check
---> Package krb5-devel.x86_64 :1.15.-.el7_7. will be installed
--> Processing Dependency: libkadm5(x86-) = 1.15.-.el7_7. for package: krb5-devel-1.15.-.el7_7..x86_64
--> Processing Dependency: krb5-libs(x86-) = 1.15.-.el7_7. for package: krb5-devel-1.15.-.el7_7..x86_64
--> Processing Dependency: libverto-devel for package: krb5-devel-1.15.-.el7_7..x86_64
--> Processing Dependency: libselinux-devel for package: krb5-devel-1.15.-.el7_7..x86_64
--> Processing Dependency: libcom_err-devel for package: krb5-devel-1.15.-.el7_7..x86_64
--> Processing Dependency: keyutils-libs-devel for package: krb5-devel-1.15.-.el7_7..x86_64
---> Package openssl-libs.x86_64 :1.0.2k-.el7 will be updated
--> Processing Dependency: openssl-libs(x86-) = :1.0.2k-.el7 for package: :openssl-1.0.2k-.el7.x86_64
---> Package openssl-libs.x86_64 :1.0.2k-.el7 will be an update
---> Package zlib-devel.x86_64 :1.2.-.el7 will be installed
--> Running transaction check
---> Package keyutils-libs-devel.x86_64 :1.5.-.el7 will be installed
---> Package krb5-libs.x86_64 :1.15.-.el7 will be updated
---> Package krb5-libs.x86_64 :1.15.-.el7_7. will be an update
---> Package libcom_err-devel.x86_64 :1.42.-.el7 will be installed
--> Processing Dependency: libcom_err(x86-) = 1.42.-.el7 for package: libcom_err-devel-1.42.-.el7.x86_64
---> Package libkadm5.x86_64 :1.15.-.el7_7. will be installed
---> Package libselinux-devel.x86_64 :2.5-14.1.el7 will be installed
--> Processing Dependency: libsepol-devel(x86-) >= 2.5- for package: libselinux-devel-2.5-14.1.el7.x86_64
--> Processing Dependency: pkgconfig(libsepol) for package: libselinux-devel-2.5-14.1.el7.x86_64
---> Package libverto-devel.x86_64 :0.2.-.el7 will be installed
---> Package openssl.x86_64 :1.0.2k-.el7 will be updated
---> Package openssl.x86_64 :1.0.2k-.el7 will be an update
--> Running transaction check
---> Package libcom_err.x86_64 :1.42.-.el7 will be updated
--> Processing Dependency: libcom_err(x86-) = 1.42.-.el7 for package: e2fsprogs-1.42.-.el7.x86_64
--> Processing Dependency: libcom_err(x86-) = 1.42.-.el7 for package: e2fsprogs-libs-1.42.-.el7.x86_64
--> Processing Dependency: libcom_err(x86-) = 1.42.-.el7 for package: libss-1.42.-.el7.x86_64
---> Package libcom_err.x86_64 :1.42.-.el7 will be an update
---> Package libsepol-devel.x86_64 :2.5-.el7 will be installed
--> Running transaction check
---> Package e2fsprogs.x86_64 :1.42.-.el7 will be updated
---> Package e2fsprogs.x86_64 :1.42.-.el7 will be an update
---> Package e2fsprogs-libs.x86_64 :1.42.-.el7 will be updated
---> Package e2fsprogs-libs.x86_64 :1.42.-.el7 will be an update
---> Package libss.x86_64 :1.42.-.el7 will be updated
---> Package libss.x86_64 :1.42.-.el7 will be an update
--> Finished Dependency Resolution Dependencies Resolved =============================================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================================
Installing:
expat-devel x86_64 2.1.-.el7_3 base k
openssl-devel x86_64 :1.0.2k-.el7 base 1.5 M
pcre-devel x86_64 8.32-.el7 base k
Installing for dependencies:
keyutils-libs-devel x86_64 1.5.-.el7 base k
krb5-devel x86_64 1.15.-.el7_7. updates k
libcom_err-devel x86_64 1.42.-.el7 base k
libkadm5 x86_64 1.15.-.el7_7. updates k
libselinux-devel x86_64 2.5-14.1.el7 base k
libsepol-devel x86_64 2.5-.el7 base k
libverto-devel x86_64 0.2.-.el7 base k
zlib-devel x86_64 1.2.-.el7 base k
Updating for dependencies:
e2fsprogs x86_64 1.42.-.el7 base k
e2fsprogs-libs x86_64 1.42.-.el7 base k
krb5-libs x86_64 1.15.-.el7_7. updates k
libcom_err x86_64 1.42.-.el7 base k
libss x86_64 1.42.-.el7 base k
openssl x86_64 :1.0.2k-.el7 base k
openssl-libs x86_64 :1.0.2k-.el7 base 1.2 M Transaction Summary
=============================================================================================================================================
Install Packages (+ Dependent packages)
Upgrade ( Dependent packages) Total download size: 6.3 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(/): e2fsprogs-libs-1.42.-.el7.x86_64.rpm | kB ::
(/): expat-devel-2.1.-.el7_3.x86_64.rpm | kB ::
(/): keyutils-libs-devel-1.5.-.el7.x86_64.rpm | kB ::
(/): libcom_err-1.42.-.el7.x86_64.rpm | kB ::
(/): e2fsprogs-1.42.-.el7.x86_64.rpm | kB ::
(/): libselinux-devel-2.5-14.1.el7.x86_64.rpm | kB ::
(/): libsepol-devel-2.5-.el7.x86_64.rpm | kB ::
(/): krb5-libs-1.15.-.el7_7..x86_64.rpm | kB ::
(/): libcom_err-devel-1.42.-.el7.x86_64.rpm | kB ::
(/): libss-1.42.-.el7.x86_64.rpm | kB ::
(/): openssl-1.0.2k-.el7.x86_64.rpm | kB ::
(/): krb5-devel-1.15.-.el7_7..x86_64.rpm | kB ::
(/): libkadm5-1.15.-.el7_7..x86_64.rpm | kB ::
(/): openssl-devel-1.0.2k-.el7.x86_64.rpm | 1.5 MB ::
(/): openssl-libs-1.0.2k-.el7.x86_64.rpm | 1.2 MB ::
(/): libverto-devel-0.2.-.el7.x86_64.rpm | kB ::
(/): zlib-devel-1.2.-.el7.x86_64.rpm | kB ::
(/): pcre-devel-8.32-.el7.x86_64.rpm | kB ::
---------------------------------------------------------------------------------------------------------------------------------------------
Total 2.6 MB/s | 6.3 MB ::
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Updating : libcom_err-1.42.-.el7.x86_64 /
Updating : krb5-libs-1.15.-.el7_7..x86_64 /
Updating : :openssl-libs-1.0.2k-.el7.x86_64 /
Installing : libkadm5-1.15.-.el7_7..x86_64 /
Installing : libcom_err-devel-1.42.-.el7.x86_64 /
Updating : libss-1.42.-.el7.x86_64 /
Updating : e2fsprogs-libs-1.42.-.el7.x86_64 /
Installing : libsepol-devel-2.5-.el7.x86_64 /
Installing : zlib-devel-1.2.-.el7.x86_64 /
Installing : libverto-devel-0.2.-.el7.x86_64 /
Installing : pcre-devel-8.32-.el7.x86_64 /
Installing : libselinux-devel-2.5-14.1.el7.x86_64 /
Installing : keyutils-libs-devel-1.5.-.el7.x86_64 /
Installing : krb5-devel-1.15.-.el7_7..x86_64 /
Installing : :openssl-devel-1.0.2k-.el7.x86_64 /
Updating : e2fsprogs-1.42.-.el7.x86_64 /
Updating : :openssl-1.0.2k-.el7.x86_64 /
Installing : expat-devel-2.1.-.el7_3.x86_64 /
Cleanup : :openssl-1.0.2k-.el7.x86_64 /
Cleanup : e2fsprogs-1.42.-.el7.x86_64 /
Cleanup : krb5-libs-1.15.-.el7.x86_64 /
Cleanup : :openssl-libs-1.0.2k-.el7.x86_64 /
Cleanup : e2fsprogs-libs-1.42.-.el7.x86_64 /
Cleanup : libss-1.42.-.el7.x86_64 /
Cleanup : libcom_err-1.42.-.el7.x86_64 /
Verifying : keyutils-libs-devel-1.5.-.el7.x86_64 /
Verifying : krb5-devel-1.15.-.el7_7..x86_64 /
Verifying : libcom_err-devel-1.42.-.el7.x86_64 /
Verifying : :openssl-libs-1.0.2k-.el7.x86_64 /
Verifying : pcre-devel-8.32-.el7.x86_64 /
Verifying : expat-devel-2.1.-.el7_3.x86_64 /
Verifying : libverto-devel-0.2.-.el7.x86_64 /
Verifying : zlib-devel-1.2.-.el7.x86_64 /
Verifying : e2fsprogs-1.42.-.el7.x86_64 /
Verifying : krb5-libs-1.15.-.el7_7..x86_64 /
Verifying : libss-1.42.-.el7.x86_64 /
Verifying : :openssl-1.0.2k-.el7.x86_64 /
Verifying : :openssl-devel-1.0.2k-.el7.x86_64 /
Verifying : libcom_err-1.42.-.el7.x86_64 /
Verifying : libsepol-devel-2.5-.el7.x86_64 /
Verifying : e2fsprogs-libs-1.42.-.el7.x86_64 /
Verifying : libkadm5-1.15.-.el7_7..x86_64 /
Verifying : libselinux-devel-2.5-14.1.el7.x86_64 /
Verifying : :openssl-libs-1.0.2k-.el7.x86_64 /
Verifying : e2fsprogs-1.42.-.el7.x86_64 /
Verifying : :openssl-1.0.2k-.el7.x86_64 /
Verifying : libss-1.42.-.el7.x86_64 /
Verifying : e2fsprogs-libs-1.42.-.el7.x86_64 /
Verifying : krb5-libs-1.15.-.el7.x86_64 /
Verifying : libcom_err-1.42.-.el7.x86_64 / Installed:
expat-devel.x86_64 :2.1.-.el7_3 openssl-devel.x86_64 :1.0.2k-.el7 pcre-devel.x86_64 :8.32-.el7 Dependency Installed:
keyutils-libs-devel.x86_64 :1.5.-.el7 krb5-devel.x86_64 :1.15.-.el7_7. libcom_err-devel.x86_64 :1.42.-.el7
libkadm5.x86_64 :1.15.-.el7_7. libselinux-devel.x86_64 :2.5-14.1.el7 libsepol-devel.x86_64 :2.5-.el7
libverto-devel.x86_64 :0.2.-.el7 zlib-devel.x86_64 :1.2.-.el7 Dependency Updated:
e2fsprogs.x86_64 :1.42.-.el7 e2fsprogs-libs.x86_64 :1.42.-.el7 krb5-libs.x86_64 :1.15.-.el7_7.
libcom_err.x86_64 :1.42.-.el7 libss.x86_64 :1.42.-.el7 openssl.x86_64 :1.0.2k-.el7
openssl-libs.x86_64 :1.0.2k-.el7 Complete!
[root@node101.yinzhengjie.org.cn ~]#

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

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

[root@node101.yinzhengjie.org.cn ~]# ll
total
-rw-r--r-- root root Oct : apr-1.6..tar.bz2
-rw-r--r-- root root Oct : apr-util-1.6..tar.bz2
-rw-r--r-- root root Oct : httpd-2.4..tar.bz2
-rw-r--r-- root root Oct : php-7.1..tar.bz2
-rw-r--r-- root root Oct : wordpress-4.9.-zh_CN.tar.gz
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# tar xf apr-1.6..tar.bz2
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# tar xf apr-util-1.6..tar.bz2
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# tar xf httpd-2.4..tar.bz2
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# ll
total
drwxr-xr-x Sep apr-1.6.
-rw-r--r-- root root Oct : apr-1.6..tar.bz2
drwxr-xr-x Oct apr-util-1.6.
-rw-r--r-- root root Oct : apr-util-1.6..tar.bz2
drwxr-sr-x root Oct httpd-2.4.
-rw-r--r-- root root Oct : httpd-2.4..tar.bz2
-rw-r--r-- root root Oct : php-7.1..tar.bz2
-rw-r--r-- root root Oct : wordpress-4.9.-zh_CN.tar.gz
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# cp -r apr-1.6. httpd-2.4./srclib/apr
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# cp -r apr-util-1.6. httpd-2.4./srclib/apr-util
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# cd httpd-2.4.
[root@node101.yinzhengjie.org.cn ~/httpd-2.4.]#
[root@node101.yinzhengjie.org.cn ~/httpd-2.4.]# ls
ABOUT_APACHE apache_probes.d BuildBin.dsp config.layout emacs-style httpd.spec LAYOUT LICENSE NOTICE README.cmake srclib
acinclude.m4 ap.d buildconf configure httpd.dep include libhttpd.dep Makefile.in NWGNUmakefile README.platforms support
Apache-apr2.dsw build CHANGES configure.in httpd.dsp INSTALL libhttpd.dsp Makefile.win os ROADMAP test
Apache.dsw BuildAll.dsp CMakeLists.txt docs httpd.mak InstallBin.dsp libhttpd.mak modules README server VERSIONING
[root@node101.yinzhengjie.org.cn ~/httpd-2.4.]#
[root@node101.yinzhengjie.org.cn ~/httpd-2.4.]#

4>.编译安装httpd服务

[root@node101.yinzhengjie.org.cn ~]# ll
total
drwxr-xr-x Sep apr-1.6.
-rw-r--r-- root root Oct : apr-1.6..tar.bz2
drwxr-xr-x Oct apr-util-1.6.
-rw-r--r-- root root Oct : apr-util-1.6..tar.bz2
drwxr-sr-x root Oct httpd-2.4.
-rw-r--r-- root root Oct : httpd-2.4..tar.bz2
-rw-r--r-- root root Oct : php-7.1..tar.bz2
-rw-r--r-- root root Oct : wordpress-4.9.-zh_CN.tar.gz
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# cd httpd-2.4.
[root@node101.yinzhengjie.org.cn ~/httpd-2.4.]#
[root@node101.yinzhengjie.org.cn ~/httpd-2.4.]# ./configure \
> --prefix=/yinzhengjie/softwares/httpd24 \        #配置指定的安装路径,以后要是不用了直接删除即可,方便咱们管理。
> --enable-so \                         #启用动态库,即配置支持基于DSO方式动态加载模块。
> --enable-ssl \                        #启用加密,即配置支持https协议。
> --enable-cgi \                        #启用CGI,即配置支持CGI机制。
> --enable-rewrite \                      #启用重定向功能,即配置支持URL重写机制。
> --with-zlib \                         #启用压缩功能,即配置zlib(它是网络上发送数据报文通用压缩库的API)库,你可以理解是支持压缩功能。
> --with-pcre \                         #启用正则表达式,即配置支持prel(支持正则)
> --with-included-apr \                    #表示在httpd的安装包里面继承了apr软件,说白了就是我们上一步骤的mv操作。
> --enable-modules=most \                   #配置大多数常用的模块
> --enable-mpms-shared=all \                 #配置所有的mpm模块都编译进来
> --with-mpm=prefork                      #配置指定使用prefork模式,当然你也可以选择worker模式或者event模式均可,由于event是该版本的新特性,因此我们就用新的来测试一下吧。
......
config.status: executing default commands
configure: summary of build options: Server Version: 2.4.
Install prefix: /yinzhengjie/softwares/httpd24
C compiler: gcc -std=gnu99
CFLAGS: -g -O2 -pthread
CPPFLAGS: -DLINUX -D_REENTRANT -D_GNU_SOURCE
LDFLAGS:
LIBS:
C preprocessor: gcc -E [root@node101.yinzhengjie.org.cn ~/httpd-2.4.]#
[root@node101.yinzhengjie.org.cn ~/httpd-2.4.]# lscpu
Architecture: x86_64
CPU op-mode(s): -bit, -bit
Byte Order: Little Endian
CPU(s):
On-line CPU(s) list: -
Thread(s) per core:
Core(s) per socket:
Socket(s):
NUMA node(s):
Vendor ID: GenuineIntel
CPU family:
Model:
Model name: Intel(R) Core(TM) i7-8750H CPU @ .20GHz
Stepping:
CPU MHz: 2208.004
BogoMIPS: 4416.00
Hypervisor vendor: KVM
Virtualization type: full
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 9216K
NUMA node0 CPU(s): -
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
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.]#
[root@node101.yinzhengjie.org.cn ~/httpd-2.4.]# make -j && make install  #同时启用4个CPU来编译源代码,这个数字根据你的服务器cpu核心数而定,可以通过上面lscpu的命令查看你的CPU核心数
......
Installing configuration files
mkdir /yinzhengjie/softwares/httpd24/conf
mkdir /yinzhengjie/softwares/httpd24/conf/extra
mkdir /yinzhengjie/softwares/httpd24/conf/original
mkdir /yinzhengjie/softwares/httpd24/conf/original/extra
Installing HTML documents
mkdir /yinzhengjie/softwares/httpd24/htdocs
Installing error documents
mkdir /yinzhengjie/softwares/httpd24/error
Installing icons
mkdir /yinzhengjie/softwares/httpd24/icons
mkdir /yinzhengjie/softwares/httpd24/logs
Installing CGIs
mkdir /yinzhengjie/softwares/httpd24/cgi-bin
Installing header files
Installing build system files
Installing man pages and online manual
mkdir /yinzhengjie/softwares/httpd24/man
mkdir /yinzhengjie/softwares/httpd24/man/man1
mkdir /yinzhengjie/softwares/httpd24/man/man8
mkdir /yinzhengjie/softwares/httpd24/manual
make[]: Leaving directory `/root/httpd-2.4.'
[root@node101.yinzhengjie.org.cn ~/httpd-2.4.]#
[root@node101.yinzhengjie.org.cn ~/httpd-2.4.]# cd
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# ll /yinzhengjie/softwares/httpd24
total
drwxr-xr-x root root Dec : bin
drwxr-xr-x root root Dec : build
drwxr-xr-x root root Dec : cgi-bin
drwxr-xr-x root root Dec : conf
drwxr-xr-x root root Dec : error
drwxr-sr-x root root Oct htdocs
drwxr-xr-x root root Dec : icons
drwxr-xr-x root root Dec : include
drwxr-xr-x root root Dec : lib
drwxr-xr-x root root Dec : logs
drwxr-xr-x root root Dec : man
drwxr-sr-x root root Oct manual
drwxr-xr-x root root Dec : modules
[root@node101.yinzhengjie.org.cn ~]#

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

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

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

[root@node101.yinzhengjie.org.cn ~]# echo 'PATH=/yinzhengjie/softwares/httpd24/bin:$PATH' > /etc/profile.d/lamp.sh
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# . /etc/profile.d/lamp.sh
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# cat /etc/profile.d/lamp.sh
PATH=/yinzhengjie/softwares/httpd24/bin:$PATH
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# echo $PATH
/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 ~]#
[root@node101.yinzhengjie.org.cn ~]#

6>.启动apache服务

[root@node101.yinzhengjie.org.cn ~]# source /etc/profile.d/lamp.sh
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# ss -ntl
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN *: *:*
LISTEN ::: :::*
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# apachectl start          #启动服务后,客户端可以访问apache的网页啦~
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# ss -ntl
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN *: *:*
LISTEN *: *:*
LISTEN ::: :::*
[root@node101.yinzhengjie.org.cn ~]#

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

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

[root@node101.yinzhengjie.org.cn ~]# ps aux | grep httpd
root 0.0 0.0 ? Ss : : /yinzhengjie/softwares/httpd24/bin/httpd -k start
daemon 0.0 0.0 ? S : : /yinzhengjie/softwares/httpd24/bin/httpd -k start
daemon 0.0 0.0 ? S : : /yinzhengjie/softwares/httpd24/bin/httpd -k start
daemon 0.0 0.0 ? S : : /yinzhengjie/softwares/httpd24/bin/httpd -k start
daemon 0.0 0.0 ? S : : /yinzhengjie/softwares/httpd24/bin/httpd -k start
daemon 0.0 0.0 ? S : : /yinzhengjie/softwares/httpd24/bin/httpd -k start
daemon 0.0 0.0 ? S : : /yinzhengjie/softwares/httpd24/bin/httpd -k start
root 0.0 0.0 pts/ S+ : : grep --color=auto httpd
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# useradd -r -s /sbin/nologin apache
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# egrep -v "^#| ^$|LogFormat" /yinzhengjie/softwares/httpd24/conf/httpd.conf | grep User        #很显然,该配置文件中已经定义了httpd服务是由daemon用户管理
User daemon
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# vim /yinzhengjie/softwares/httpd24/conf/httpd.conf                              #咱们可以修改httpd默认的启动用户。
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# egrep -v "^#| ^$|LogFormat" /yinzhengjie/softwares/httpd24/conf/httpd.conf | grep User
User apache
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# apachectl restart
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# ps aux | grep httpd
root 0.0 0.0 ? Ss : : /yinzhengjie/softwares/httpd24/bin/httpd -k start
apache 0.0 0.0 ? S : : /yinzhengjie/softwares/httpd24/bin/httpd -k start
apache 0.0 0.0 ? S : : /yinzhengjie/softwares/httpd24/bin/httpd -k start
apache 0.0 0.0 ? S : : /yinzhengjie/softwares/httpd24/bin/httpd -k start
apache 0.0 0.0 ? S : : /yinzhengjie/softwares/httpd24/bin/httpd -k start
apache 0.0 0.0 ? S : : /yinzhengjie/softwares/httpd24/bin/httpd -k start
root 0.0 0.0 pts/ S+ : : grep --color=auto httpd
[root@node101.yinzhengjie.org.cn ~]#

 

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

1>.创建mysql用户

[root@node108.yinzhengjie.org.cn ~]# useradd -s /sbin/nologin -r mysql -d /data/mysql
[root@node108.yinzhengjie.org.cn ~]#
[root@node108.yinzhengjie.org.cn ~]# mkdir /data/mysql -pv
mkdir: created directory ‘/data’
mkdir: created directory ‘/data/mysql’
[root@node108.yinzhengjie.org.cn ~]#
[root@node108.yinzhengjie.org.cn ~]# chown mysql.mysql /data/mysql/
[root@node108.yinzhengjie.org.cn ~]#
[root@node108.yinzhengjie.org.cn ~]# ll -d /data/mysql/
drwxr-xr-x mysql mysql Dec : /data/mysql/
[root@node108.yinzhengjie.org.cn ~]#
[root@node108.yinzhengjie.org.cn ~]#

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

[root@node108.yinzhengjie.org.cn ~]# ll
total
-rw-r--r-- root root Oct : mariadb-10.2.-linux-x86_64.tar.gz
[root@node108.yinzhengjie.org.cn ~]#
[root@node108.yinzhengjie.org.cn ~]# tar xf mariadb-10.2.-linux-x86_64.tar.gz -C /usr/local/
[root@node108.yinzhengjie.org.cn ~]#
[root@node108.yinzhengjie.org.cn ~]# ll /usr/local/mariadb-10.2.-linux-x86_64/ -d
drwxr-xr-x root root Dec : /usr/local/mariadb-10.2.-linux-x86_64/
[root@node108.yinzhengjie.org.cn ~]#
[root@node108.yinzhengjie.org.cn ~]# chown -R mysql.mysql /usr/local/mariadb-10.2.-linux-x86_64/
[root@node108.yinzhengjie.org.cn ~]#
[root@node108.yinzhengjie.org.cn ~]# ln -s /usr/local/mariadb-10.2.-linux-x86_64/ /usr/local/mysql
[root@node108.yinzhengjie.org.cn ~]#
[root@node108.yinzhengjie.org.cn ~]# ll /usr/local/mysql/ -d
drwxr-xr-x mysql mysql Dec : /usr/local/mysql/
[root@node108.yinzhengjie.org.cn ~]#

3>.初始化mariadb的数据库

[root@node108.yinzhengjie.org.cn ~]# cd /usr/local/mysql/
[root@node108.yinzhengjie.org.cn /usr/local/mysql]#
[root@node108.yinzhengjie.org.cn /usr/local/mysql]# scripts/mysql_install_db --user=mysql --datadir=/data/mysql/
Installing MariaDB/MySQL system tables in '/data/mysql/' ...
OK To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
To do so, start the server, then issue the following commands: './bin/mysqladmin' -u root password 'new-password'
'./bin/mysqladmin' -u root -h node108.yinzhengjie.org.cn password 'new-password' Alternatively you can run:
'./bin/mysql_secure_installation' which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers. See the MariaDB Knowledgebase at http://mariadb.com/kb or the
MySQL manual for more instructions. You can start the MariaDB daemon with:
cd '.' ; ./bin/mysqld_safe --datadir='/data/mysql/' You can test the MariaDB daemon with mysql-test-run.pl
cd './mysql-test' ; perl mysql-test-run.pl Please report any problems at http://mariadb.org/jira The latest information about MariaDB is available at http://mariadb.org/.
You can find additional information about the MySQL part at:
http://dev.mysql.com
Consider joining MariaDB's strong and vibrant community:
https://mariadb.org/get-involved/ [root@node108.yinzhengjie.org.cn /usr/local/mysql]#
[root@node108.yinzhengjie.org.cn /usr/local/mysql]# ll /data/mysql/
total
-rw-rw---- mysql mysql Dec : aria_log.
-rw-rw---- mysql mysql Dec : aria_log_control
-rw-rw---- mysql mysql Dec : ib_buffer_pool
-rw-rw---- mysql mysql Dec : ibdata1
-rw-rw---- mysql mysql Dec : ib_logfile0
-rw-rw---- mysql mysql Dec : ib_logfile1
drwx------ mysql root Dec : mysql
drwx------ mysql mysql Dec : performance_schema
drwx------ mysql root Dec : test
[root@node108.yinzhengjie.org.cn /usr/local/mysql]#

4>.创建mysql的配置文件

[root@node108.yinzhengjie.org.cn /usr/local/mysql]# mkdir /etc/mysql
[root@node108.yinzhengjie.org.cn /usr/local/mysql]#
[root@node108.yinzhengjie.org.cn /usr/local/mysql]# cp support-files/my-huge.cnf /etc/mysql/my.cnf
[root@node108.yinzhengjie.org.cn /usr/local/mysql]#
[root@node108.yinzhengjie.org.cn /usr/local/mysql]# vim /etc/mysql/my.cnf
[root@node108.yinzhengjie.org.cn /usr/local/mysql]#
[root@node108.yinzhengjie.org.cn /usr/local/mysql]# egrep -v "^ *#|^$" /etc/mysql/my.cnf
[client]
port =
socket = /tmp/mysql.sock
[mysqld]
datadir=/data/mysql                #手动添加改行数据即可启动数据库,因为咱们修改了MySQL数据库默认存放位置,你可以自行调优其它参数,但这并不是本篇博客的主题。
port =
socket = /tmp/mysql.sock
skip-external-locking
key_buffer_size = 384M
max_allowed_packet = 1M
table_open_cache =
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
thread_cache_size =
query_cache_size = 32M
thread_concurrency =
log-bin=mysql-bin
server-id =
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
[myisamchk]
key_buffer_size = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout
[root@node108.yinzhengjie.org.cn /usr/local/mysql]#

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

[root@node108.yinzhengjie.org.cn /usr/local/mysql]# cp support-files/mysql.server /etc/init.d/mysqld
[root@node108.yinzhengjie.org.cn /usr/local/mysql]#
[root@node108.yinzhengjie.org.cn /usr/local/mysql]# ll /etc/init.d/mysqld
-rwxr-xr-x root root Dec : /etc/init.d/mysqld
[root@node108.yinzhengjie.org.cn /usr/local/mysql]#
[root@node108.yinzhengjie.org.cn /usr/local/mysql]# chkconfig --list Note: This output shows SysV services only and does not include native
systemd services. SysV configuration data might be overridden by native
systemd configuration. If you want to list systemd services use 'systemctl list-unit-files'.
To see services enabled on particular target use
'systemctl list-dependencies [target]'. netconsole :off :off :off :off :off :off :off
network :off :off :on :on :on :on :off
[root@node108.yinzhengjie.org.cn /usr/local/mysql]#
[root@node108.yinzhengjie.org.cn /usr/local/mysql]# chkconfig --add mysqld
[root@node108.yinzhengjie.org.cn /usr/local/mysql]#
[root@node108.yinzhengjie.org.cn /usr/local/mysql]# chkconfig --list Note: This output shows SysV services only and does not include native
systemd services. SysV configuration data might be overridden by native
systemd configuration. If you want to list systemd services use 'systemctl list-unit-files'.
To see services enabled on particular target use
'systemctl list-dependencies [target]'. mysqld :off :off :on :on :on :on :off
netconsole :off :off :off :off :off :off :off
network :off :off :on :on :on :on :off
[root@node108.yinzhengjie.org.cn /usr/local/mysql]#
[root@node108.yinzhengjie.org.cn /usr/local/mysql]# service mysqld start
Starting MariaDB. :: mysqld_safe Logging to '/var/log/mariadb/mariadb.log'.
:: mysqld_safe Starting mysqld daemon with databases from /data/mysql
[ OK ]
[root@node108.yinzhengjie.org.cn /usr/local/mysql]#
[root@node108.yinzhengjie.org.cn /usr/local/mysql]# ss -ntl
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN *: *:*
LISTEN ::: :::*
LISTEN ::: :::*
[root@node108.yinzhengjie.org.cn /usr/local/mysql]#

6>.配置mariadb的环境变量

[root@node108.yinzhengjie.org.cn /usr/local/mysql]# echo PATH=/usr/local/mysql/bin/:$PATH > /etc/profile.d/mysql.sh
[root@node108.yinzhengjie.org.cn /usr/local/mysql]#
[root@node108.yinzhengjie.org.cn /usr/local/mysql]# ll /etc/profile.d/mysql.sh
-rw-r--r-- root root Dec : /etc/profile.d/mysql.sh
[root@node108.yinzhengjie.org.cn /usr/local/mysql]#
[root@node108.yinzhengjie.org.cn /usr/local/mysql]# cat /etc/profile.d/mysql.sh
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
[root@node108.yinzhengjie.org.cn /usr/local/mysql]#
[root@node108.yinzhengjie.org.cn /usr/local/mysql]# . /etc/profile.d/mysql.sh
[root@node108.yinzhengjie.org.cn /usr/local/mysql]#
[root@node108.yinzhengjie.org.cn /usr/local/mysql]# mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is
Server version: 10.2.-MariaDB-log MariaDB Server Copyright (c) , , Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]>

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

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

四.PHP的安装方式概述

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

编译安装php-5.6
相关依赖包:
    libxml2-devel bzip2-devel libmcrypt-devel (epel)
  配置安装参数:
    ./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
  编译并安装:
    make -j && make install 编译安装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
  注意:
    php-.0以上版本使用--enable-mysqlnd --with-mysqli=mysqlnd ,原--with-mysql不再支持 为php提供配置文件
  cp php.ini-production /etc/php.ini 编辑apache配置文件httpd.conf,以使apache支持php
  vim /etc/httpd24/conf/httpd.conf
    1>.加二行
      AddType application/x-httpd-php .php
      AddType application/x-httpd-php-source .phps
  2>.定位至DirectoryIndex index.html
      修改为DirectoryIndex index.php index.html 编译安装完成后需要重启httpd服务,因为基于模块方式安装的php模块是依赖于httpd服务的。
    apachectl restart

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

tar xvf php-7.1..tar.bz2
cd php-7.1./
./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 \
--enable-fpm \
--with-config-file-path=/etc \
--with-config-file-scan-dir=/etc/php.d \
--enable-maintainer-zts \
--disable-fileinfo cp php.ini-production /etc/php.ini
cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
chmod +x /etc/init.d/php-fpm
chkconfig --add php-fpm
chkconfig php-fpm on
cd /app/php/etc
cp php-fpm.conf.default php-fpm.conf
cp php-fpm.d/www.conf.default php-fpm.d/www.conf
service php-fpm start 配置httpd支持php
  vim /app/httpd24/conf/httpd.conf
    取消下面两行的注释
      LoadModule proxy_module modules/mod_proxy.so
      LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
    修改下面行
      <IfModule dir_module>
      DirectoryIndex index.php index.html
      </IfModule>
    加下面四行
      AddType application/x-httpd-php .php
      AddType application/x-httpd-php-source .phps
      ProxyRequests Off
      ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:9000/app/httpd24/htdocs/$1

 

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

1>.安装依赖包

[root@node101.yinzhengjie.org.cn ~]# yum -y install epel-release
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.bit.edu.cn
* extras: mirror.bit.edu.cn
* updates: mirror.jdcloud.com
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch :- will be installed
--> Finished Dependency Resolution Dependencies Resolved ============================================================================================================================================================================
Package Arch Version Repository Size
============================================================================================================================================================================
Installing:
epel-release noarch - extras k Transaction Summary
============================================================================================================================================================================
Install Package Total download size: k
Installed size: k
Downloading packages:
epel-release--.noarch.rpm | kB ::
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : epel-release--.noarch /
Verifying : epel-release--.noarch / Installed:
epel-release.noarch :- Complete!
[root@node101.yinzhengjie.org.cn ~]#

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

[root@node101.yinzhengjie.org.cn ~]# yum -y install libxml2-devel bzip2-devel libmcrypt-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
epel/x86_64/metalink | 7.2 kB ::
* base: mirror.bit.edu.cn
* epel: mirrors.yun-idc.com
* extras: mirror.bit.edu.cn
* updates: mirror.jdcloud.com
epel | 5.3 kB ::
(/): epel/x86_64/group_gz | kB ::
(/): epel/x86_64/primary_db | 6.9 MB ::
epel/x86_64/updateinfo FAILED
http://my.mirrors.thegigabit.com/epel/7/x86_64/repodata/51d82b56117bd789590c071ce452588fa7f9f9f22971b3c3d568a8e37f28a6be-updateinfo.xml.bz2: [Errno 14] HTTP Error 404 - Not
FoundTrying other mirror.
To address this issue please refer to the below wiki article https://wiki.centos.org/yum-errors If above article doesn't help to resolve this issue please use https://bugs.centos.org/. (/): epel/x86_64/updateinfo | 1.0 MB ::
Resolving Dependencies
--> Running transaction check
---> Package bzip2-devel.x86_64 :1.0.-.el7 will be installed
---> Package libmcrypt-devel.x86_64 :2.5.-.el7 will be installed
--> Processing Dependency: libmcrypt = 2.5.-.el7 for package: libmcrypt-devel-2.5.-.el7.x86_64
--> Processing Dependency: libmcrypt.so.()(64bit) for package: libmcrypt-devel-2.5.-.el7.x86_64
---> Package libxml2-devel.x86_64 :2.9.-.el7_2. will be installed
--> Processing Dependency: xz-devel for package: libxml2-devel-2.9.-.el7_2..x86_64
--> Running transaction check
---> Package libmcrypt.x86_64 :2.5.-.el7 will be installed
---> Package xz-devel.x86_64 :5.2.-.el7 will be installed
--> Finished Dependency Resolution Dependencies Resolved ============================================================================================================================================================================
Package Arch Version Repository Size
============================================================================================================================================================================
Installing:
bzip2-devel x86_64 1.0.-.el7 base k
libmcrypt-devel x86_64 2.5.-.el7 epel k
libxml2-devel x86_64 2.9.-.el7_2. base 1.0 M
Installing for dependencies:
libmcrypt x86_64 2.5.-.el7 epel k
xz-devel x86_64 5.2.-.el7 base k Transaction Summary
============================================================================================================================================================================
Install Packages (+ Dependent packages) Total download size: 1.4 M
Installed size: 9.6 M
Downloading packages:
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
Public key for libmcrypt-2.5.-.el7.x86_64.rpm is not installed
(/): libmcrypt-2.5.-.el7.x86_64.rpm | kB ::
(/): libmcrypt-devel-2.5.-.el7.x86_64.rpm | kB ::
(/): bzip2-devel-1.0.-.el7.x86_64.rpm | kB ::
(/): xz-devel-5.2.-.el7.x86_64.rpm | kB ::
(/): libxml2-devel-2.9.-.el7_2..x86_64.rpm | 1.0 MB ::
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total kB/s | 1.4 MB ::
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Importing GPG key 0x352C64E5:
Userid : "Fedora EPEL (7) <epel@fedoraproject.org>"
Fingerprint: 91e9 7d7c 4a5e 96f1 7f3e 888f 6a2f aea2 352c 64e5
Package : epel-release--.noarch (@extras)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : xz-devel-5.2.-.el7.x86_64 /
Installing : libmcrypt-2.5.-.el7.x86_64 /
Installing : libmcrypt-devel-2.5.-.el7.x86_64 /
Installing : libxml2-devel-2.9.-.el7_2..x86_64 /
Installing : bzip2-devel-1.0.-.el7.x86_64 /
Verifying : bzip2-devel-1.0.-.el7.x86_64 /
Verifying : libmcrypt-devel-2.5.-.el7.x86_64 /
Verifying : libmcrypt-2.5.-.el7.x86_64 /
Verifying : xz-devel-5.2.-.el7.x86_64 /
Verifying : libxml2-devel-2.9.-.el7_2..x86_64 / Installed:
bzip2-devel.x86_64 :1.0.-.el7 libmcrypt-devel.x86_64 :2.5.-.el7 libxml2-devel.x86_64 :2.9.-.el7_2. Dependency Installed:
libmcrypt.x86_64 :2.5.-.el7 xz-devel.x86_64 :5.2.-.el7 Complete!
[root@node101.yinzhengjie.org.cn ~]#

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

2>.解压php软件包

[root@node101.yinzhengjie.org.cn ~]# ll
total
drwxr-xr-x Sep apr-1.6.
-rw-r--r-- root root Oct : apr-1.6..tar.bz2
drwxr-xr-x Oct apr-util-1.6.
-rw-r--r-- root root Oct : apr-util-1.6..tar.bz2
drwxr-sr-x root Dec : httpd-2.4.
-rw-r--r-- root root Oct : httpd-2.4..tar.bz2
-rw-r--r-- root root Oct : php-7.1..tar.bz2
-rw-r--r-- root root Oct : wordpress-4.9.-zh_CN.tar.gz
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# tar xf php-7.1..tar.bz2
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# cd php-7.1.
[root@node101.yinzhengjie.org.cn ~/php-7.1.]#
[root@node101.yinzhengjie.org.cn ~/php-7.1.]#

3>.配置php编译时参数

[root@node101.yinzhengjie.org.cn ~/php-7.1.]# ./configure --help
`configure' configures this package to adapt to many kinds of systems. Usage: ./configure [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration:
-h, --help display this help and exit
--help=short display options specific to this package
--help=recursive display the short help of all the included packages
-V, --version display version information and exit
-q, --quiet, --silent do not print `checking ...' messages
--cache-file=FILE cache test results in FILE [disabled]
-C, --config-cache alias for `--cache-file=config.cache'
-n, --no-create do not create output files
--srcdir=DIR find the sources in DIR [configure dir or `..'] Installation directories:
--prefix=PREFIX install architecture-independent files in PREFIX
[/usr/local]
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
[PREFIX] By default, `make install' will install all the files in
`/usr/local/bin', `/usr/local/lib' etc. You can specify
an installation prefix other than `/usr/local' using `--prefix',
for instance `--prefix=$HOME'. For better control, use the options below. Fine tuning of the installation directories:
--bindir=DIR user executables [EPREFIX/bin]
--sbindir=DIR system admin executables [EPREFIX/sbin]
--libexecdir=DIR program executables [EPREFIX/libexec]
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
--datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
--datadir=DIR read-only architecture-independent data [DATAROOTDIR]
--infodir=DIR info documentation [DATAROOTDIR/info]
--localedir=DIR locale-dependent data [DATAROOTDIR/locale]
--mandir=DIR man documentation [DATAROOTDIR/man]
--docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE]
--htmldir=DIR html documentation [DOCDIR]
--dvidir=DIR dvi documentation [DOCDIR]
--pdfdir=DIR pdf documentation [DOCDIR]
--psdir=DIR ps documentation [DOCDIR] System types:
--build=BUILD configure for building on BUILD [guessed]
--host=HOST cross-compile to build programs to run on HOST [BUILD]
--target=TARGET configure for building compilers for TARGET [HOST] Optional Features and Packages:
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-libdir=NAME Look for libraries in .../NAME rather than .../lib
--disable-rpath Disable passing additional runtime library
search paths
--enable-re2c-cgoto Enable -g flag to re2c to use computed goto gcc extension
--disable-gcc-global-regs
whether to enable GCC global register variables SAPI modules: --with-apxs2=FILE Build shared Apache 2.0 Handler module. FILE is the optional
pathname to the Apache apxs tool apxs
--disable-cli Disable building CLI version of PHP
(this forces --without-pear)
--enable-embed=TYPE EXPERIMENTAL: Enable building of embedded SAPI library
TYPE is either 'shared' or 'static'. TYPE=shared
--enable-fpm Enable building of the fpm SAPI executable
--with-fpm-user=USER Set the user for php-fpm to run as. (default: nobody)
--with-fpm-group=GRP Set the group for php-fpm to run as. For a system user, this
should usually be set to match the fpm username (default: nobody)
--with-fpm-systemd Activate systemd integration
--with-fpm-acl Use POSIX Access Control Lists
--with-litespeed Build PHP as litespeed module
--enable-phpdbg Build phpdbg
--enable-phpdbg-webhelper Build phpdbg web SAPI support
--enable-phpdbg-debug Build phpdbg in debug mode
--disable-cgi Disable building CGI version of PHP General settings: --enable-gcov Enable GCOV code coverage (requires LTP) - FOR DEVELOPERS ONLY!!
--enable-debug Compile with debugging symbols
--with-layout=TYPE Set how installed files will be laid out. Type can
be either PHP or GNU [PHP]
--with-config-file-path=PATH
Set the path in which to look for php.ini [PREFIX/lib]
--with-config-file-scan-dir=PATH
Set the path where to scan for configuration files
--enable-sigchild Enable PHP's own SIGCHLD handler
--enable-libgcc Enable explicitly linking against libgcc
--disable-short-tags Disable the short-form <? start tag by default
--enable-dmalloc Enable dmalloc
--disable-ipv6 Disable IPv6 support
--enable-dtrace Enable DTrace support
--enable-fd-setsize Set size of descriptor sets Extensions: --with-EXTENSION=shared[,PATH] NOTE: Not all extensions can be build as 'shared'. Example: --with-foobar=shared,/usr/local/foobar/ o Builds the foobar extension as shared extension.
o foobar package install prefix is /usr/local/foobar/ --disable-all Disable all extensions which are enabled by default --disable-libxml Disable LIBXML support
--with-libxml-dir=DIR LIBXML: libxml2 install prefix
--with-openssl=DIR Include OpenSSL support (requires OpenSSL >= 1.0.)
--with-kerberos=DIR OPENSSL: Include Kerberos support
--with-system-ciphers OPENSSL: Use system default cipher list instead of hardcoded value
--with-pcre-regex=DIR Include Perl Compatible Regular Expressions support.
DIR is the PCRE install prefix BUNDLED
--with-pcre-jit Enable PCRE JIT functionality
--without-sqlite3=DIR Do not include SQLite3 support. DIR is the prefix to
SQLite3 installation directory.
--with-zlib=DIR Include ZLIB support (requires zlib >= 1.0.)
--with-zlib-dir=<DIR> Define the location of zlib install directory
--enable-bcmath Enable bc style precision math functions
--with-bz2=DIR Include BZip2 support
--enable-calendar Enable support for calendar conversion
--disable-ctype Disable ctype functions
--with-curl=DIR Include cURL support
--enable-dba Build DBA with bundled modules. To build shared DBA
extension use --enable-dba=shared
--with-qdbm=DIR DBA: QDBM support
--with-gdbm=DIR DBA: GDBM support
--with-ndbm=DIR DBA: NDBM support
--with-db4=DIR DBA: Oracle Berkeley DB .x or .x support
--with-db3=DIR DBA: Oracle Berkeley DB .x support
--with-db2=DIR DBA: Oracle Berkeley DB .x support
--with-db1=DIR DBA: Oracle Berkeley DB .x support/emulation
--with-dbm=DIR DBA: DBM support
--with-tcadb=DIR DBA: Tokyo Cabinet abstract DB support
--without-cdb=DIR DBA: CDB support (bundled)
--disable-inifile DBA: INI support (bundled)
--disable-flatfile DBA: FlatFile support (bundled)
--disable-dom Disable DOM support
--with-libxml-dir=DIR DOM: libxml2 install prefix
--with-enchant=DIR Include enchant support.
GNU Aspell version 1.1. or higher required.
--enable-exif Enable EXIF (metadata from images) support
--disable-fileinfo Disable fileinfo support
--disable-filter Disable input filter support
--with-pcre-dir FILTER: pcre install prefix
--enable-ftp Enable FTP support
--with-openssl-dir=DIR FTP: openssl install prefix
--with-gd=DIR Include GD support. DIR is the GD library base
install directory BUNDLED
--with-webp-dir=DIR GD: Set the path to libwebp install prefix
--with-jpeg-dir=DIR GD: Set the path to libjpeg install prefix
--with-png-dir=DIR GD: Set the path to libpng install prefix
--with-zlib-dir=DIR GD: Set the path to libz install prefix
--with-xpm-dir=DIR GD: Set the path to libXpm install prefix
--with-freetype-dir=DIR GD: Set the path to FreeType install prefix
--enable-gd-native-ttf GD: Enable TrueType string function
--enable-gd-jis-conv GD: Enable JIS-mapped Japanese font support
--with-gettext=DIR Include GNU gettext support
--with-gmp=DIR Include GNU MP support
--with-mhash=DIR Include mhash support
--disable-hash Disable hash support
--without-iconv=DIR Exclude iconv support
--with-imap=DIR Include IMAP support. DIR is the c-client install prefix
--with-kerberos=DIR IMAP: Include Kerberos support. DIR is the Kerberos install prefix
--with-imap-ssl=DIR IMAP: Include SSL support. DIR is the OpenSSL install prefix
--with-interbase=DIR Include Firebird support. DIR is the Firebird base
install directory /opt/firebird
--enable-intl Enable internationalization support
--with-icu-dir=DIR Specify where ICU libraries and headers can be found
--disable-json Disable JavaScript Object Serialization support
--with-ldap=DIR Include LDAP support
--with-ldap-sasl=DIR LDAP: Include Cyrus SASL support
--enable-mbstring Enable multibyte string support
--disable-mbregex MBSTRING: Disable multibyte regex support
--disable-mbregex-backtrack
MBSTRING: Disable multibyte regex backtrack check
--with-libmbfl=DIR MBSTRING: Use external libmbfl. DIR is the libmbfl base
install directory BUNDLED
--with-onig=DIR MBSTRING: Use external oniguruma. DIR is the oniguruma install prefix.
If DIR is not set, the bundled oniguruma will be used
--with-mcrypt=DIR Include mcrypt support
--with-mysqli=FILE Include MySQLi support. FILE is the path
to mysql_config. If no value or mysqlnd is passed
as FILE, the MySQL native driver will be used
--enable-embedded-mysqli
MYSQLi: Enable embedded support
Note: Does not work with MySQL native driver!
--with-mysql-sock=SOCKPATH
MySQLi/PDO_MYSQL: Location of the MySQL unix socket pointer.
If unspecified, the default locations are searched
--with-oci8=DIR Include Oracle Database OCI8 support. DIR defaults to $ORACLE_HOME.
Use --with-oci8=instantclient,/path/to/instant/client/lib
to use an Oracle Instant Client installation
--with-odbcver=HEX Force support for the passed ODBC version. A hex number is expected, default 0x0350.
Use the special value of to prevent an explicit ODBCVER to be defined.
--with-adabas=DIR Include Adabas D support /usr/local
--with-sapdb=DIR Include SAP DB support /usr/local
--with-solid=DIR Include Solid support /usr/local/solid
--with-ibm-db2=DIR Include IBM DB2 support /home/db2inst1/sqllib
--with-ODBCRouter=DIR Include ODBCRouter.com support /usr
--with-empress=DIR Include Empress support \$EMPRESSPATH
(Empress Version >= 8.60 required)
--with-empress-bcs=DIR
Include Empress Local Access support \$EMPRESSPATH
(Empress Version >= 8.60 required)
--with-birdstep=DIR Include Birdstep support /usr/local/birdstep
--with-custom-odbc=DIR Include user defined ODBC support. DIR is ODBC install base
directory /usr/local. Make sure to define CUSTOM_ODBC_LIBS and
have some odbc.h in your include dirs. f.e. you should define
following for Sybase SQL Anywhere 5.5. on QNX, prior to
running this configure script:
CPPFLAGS=\"-DODBC_QNX -DSQLANY_BUG\"
LDFLAGS=-lunix
CUSTOM_ODBC_LIBS=\"-ldblib -lodbc\"
--with-iodbc=DIR Include iODBC support /usr/local
--with-esoob=DIR Include Easysoft OOB support /usr/local/easysoft/oob/client
--with-unixODBC=DIR Include unixODBC support /usr/local
--with-dbmaker=DIR Include DBMaker support
--disable-opcache Disable Zend OPcache support
--disable-opcache-file Disable file based caching
--disable-huge-code-pages
Disable copying PHP CODE pages into HUGE PAGES
--enable-pcntl Enable pcntl support (CLI/CGI only)
--disable-pdo Disable PHP Data Objects support
--with-pdo-dblib=DIR PDO: DBLIB-DB support. DIR is the FreeTDS home directory
--with-pdo-firebird=DIR PDO: Firebird support. DIR is the Firebird base
install directory /opt/firebird
--with-pdo-mysql=DIR PDO: MySQL support. DIR is the MySQL base directory
If no value or mysqlnd is passed as DIR, the
MySQL native driver will be used
--with-zlib-dir=DIR PDO_MySQL: Set the path to libz install prefix
--with-pdo-oci=DIR PDO: Oracle OCI support. DIR defaults to \$ORACLE_HOME.
Use --with-pdo-oci=instantclient,prefix,version
for an Oracle Instant Client SDK.
For example on Linux with 11.2 RPMs use:
--with-pdo-oci=instantclient,/usr,11.2
With 10.2 RPMs use:
--with-pdo-oci=instantclient,/usr,10.2.0.4
--with-pdo-odbc=flavour,dir
PDO: Support for 'flavour' ODBC driver.
include and lib dirs are looked for under 'dir'. 'flavour' can be one of: ibm-db2, iODBC, unixODBC, generic
If ',dir' part is omitted, default for the flavour
you have selected will be used. e.g.: --with-pdo-odbc=unixODBC will check for unixODBC under /usr/local. You may attempt
to use an otherwise unsupported driver using the \"generic\"
flavour. The syntax for generic ODBC support is: --with-pdo-odbc=generic,dir,libname,ldflags,cflags When built as 'shared' the extension filename is always pdo_odbc.so
--with-pdo-pgsql=DIR PDO: PostgreSQL support. DIR is the PostgreSQL base
install directory or the path to pg_config
--without-pdo-sqlite=DIR
PDO: sqlite support. DIR is the sqlite base
install directory BUNDLED
--with-pgsql=DIR Include PostgreSQL support. DIR is the PostgreSQL
base install directory or the path to pg_config
--disable-phar Disable phar support
--disable-posix Disable POSIX-like functions
--with-pspell=DIR Include PSPELL support.
GNU Aspell version 0.50. or higher required
--with-libedit=DIR Include libedit readline replacement (CLI/CGI only)
--with-readline=DIR Include readline support (CLI/CGI only)
--with-recode=DIR Include recode support
--disable-session Disable session support
--with-mm=DIR SESSION: Include mm support for session storage
--enable-shmop Enable shmop support
--disable-simplexml Disable SimpleXML support
--with-libxml-dir=DIR SimpleXML: libxml2 install prefix
--with-snmp=DIR Include SNMP support
--with-openssl-dir=DIR SNMP: openssl install prefix
--enable-soap Enable SOAP support
--with-libxml-dir=DIR SOAP: libxml2 install prefix
--enable-sockets Enable sockets support
--enable-sysvmsg Enable sysvmsg support
--enable-sysvsem Enable System V semaphore support
--enable-sysvshm Enable the System V shared memory support
--with-tidy=DIR Include TIDY support
--disable-tokenizer Disable tokenizer support
--enable-wddx Enable WDDX support
--with-libxml-dir=DIR WDDX: libxml2 install prefix
--with-libexpat-dir=DIR WDDX: libexpat dir for XMLRPC-EPI (deprecated)
--disable-xml Disable XML support
--with-libxml-dir=DIR XML: libxml2 install prefix
--with-libexpat-dir=DIR XML: libexpat install prefix (deprecated)
--disable-xmlreader Disable XMLReader support
--with-libxml-dir=DIR XMLReader: libxml2 install prefix
--with-xmlrpc=DIR Include XMLRPC-EPI support
--with-libxml-dir=DIR XMLRPC-EPI: libxml2 install prefix
--with-libexpat-dir=DIR XMLRPC-EPI: libexpat dir for XMLRPC-EPI (deprecated)
--with-iconv-dir=DIR XMLRPC-EPI: iconv dir for XMLRPC-EPI
--disable-xmlwriter Disable XMLWriter support
--with-libxml-dir=DIR XMLWriter: libxml2 install prefix
--with-xsl=DIR Include XSL support. DIR is the libxslt base
install directory (libxslt >= 1.1. required)
--enable-zip Include Zip read/write support
--with-zlib-dir=DIR ZIP: Set the path to libz install prefix
--with-pcre-dir ZIP: pcre install prefix
--with-libzip=DIR ZIP: use libzip
--enable-mysqlnd Enable mysqlnd explicitly, will be done implicitly
when required by other extensions
--disable-mysqlnd-compression-support
Disable support for the MySQL compressed protocol in mysqlnd
--with-zlib-dir=DIR mysqlnd: Set the path to libz install prefix PEAR: --with-pear=DIR Install PEAR in DIR [PREFIX/lib/php]
--without-pear Do not install PEAR Zend: --enable-maintainer-zts Enable thread safety - for code maintainers only!!
--disable-inline-optimization
If building zend_execute.lo fails, try this switch
--disable-zend-signals whether to enable zend signal handling TSRM: --with-tsrm-pth=pth-config
Use GNU Pth
--with-tsrm-st Use SGI's State Threads
--with-tsrm-pthreads Use POSIX threads (default) Libtool: --enable-shared=PKGS Build shared libraries default=yes
--enable-static=PKGS Build static libraries default=yes
--enable-fast-install=PKGS
Optimize for fast installation default=yes
--with-gnu-ld Assume the C compiler uses GNU ld default=no
--disable-libtool-lock Avoid locking (might break parallel builds)
--with-pic Try to use only PIC/non-PIC objects default=use both
--with-tags=TAGS Include additional configurations automatic Some influential environment variables:
CC C compiler command
CFLAGS C compiler flags
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
nonstandard directory <lib dir>
LIBS libraries to pass to the linker, e.g. -l<library>
CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
you have headers in a nonstandard directory <include dir>
CPP C preprocessor
YACC The `Yet Another Compiler Compiler' implementation to use.
Defaults to the first program found out of: `bison -y', `byacc',
`yacc'.
YFLAGS The list of arguments that will be passed by default to $YACC.
This script will default YFLAGS to the empty string to avoid a
default value of `-d' given by some make applications.
CXX C++ compiler command
CXXFLAGS C++ compiler flags
CXXCPP C++ preprocessor Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider.
[root@node101.yinzhengjie.org.cn ~/php-7.1.]#

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

[root@node101.yinzhengjie.org.cn ~/php-7.1.]# ./configure --prefix=/yinzhengjie/softwares/php \
> --enable-mysqlnd \                        #启用mysql数据库连接功能
> --with-mysqli=mysqlnd \                     #支持mysqli的方式连接数据库
> --with-openssl \   #支持加密功能
> --with-pdo-mysql=mysqlnd \   #支持pdo的方式连接数据库
> --enable-mbstring \                        #启用多字节字符串功能
> --with-freetype-dir \                       #支持各种文件类型
> --with-jpeg-dir \                       #支持jpeg格式图片
> --with-png-dir \                         #支持png格式图片
> --with-zlib \                           #支持zlib压缩功能
> --with-libxml-dir=/usr \                    #支持xml的相关库
> --enable-xml \                          #启用xml功能
> --enable-sockets \                        #支持套接字
> --enable-fpm \                          #启用fastcgi模式
> --with-config-file-path=/etc \                 #指定配置文件存放目录未"/etc/",若不指定则会默认存放在安装目录的conf目录下哟~
> --with-config-file-scan-dir=/etc/php.d \           #也可以将配置文件放在"/etc/php.d"目录   
> --enable-maintainer-zts \
> --disable-fileinfo
......
Thank you for using PHP. config.status: creating php7.spec
config.status: creating main/build-defs.h
config.status: creating scripts/phpize
config.status: creating scripts/man1/phpize.
config.status: creating scripts/php-config
config.status: creating scripts/man1/php-config.
config.status: creating sapi/cli/php.
config.status: creating sapi/fpm/php-fpm.conf
config.status: creating sapi/fpm/www.conf
config.status: creating sapi/fpm/init.d.php-fpm
config.status: creating sapi/fpm/php-fpm.service
config.status: creating sapi/fpm/php-fpm.
config.status: creating sapi/fpm/status.html
config.status: creating sapi/cgi/php-cgi.
config.status: creating ext/phar/phar.
config.status: creating ext/phar/phar.phar.
config.status: creating main/php_config.h
config.status: executing default commands
[root@node101.yinzhengjie.org.cn ~/php-7.1.]#

4>.安装并编译

[root@node101.yinzhengjie.org.cn ~/php-7.1.]# lscpu
Architecture: x86_64
CPU op-mode(s): -bit, -bit
Byte Order: Little Endian
CPU(s):
On-line CPU(s) list: -
Thread(s) per core:
Core(s) per socket:
Socket(s):
NUMA node(s):
Vendor ID: GenuineIntel
CPU family:
Model:
Model name: Intel(R) Core(TM) i7-8750H CPU @ .20GHz
Stepping:
CPU MHz: 2208.004
BogoMIPS: 4416.00
Hypervisor vendor: KVM
Virtualization type: full
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 9216K
NUMA node0 CPU(s): -
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
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

[root@node101.yinzhengjie.org.cn ~/php-7.1.]# make -j  && make install
......
Installing shared extensions: /yinzhengjie/softwares/php/lib/php/extensions/no-debug-zts-/
Installing PHP CLI binary: /yinzhengjie/softwares/php/bin/
Installing PHP CLI man page: /yinzhengjie/softwares/php/php/man/man1/
Installing PHP FPM binary: /yinzhengjie/softwares/php/sbin/
Installing PHP FPM defconfig: /yinzhengjie/softwares/php/etc/
Installing PHP FPM man page: /yinzhengjie/softwares/php/php/man/man8/
Installing PHP FPM status page: /yinzhengjie/softwares/php/php/php/fpm/
Installing phpdbg binary: /yinzhengjie/softwares/php/bin/
Installing phpdbg man page: /yinzhengjie/softwares/php/php/man/man1/
Installing PHP CGI binary: /yinzhengjie/softwares/php/bin/
Installing PHP CGI man page: /yinzhengjie/softwares/php/php/man/man1/
Installing build environment: /yinzhengjie/softwares/php/lib/php/build/
Installing header files: /yinzhengjie/softwares/php/include/php/
Installing helper programs: /yinzhengjie/softwares/php/bin/
program: phpize
program: php-config
Installing man pages: /yinzhengjie/softwares/php/php/man/man1/
page: phpize.
page: php-config.
Installing PEAR environment: /yinzhengjie/softwares/php/lib/php/
[PEAR] Archive_Tar - installed: 1.4.
[PEAR] Console_Getopt - installed: 1.4.
[PEAR] Structures_Graph- installed: 1.1.
[PEAR] XML_Util - installed: 1.4.
[PEAR] PEAR - installed: 1.10.
Wrote PEAR system config file at: /yinzhengjie/softwares/php/etc/pear.conf
You may want to add: /yinzhengjie/softwares/php/lib/php to your php.ini include_path
/root/php-7.1./build/shtool install -c ext/phar/phar.phar /yinzhengjie/softwares/php/bin
ln -s -f phar.phar /yinzhengjie/softwares/php/bin/phar
Installing PDO headers: /yinzhengjie/softwares/php/include/php/ext/pdo/
[root@node101.yinzhengjie.org.cn ~/php-7.1.]#

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

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

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

6>.配置fastcgi的启动脚本

[root@node101.yinzhengjie.org.cn ~/php-7.1.]# cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
[root@node101.yinzhengjie.org.cn ~/php-7.1.]#
[root@node101.yinzhengjie.org.cn ~/php-7.1.]# ll /etc/init.d/php-fpm
-rw-r--r-- root root Dec : /etc/init.d/php-fpm
[root@node101.yinzhengjie.org.cn ~/php-7.1.]#
[root@node101.yinzhengjie.org.cn ~/php-7.1.]# chmod +x /etc/init.d/php-fpm
[root@node101.yinzhengjie.org.cn ~/php-7.1.]#
[root@node101.yinzhengjie.org.cn ~/php-7.1.]# ll /etc/init.d/php-fpm
-rwxr-xr-x root root Dec : /etc/init.d/php-fpm
[root@node101.yinzhengjie.org.cn ~/php-7.1.]#
[root@node101.yinzhengjie.org.cn ~/php-7.1.]# chkconfig --add php-fpm
[root@node101.yinzhengjie.org.cn ~/php-7.1.]#
[root@node101.yinzhengjie.org.cn ~/php-7.1.]# chkconfig --list Note: This output shows SysV services only and does not include native
systemd services. SysV configuration data might be overridden by native
systemd configuration. If you want to list systemd services use 'systemctl list-unit-files'.
To see services enabled on particular target use
'systemctl list-dependencies [target]'. netconsole :off :off :off :off :off :off :off
network :off :off :on :on :on :on :off
php-fpm :off :off :on :on :on :on :off
[root@node101.yinzhengjie.org.cn ~/php-7.1.]#

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

[root@node101.yinzhengjie.org.cn ~/php-7.1.]# cd /yinzhengjie/softwares/php/etc/
[root@node101.yinzhengjie.org.cn /yinzhengjie/softwares/php/etc]#
[root@node101.yinzhengjie.org.cn /yinzhengjie/softwares/php/etc]# cp php-fpm.conf.default php-fpm.conf
[root@node101.yinzhengjie.org.cn /yinzhengjie/softwares/php/etc]#
[root@node101.yinzhengjie.org.cn /yinzhengjie/softwares/php/etc]# cd php-fpm.d/
[root@node101.yinzhengjie.org.cn /yinzhengjie/softwares/php/etc/php-fpm.d]#
[root@node101.yinzhengjie.org.cn /yinzhengjie/softwares/php/etc/php-fpm.d]# cp www.conf.default www.conf
[root@node101.yinzhengjie.org.cn /yinzhengjie/softwares/php/etc/php-fpm.d]#

8>.启动php服务

[root@node101.yinzhengjie.org.cn ~]# ss -ntl
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN *: *:*
LISTEN *: *:*
LISTEN ::: :::*
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# service php-fpm start
Starting php-fpm done
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# ss -ntl
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 127.0.0.1: *:*
LISTEN *: *:*
LISTEN *: *:*
LISTEN ::: :::*
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]#

六.配置httpd支持php

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

[root@node101.yinzhengjie.org.cn ~]# grep index.html /yinzhengjie/softwares/httpd24/conf/httpd.conf
DirectoryIndex index.html
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# vim /yinzhengjie/softwares/httpd24/conf/httpd.conf
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# grep index.html /yinzhengjie/softwares/httpd24/conf/httpd.conf
DirectoryIndex index.php index.html
[root@node101.yinzhengjie.org.cn ~]#

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

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

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

[root@node101.yinzhengjie.org.cn ~]# grep proxy_module /yinzhengjie/softwares/httpd24/conf/httpd.conf
#LoadModule proxy_module modules/mod_proxy.so
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# grep proxy_fcgi_module /yinzhengjie/softwares/httpd24/conf/httpd.conf
#LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# vim /yinzhengjie/softwares/httpd24/conf/httpd.conf
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# grep proxy_module /yinzhengjie/softwares/httpd24/conf/httpd.conf
LoadModule proxy_module modules/mod_proxy.so
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# grep proxy_fcgi_module /yinzhengjie/softwares/httpd24/conf/httpd.conf
LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
[root@node101.yinzhengjie.org.cn ~]#

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

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

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

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

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

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

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

7>.重启httpd服务

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

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

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

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

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

[root@node101.yinzhengjie.org.cn ~]# ab -c  -n  http://node101.yinzhengjie.org.cn/
This is ApacheBench, Version 2.3 <$Revision: $>
Copyright Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking node101.yinzhengjie.org.cn (be patient)
Completed requests
Completed requests
Finished requests Server Software: Apache/2.4.
Server Hostname: node101.yinzhengjie.org.cn
Server Port: Document Path: /
Document Length: bytes Concurrency Level:
Time taken for tests: 8.381 seconds
Complete requests:
Failed requests:
Total transferred: bytes
HTML transferred: bytes
Requests per second: 23.86 [#/sec] (mean)          #我们发现尽管使用最新版本的PHP7.1也没有使用xcache加速器要快,但性能上的确是有提示的。
Time per request: 419.060 [ms] (mean)
Time per request: 41.906 [ms] (mean, across all concurrent requests)
Transfer rate: 1247.63 [Kbytes/sec] received Connection Times (ms)
min mean[+/-sd] median max
Connect: 0.0
Processing: 65.1
Waiting: 64.5
Total: 65.1 Percentage of the requests served within a certain time (ms)
%
%
%
%
%
%
%
%
% (longest request)
[root@node101.yinzhengjie.org.cn ~]#

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

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

[root@node101.yinzhengjie.org.cn /yinzhengjie/softwares/php/etc/php-fpm.d]#               #默认php是监听9000端口的
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 127.0.0.1: *:*
LISTEN *: *:*
LISTEN *: *:*
LISTEN ::: :::*
[root@node101.yinzhengjie.org.cn /yinzhengjie/softwares/php/etc/php-fpm.d]#
[root@node101.yinzhengjie.org.cn /yinzhengjie/softwares/php/etc/php-fpm.d]# egrep -v "^;|^$" www.conf
[www]
user = nobody
group = nobody
listen = 127.0.0.1:
pm = dynamic
pm.max_children =
pm.start_servers =
pm.min_spare_servers =
pm.max_spare_servers =
[root@node101.yinzhengjie.org.cn /yinzhengjie/softwares/php/etc/php-fpm.d]#
[root@node101.yinzhengjie.org.cn /yinzhengjie/softwares/php/etc/php-fpm.d]# vim www.conf
[root@node101.yinzhengjie.org.cn /yinzhengjie/softwares/php/etc/php-fpm.d]#
[root@node101.yinzhengjie.org.cn /yinzhengjie/softwares/php/etc/php-fpm.d]# egrep -v "^;|^$" www.conf
[www]
user = nobody
group = nobody
listen = 127.0.0.1:
listen = /tmp/php-fpm.sock          #添加该行即可,可以将上面那行注释掉,因为就算不注释改行也会覆盖掉上一行的配置哟,即会让监听端口的配置失效,之启用本地套接字监听
pm = dynamic
pm.max_children =
pm.start_servers =
pm.min_spare_servers =
pm.max_spare_servers =
[root@node101.yinzhengjie.org.cn /yinzhengjie/softwares/php/etc/php-fpm.d]#
[root@node101.yinzhengjie.org.cn /yinzhengjie/softwares/php/etc/php-fpm.d]# service php-fpm restart        #别忘记重启服务
Gracefully shutting down php-fpm . done
Starting php-fpm done
[root@node101.yinzhengjie.org.cn /yinzhengjie/softwares/php/etc/php-fpm.d]#
[root@node101.yinzhengjie.org.cn /yinzhengjie/softwares/php/etc/php-fpm.d]# ll /tmp/php-fpm.sock           #服务启动成功后,默认会自动生成该套接字文件
srw-rw---- root root Dec : /tmp/php-fpm.sock
[root@node101.yinzhengjie.org.cn /yinzhengjie/softwares/php/etc/php-fpm.d]#
[root@node101.yinzhengjie.org.cn /yinzhengjie/softwares/php/etc/php-fpm.d]#
[root@node101.yinzhengjie.org.cn /yinzhengjie/softwares/php/etc/php-fpm.d]# ss -ntl                  #我们发现服务启动成功后,php-fpm之前默认的9000端口是没有启动的
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN *: *:*
LISTEN *: *:*
LISTEN ::: :::*
[root@node101.yinzhengjie.org.cn /yinzhengjie/softwares/php/etc/php-fpm.d]#

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

[root@node101.yinzhengjie.org.cn ~]# tail - /yinzhengjie/softwares/httpd24/conf/httpd.conf
#Add by yinzhengjie
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
ProxyRequests Off
ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:9000/yinzhengjie/softwares/httpd24/htdocs/$1
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# vim /yinzhengjie/softwares/httpd24/conf/httpd.conf
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# tail - /yinzhengjie/softwares/httpd24/conf/httpd.conf
#Add by yinzhengjie
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
ProxyRequests Off
#ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:9000/yinzhengjie/softwares/httpd24/htdocs/$1
ProxyPassMatch "^/(.*\.php(/.*)?)$" "unix:/tmp/php-fpm.sock|fcgi://localhost/yinzhengjie/softwares/httpd24/htdocs/"
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# apachectl restart
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# ss -ntl
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN *: *:*
LISTEN *: *:*
LISTEN ::: :::*
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# ll /tmp/php-fpm.sock
srw-rw---- root root Dec : /tmp/php-fpm.sock
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# chmod /tmp/php-fpm.sock         #温馨提示:需要给该套接字授权777,否则可能会出现如下图所示的报错界面,但治标不治本,因为一旦服务重启还得执行该操作,正确的解决方案请继续往下看。
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# ll /tmp/php-fpm.sock
srwxrwxrwx root root Dec : /tmp/php-fpm.sock
[root@node101.yinzhengjie.org.cn ~]#

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

上面的方式的确可以让服务临时正常访问了,但只要我们重启httpd服务后会发现依旧得重新授权才能使用,这一点很让人头疼,因此想要彻底解决这个问题,还得修改配置文件内容,具体操作如下:
  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服务完成(如果遇到问题看日志,日志会告诉你错误原因哟~)

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

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

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