源码编译安装httpd

环境准备:

创建一个系统用户,不需要家目录,不需要登陆

[root@localhost ~]# useradd -r -M -s /sbin/nologin apache
[root@localhost ~]# id apache
uid=995(apache) gid=992(apache) groups=992(apache)
[root@localhost ~]# 

所需工具安装:(wget、gcc、gcc-c++、make)

[root@localhost ~]# yum -y install wget gcc gcc-c++ make
CentOS-8.5.2111 - Base - mirrors.aliyun.com   1.8 MB/s | 4.6 MB     00:02    
CentOS-8.5.2111 - Extras - mirrors.aliyun.com  35 kB/s |  10 kB     00:00    
CentOS-8.5.2111 - AppStream - mirrors.aliyun. 999 kB/s | 8.4 MB     00:08    
Dependencies resolved.
==============================================================================
 Package               Arch      Version                   Repository    Size
==============================================================================
Installing:
 gcc                   x86_64    8.5.0-4.el8_5             AppStream     23 M
 gcc-c++               x86_64    8.5.0-4.el8_5             AppStream     12 M
 make                  x86_64    1:4.2.1-10.el8            base         498 k
 wget                  x86_64    1.19.5-10.el8             AppStream    734 k
Upgrading:
 libgcc                x86_64    8.5.0-4.el8_5             base          79 k
 libgomp               x86_64    8.5.0-4.el8_5             base         206 k
 libstdc++             x86_64    8.5.0-4.el8_5             base         453 k
Installing dependencies:
 binutils              x86_64    2.30-108.el8_5.1          base         5.8 M
 cpp                   x86_64    8.5.0-4.el8_5             AppStream     10 M
 glibc-devel           x86_64    2.28-164.el8              base         1.0 M
 glibc-headers         x86_64    2.28-164.el8              base         480 k
 isl                   x86_64    0.16.1-6.el8              AppStream    841 k
 kernel-headers        x86_64    4.18.0-348.7.1.el8_5      base         8.3 M
 libmetalink           x86_64    0.1.3-7.el8               base          32 k
 libmpc                x86_64    1.1.0-9.1.el8             AppStream     61 k
 libpkgconf            x86_64    1.4.2-1.el8               base          35 k
 libstdc++-devel       x86_64    8.5.0-4.el8_5             AppStream    2.0 M
 libxcrypt-devel       x86_64    4.1.1-6.el8               base          25 k
 pkgconf               x86_64    1.4.2-1.el8               base          38 k
 pkgconf-m4            noarch    1.4.2-1.el8               base          17 k
 pkgconf-pkg-config    x86_64    1.4.2-1.el8               base          15 k

Transaction Summary
==============================================================================
Install  18 Packages
Upgrade   3 Packages

Total download size: 67 M
Downloading Packages:
(1/21): glibc-headers-2.28-164.el8.x86_64.rpm 624 kB/s | 480 kB     00:00    
(2/21): glibc-devel-2.28-164.el8.x86_64.rpm   679 kB/s | 1.0 MB     00:01    
(3/21): libmetalink-0.1.3-7.el8.x86_64.rpm    129 kB/s |  32 kB     00:00    
(4/21): libpkgconf-1.4.2-1.el8.x86_64.rpm     248 kB/s |  35 kB     00:00    
(5/21): libxcrypt-devel-4.1.1-6.el8.x86_64.rp 141 kB/s |  25 kB     00:00    
(6/21): make-4.2.1-10.el8.x86_64.rpm          335 kB/s | 498 kB     00:01    
(7/21): pkgconf-1.4.2-1.el8.x86_64.rpm        234 kB/s |  38 kB     00:00    
(8/21): pkgconf-m4-1.4.2-1.el8.noarch.rpm      96 kB/s |  17 kB     00:00    
(9/21): pkgconf-pkg-config-1.4.2-1.el8.x86_64 139 kB/s |  15 kB     00:00    
(10/21): binutils-2.30-108.el8_5.1.x86_64.rpm 566 kB/s | 5.8 MB     00:10    
(11/21): kernel-headers-4.18.0-348.7.1.el8_5. 805 kB/s | 8.3 MB     00:10    
(12/21): cpp-8.5.0-4.el8_5.x86_64.rpm         630 kB/s |  10 MB     00:16    
(13/21): isl-0.16.1-6.el8.x86_64.rpm          473 kB/s | 841 kB     00:01    
(14/21): libmpc-1.1.0-9.1.el8.x86_64.rpm      323 kB/s |  61 kB     00:00    
(15/21): libstdc++-devel-8.5.0-4.el8_5.x86_64 727 kB/s | 2.0 MB     00:02    
(16/21): wget-1.19.5-10.el8.x86_64.rpm        553 kB/s | 734 kB     00:01    
(17/21): libgcc-8.5.0-4.el8_5.x86_64.rpm      542 kB/s |  79 kB     00:00    
(18/21): libgomp-8.5.0-4.el8_5.x86_64.rpm     764 kB/s | 206 kB     00:00    
(19/21): libstdc++-8.5.0-4.el8_5.x86_64.rpm   879 kB/s | 453 kB     00:00    
(20/21): gcc-c++-8.5.0-4.el8_5.x86_64.rpm     737 kB/s |  12 MB     00:17    
(21/21): gcc-8.5.0-4.el8_5.x86_64.rpm         746 kB/s |  23 MB     00:32    
------------------------------------------------------------------------------
Total                                         1.6 MB/s |  67 MB     00:42     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                      1/1 
  Upgrading        : libgcc-8.5.0-4.el8_5.x86_64                         1/24 
  Running scriptlet: libgcc-8.5.0-4.el8_5.x86_64                         1/24 
  Upgrading        : libstdc++-8.5.0-4.el8_5.x86_64                      2/24 
  Running scriptlet: libstdc++-8.5.0-4.el8_5.x86_64                      2/24 
  Installing       : libmpc-1.1.0-9.1.el8.x86_64                         3/24 
  Installing       : cpp-8.5.0-4.el8_5.x86_64                            4/24 
  Running scriptlet: cpp-8.5.0-4.el8_5.x86_64                            4/24 
  Installing       : binutils-2.30-108.el8_5.1.x86_64                    5/24 
  Running scriptlet: binutils-2.30-108.el8_5.1.x86_64                    5/24 
  Installing       : libstdc++-devel-8.5.0-4.el8_5.x86_64                6/24 
  Upgrading        : libgomp-8.5.0-4.el8_5.x86_64                        7/24 
  Running scriptlet: libgomp-8.5.0-4.el8_5.x86_64                        7/24 
  Installing       : isl-0.16.1-6.el8.x86_64                             8/24 
  Running scriptlet: isl-0.16.1-6.el8.x86_64                             8/24 
  Installing       : pkgconf-m4-1.4.2-1.el8.noarch                       9/24 
  Installing       : libpkgconf-1.4.2-1.el8.x86_64                      10/24 
  Installing       : pkgconf-1.4.2-1.el8.x86_64                         11/24 
  Installing       : pkgconf-pkg-config-1.4.2-1.el8.x86_64              12/24 
  Installing       : libmetalink-0.1.3-7.el8.x86_64                     13/24 
  Installing       : kernel-headers-4.18.0-348.7.1.el8_5.x86_64         14/24 
  Running scriptlet: glibc-headers-2.28-164.el8.x86_64                  15/24 
  Installing       : glibc-headers-2.28-164.el8.x86_64                  15/24 
  Installing       : libxcrypt-devel-4.1.1-6.el8.x86_64                 16/24 
  Installing       : glibc-devel-2.28-164.el8.x86_64                    17/24 
  Running scriptlet: glibc-devel-2.28-164.el8.x86_64                    17/24 
  Installing       : gcc-8.5.0-4.el8_5.x86_64                           18/24 
  Running scriptlet: gcc-8.5.0-4.el8_5.x86_64                           18/24 
  Installing       : gcc-c++-8.5.0-4.el8_5.x86_64                       19/24 
  Installing       : wget-1.19.5-10.el8.x86_64                          20/24 
  Running scriptlet: wget-1.19.5-10.el8.x86_64                          20/24 
  Installing       : make-1:4.2.1-10.el8.x86_64                         21/24 
  Running scriptlet: make-1:4.2.1-10.el8.x86_64                         21/24 
  Cleanup          : libstdc++-8.5.0-3.el8.x86_64                       22/24 
  Running scriptlet: libstdc++-8.5.0-3.el8.x86_64                       22/24 
  Cleanup          : libgcc-8.5.0-3.el8.x86_64                          23/24 
  Running scriptlet: libgcc-8.5.0-3.el8.x86_64                          23/24 
  Running scriptlet: libgomp-8.5.0-3.el8.x86_64                         24/24 
  Cleanup          : libgomp-8.5.0-3.el8.x86_64                         24/24 
  Running scriptlet: libgomp-8.5.0-3.el8.x86_64                         24/24 
  Verifying        : binutils-2.30-108.el8_5.1.x86_64                    1/24 
  Verifying        : glibc-devel-2.28-164.el8.x86_64                     2/24 
  Verifying        : glibc-headers-2.28-164.el8.x86_64                   3/24 
  Verifying        : kernel-headers-4.18.0-348.7.1.el8_5.x86_64          4/24 
  Verifying        : libmetalink-0.1.3-7.el8.x86_64                      5/24 
  Verifying        : libpkgconf-1.4.2-1.el8.x86_64                       6/24 
  Verifying        : libxcrypt-devel-4.1.1-6.el8.x86_64                  7/24 
  Verifying        : make-1:4.2.1-10.el8.x86_64                          8/24 
  Verifying        : pkgconf-1.4.2-1.el8.x86_64                          9/24 
  Verifying        : pkgconf-m4-1.4.2-1.el8.noarch                      10/24 
  Verifying        : pkgconf-pkg-config-1.4.2-1.el8.x86_64              11/24 
  Verifying        : cpp-8.5.0-4.el8_5.x86_64                           12/24 
  Verifying        : gcc-8.5.0-4.el8_5.x86_64                           13/24 
  Verifying        : gcc-c++-8.5.0-4.el8_5.x86_64                       14/24 
  Verifying        : isl-0.16.1-6.el8.x86_64                            15/24 
  Verifying        : libmpc-1.1.0-9.1.el8.x86_64                        16/24 
  Verifying        : libstdc++-devel-8.5.0-4.el8_5.x86_64               17/24 
  Verifying        : wget-1.19.5-10.el8.x86_64                          18/24 
  Verifying        : libgcc-8.5.0-4.el8_5.x86_64                        19/24 
  Verifying        : libgcc-8.5.0-3.el8.x86_64                          20/24 
  Verifying        : libgomp-8.5.0-4.el8_5.x86_64                       21/24 
  Verifying        : libgomp-8.5.0-3.el8.x86_64                         22/24 
  Verifying        : libstdc++-8.5.0-4.el8_5.x86_64                     23/24 
  Verifying        : libstdc++-8.5.0-3.el8.x86_64                       24/24 

Upgraded:
  libgcc-8.5.0-4.el8_5.x86_64            libgomp-8.5.0-4.el8_5.x86_64        
  libstdc++-8.5.0-4.el8_5.x86_64        
Installed:
  binutils-2.30-108.el8_5.1.x86_64                                            
  cpp-8.5.0-4.el8_5.x86_64                                                    
  gcc-8.5.0-4.el8_5.x86_64                                                    
  gcc-c++-8.5.0-4.el8_5.x86_64                                                
  glibc-devel-2.28-164.el8.x86_64                                             
  glibc-headers-2.28-164.el8.x86_64                                           
  isl-0.16.1-6.el8.x86_64                                                     
  kernel-headers-4.18.0-348.7.1.el8_5.x86_64                                  
  libmetalink-0.1.3-7.el8.x86_64                                              
  libmpc-1.1.0-9.1.el8.x86_64                                                 
  libpkgconf-1.4.2-1.el8.x86_64                                               
  libstdc++-devel-8.5.0-4.el8_5.x86_64                                        
  libxcrypt-devel-4.1.1-6.el8.x86_64                                          
  make-1:4.2.1-10.el8.x86_64                                                  
  pkgconf-1.4.2-1.el8.x86_64                                                  
  pkgconf-m4-1.4.2-1.el8.noarch                                               
  pkgconf-pkg-config-1.4.2-1.el8.x86_64                                       
  wget-1.19.5-10.el8.x86_64                                                   

Complete!
[root@localhost ~]#

apach、apr、apr-util包安装(地址来源:apach.org),apr为httpd的依赖包,apr-util为apr的子包

httpd包下载地址:https://downloads.apache.org/httpd/httpd-2.4.54.tar.gz

apr包下载地址:https://downloads.apache.org/apr/apr-1.7.0.tar.gz

apr-util包下载地址:https://downloads.apache.org/apr/apr-util-1.6.1.tar.gz

选择合适路径安装

[root@localhost ~]# cd /usr/src
[root@localhost src]# ls
debug  kernels
[root@localhost src]# wget https://downloads.apache.org/httpd/httpd-2.4.54.tar.gz https://downloads.apache.org/apr/apr-1.7.0.tar.gz https://downloads.apache.org/apr/apr-util-1.6.1.tar.gz
--2022-12-23 18:38:32--  https://downloads.apache.org/httpd/httpd-2.4.54.tar.gz
Resolving downloads.apache.org (downloads.apache.org)... 135.181.214.104, 88.99.95.219, 2a01:4f8:10a:201a::2, ...
Connecting to downloads.apache.org (downloads.apache.org)|135.181.214.104|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 9743277 (9.3M) [application/x-gzip]
Saving to: ‘httpd-2.4.54.tar.gz’

httpd-2.4.54.tar.gz 100%[=================>]   9.29M   753KB/s    in 15s     

2022-12-23 18:38:49 (633 KB/s) - ‘httpd-2.4.54.tar.gz’ saved [9743277/9743277]

--2022-12-23 18:38:49--  https://downloads.apache.org/apr/apr-1.7.0.tar.gz
Reusing existing connection to downloads.apache.org:443.
HTTP request sent, awaiting response... 200 OK
Length: 1093896 (1.0M) [application/x-gzip]
Saving to: ‘apr-1.7.0.tar.gz’

apr-1.7.0.tar.gz    100%[=================>]   1.04M   488KB/s    in 2.2s    

2022-12-23 18:38:51 (488 KB/s) - ‘apr-1.7.0.tar.gz’ saved [1093896/1093896]

--2022-12-23 18:38:51--  https://downloads.apache.org/apr/apr-util-1.6.1.tar.gz
Reusing existing connection to downloads.apache.org:443.
HTTP request sent, awaiting response... 200 OK
Length: 554301 (541K) [application/x-gzip]
Saving to: ‘apr-util-1.6.1.tar.gz’

apr-util-1.6.1.tar. 100%[=================>] 541.31K   187KB/s    in 2.9s    

2022-12-23 18:38:54 (187 KB/s) - ‘apr-util-1.6.1.tar.gz’ saved [554301/554301]

FINISHED --2022-12-23 18:38:54--
Total wall clock time: 22s
Downloaded: 3 files, 11M in 20s (553 KB/s)
[root@localhost src]# ls
apr-1.7.0.tar.gz  apr-util-1.6.1.tar.gz  debug  httpd-2.4.54.tar.gz  kernels
[root@localhost src]#

 其他环境所需要的:openssl-devel、pcre-devel、expat-devel、libtool

[root@localhost src]# yum -y install openssl-devel pcre-devel expat-devel libtool
Last metadata expiration check: 0:28:43 ago on Fri 23 Dec 2022 06:21:33 PM CST.
Dependencies resolved.
==============================================================================
 Package                Arch   Version                        Repo       Size
==============================================================================
Installing:
 expat-devel            x86_64 2.2.5-4.el8                    base       55 k
 libtool                x86_64 2.4.6-25.el8                   AppStream 709 k
 openssl-devel          x86_64 1:1.1.1k-5.el8_5               base      2.3 M
 pcre-devel             x86_64 8.42-6.el8                     base      551 k
Upgrading:
 openssl                x86_64 1:1.1.1k-5.el8_5               base      709 k
 openssl-libs           x86_64 1:1.1.1k-5.el8_5               base      1.5 M
Installing dependencies:
 autoconf               noarch 2.69-29.el8                    AppStream 710 k
 automake               noarch 1.16.1-7.el8                   AppStream 713 k
 emacs-filesystem       noarch 1:26.1-7.el8                   base       70 k
 keyutils-libs-devel    x86_64 1.5.10-9.el8                   base       48 k
 krb5-devel             x86_64 1.18.2-14.el8                  base      560 k
 libcom_err-devel       x86_64 1.45.6-2.el8                   base       38 k
 libkadm5               x86_64 1.18.2-14.el8                  base      187 k
 libselinux-devel       x86_64 2.9-5.el8                      base      200 k
 libsepol-devel         x86_64 2.9-3.el8                      base       87 k
 libverto-devel         x86_64 0.3.0-5.el8                    base       18 k
 m4                     x86_64 1.4.18-7.el8                   base      223 k
 pcre-cpp               x86_64 8.42-6.el8                     base       47 k
 pcre-utf16             x86_64 8.42-6.el8                     base      195 k
 pcre-utf32             x86_64 8.42-6.el8                     base      186 k
 pcre2-devel            x86_64 10.32-2.el8                    base      605 k
 pcre2-utf16            x86_64 10.32-2.el8                    base      229 k
 pcre2-utf32            x86_64 10.32-2.el8                    base      220 k
 perl-Carp              noarch 1.42-396.el8                   base       30 k
 perl-Data-Dumper       x86_64 2.167-399.el8                  base       58 k
 perl-Digest            noarch 1.17-395.el8                   AppStream  27 k
 perl-Digest-MD5        x86_64 2.55-396.el8                   AppStream  37 k
 perl-Encode            x86_64 4:2.97-3.el8                   base      1.5 M
 perl-Errno             x86_64 1.28-420.el8                   base       76 k
 perl-Exporter          noarch 5.72-396.el8                   base       34 k
 perl-File-Path         noarch 2.15-2.el8                     base       38 k
 perl-File-Temp         noarch 0.230.600-1.el8                base       63 k
 perl-Getopt-Long       noarch 1:2.50-4.el8                   base       63 k
 perl-HTTP-Tiny         noarch 0.074-1.el8                    base       58 k
 perl-IO                x86_64 1.38-420.el8                   base      142 k
 perl-MIME-Base64       x86_64 3.15-396.el8                   base       31 k
 perl-Net-SSLeay        x86_64 1.88-1.module_el8.3.0+410+ff426aa3
                                                              AppStream 379 k
 perl-PathTools         x86_64 3.74-1.el8                     base       90 k
 perl-Pod-Escapes       noarch 1:1.07-395.el8                 base       20 k
 perl-Pod-Perldoc       noarch 3.28-396.el8                   base       86 k
 perl-Pod-Simple        noarch 1:3.35-395.el8                 base      213 k
 perl-Pod-Usage         noarch 4:1.69-395.el8                 base       34 k
 perl-Scalar-List-Utils x86_64 3:1.49-2.el8                   base       68 k
 perl-Socket            x86_64 4:2.027-3.el8                  base       59 k
 perl-Storable          x86_64 1:3.11-3.el8                   base       98 k
 perl-Term-ANSIColor    noarch 4.06-396.el8                   base       46 k
 perl-Term-Cap          noarch 1.17-395.el8                   base       23 k
 perl-Text-ParseWords   noarch 3.30-395.el8                   base       18 k
 perl-Text-Tabs+Wrap    noarch 2013.0523-395.el8              base       24 k
 perl-Thread-Queue      noarch 3.13-1.el8                     AppStream  24 k
 perl-Time-Local        noarch 1:1.280-1.el8                  base       34 k
 perl-URI               noarch 1.73-3.el8                     AppStream 116 k
 perl-Unicode-Normalize x86_64 1.25-396.el8                   base       82 k
 perl-constant          noarch 1.33-396.el8                   base       25 k
 perl-interpreter       x86_64 4:5.26.3-420.el8               base      6.3 M
 perl-libnet            noarch 3.11-3.el8                     AppStream 121 k
 perl-libs              x86_64 4:5.26.3-420.el8               base      1.6 M
 perl-macros            x86_64 4:5.26.3-420.el8               base       72 k
 perl-parent            noarch 1:0.237-1.el8                  base       20 k
 perl-podlators         noarch 4.11-1.el8                     base      118 k
 perl-threads           x86_64 1:2.21-2.el8                   base       61 k
 perl-threads-shared    x86_64 1.58-2.el8                     base       48 k
 zlib-devel             x86_64 1.2.11-17.el8                  base       58 k
Installing weak dependencies:
 perl-IO-Socket-IP      noarch 0.39-5.el8                     AppStream  47 k
 perl-IO-Socket-SSL     noarch 2.066-4.module_el8.3.0+410+ff426aa3
                                                              AppStream 298 k
 perl-Mozilla-CA        noarch 20160104-7.module_el8.3.0+416+dee7bcef
                                                              AppStream  15 k
Enabling module streams:
 perl                          5.26                                          
 perl-IO-Socket-SSL            2.066                                         
 perl-libwww-perl              6.34                                          

Transaction Summary
==============================================================================
Install  64 Packages
Upgrade   2 Packages

Total download size: 22 M
Downloading Packages:
(1/66): expat-devel-2.2.5-4.el8.x86_64.rpm    211 kB/s |  55 kB     00:00    
(2/66): emacs-filesystem-26.1-7.el8.noarch.rp 204 kB/s |  70 kB     00:00    
(3/66): libcom_err-devel-1.45.6-2.el8.x86_64. 146 kB/s |  38 kB     00:00    
(4/66): keyutils-libs-devel-1.5.10-9.el8.x86_  57 kB/s |  48 kB     00:00    
(5/66): libkadm5-1.18.2-14.el8.x86_64.rpm     502 kB/s | 187 kB     00:00    
(6/66): krb5-devel-1.18.2-14.el8.x86_64.rpm   783 kB/s | 560 kB     00:00    
(7/66): libverto-devel-0.3.0-5.el8.x86_64.rpm  80 kB/s |  18 kB     00:00    
(8/66): libselinux-devel-2.9-5.el8.x86_64.rpm 515 kB/s | 200 kB     00:00    
(9/66): libsepol-devel-2.9-3.el8.x86_64.rpm   184 kB/s |  87 kB     00:00    
(10/66): m4-1.4.18-7.el8.x86_64.rpm           366 kB/s | 223 kB     00:00    
(11/66): pcre-cpp-8.42-6.el8.x86_64.rpm       113 kB/s |  47 kB     00:00    
(12/66): pcre-utf16-8.42-6.el8.x86_64.rpm     336 kB/s | 195 kB     00:00    
(13/66): pcre-devel-8.42-6.el8.x86_64.rpm     535 kB/s | 551 kB     00:01    
(14/66): pcre-utf32-8.42-6.el8.x86_64.rpm     320 kB/s | 186 kB     00:00    
(15/66): pcre2-utf16-10.32-2.el8.x86_64.rpm   329 kB/s | 229 kB     00:00    
(16/66): pcre2-devel-10.32-2.el8.x86_64.rpm   588 kB/s | 605 kB     00:01    
(17/66): openssl-devel-1.1.1k-5.el8_5.x86_64. 885 kB/s | 2.3 MB     00:02    
(18/66): pcre2-utf32-10.32-2.el8.x86_64.rpm   803 kB/s | 220 kB     00:00    
(19/66): perl-Carp-1.42-396.el8.noarch.rpm    104 kB/s |  30 kB     00:00    
(20/66): perl-Errno-1.28-420.el8.x86_64.rpm   335 kB/s |  76 kB     00:00    
(21/66): perl-Data-Dumper-2.167-399.el8.x86_6 109 kB/s |  58 kB     00:00    
(22/66): perl-Exporter-5.72-396.el8.noarch.rp 170 kB/s |  34 kB     00:00    
(23/66): perl-File-Path-2.15-2.el8.noarch.rpm 181 kB/s |  38 kB     00:00    
(24/66): perl-Getopt-Long-2.50-4.el8.noarch.r 284 kB/s |  63 kB     00:00    
(25/66): perl-File-Temp-0.230.600-1.el8.noarc 154 kB/s |  63 kB     00:00    
(26/66): perl-HTTP-Tiny-0.074-1.el8.noarch.rp 273 kB/s |  58 kB     00:00    
(27/66): perl-IO-1.38-420.el8.x86_64.rpm      747 kB/s | 142 kB     00:00    
(28/66): perl-Encode-2.97-3.el8.x86_64.rpm    1.1 MB/s | 1.5 MB     00:01    
(29/66): perl-MIME-Base64-3.15-396.el8.x86_64 103 kB/s |  31 kB     00:00    
(30/66): perl-Pod-Escapes-1.07-395.el8.noarch 112 kB/s |  20 kB     00:00    
(31/66): perl-PathTools-3.74-1.el8.x86_64.rpm 224 kB/s |  90 kB     00:00    
(32/66): perl-Pod-Perldoc-3.28-396.el8.noarch 235 kB/s |  86 kB     00:00    
(33/66): perl-Pod-Usage-1.69-395.el8.noarch.r 164 kB/s |  34 kB     00:00    
(34/66): perl-Pod-Simple-3.35-395.el8.noarch. 620 kB/s | 213 kB     00:00    
(35/66): perl-Socket-2.027-3.el8.x86_64.rpm   348 kB/s |  59 kB     00:00    
(36/66): perl-Scalar-List-Utils-1.49-2.el8.x8 309 kB/s |  68 kB     00:00    
(37/66): perl-Storable-3.11-3.el8.x86_64.rpm  456 kB/s |  98 kB     00:00    
(38/66): perl-Term-ANSIColor-4.06-396.el8.noa  76 kB/s |  46 kB     00:00    
(39/66): perl-Text-Tabs+Wrap-2013.0523-395.el  93 kB/s |  24 kB     00:00    
(40/66): perl-Text-ParseWords-3.30-395.el8.no  20 kB/s |  18 kB     00:00    
(41/66): perl-Term-Cap-1.17-395.el8.noarch.rp  24 kB/s |  23 kB     00:00    
(42/66): perl-Time-Local-1.280-1.el8.noarch.r 152 kB/s |  34 kB     00:00    
(43/66): perl-Unicode-Normalize-1.25-396.el8. 265 kB/s |  82 kB     00:00    
(44/66): perl-constant-1.33-396.el8.noarch.rp  60 kB/s |  25 kB     00:00    
(45/66): perl-macros-5.26.3-420.el8.x86_64.rp 407 kB/s |  72 kB     00:00    
(46/66): perl-parent-0.237-1.el8.noarch.rpm    54 kB/s |  20 kB     00:00    
(47/66): perl-podlators-4.11-1.el8.noarch.rpm 198 kB/s | 118 kB     00:00    
(48/66): perl-threads-2.21-2.el8.x86_64.rpm   127 kB/s |  61 kB     00:00    
(49/66): perl-threads-shared-1.58-2.el8.x86_6 125 kB/s |  48 kB     00:00    
(50/66): perl-libs-5.26.3-420.el8.x86_64.rpm  661 kB/s | 1.6 MB     00:02    
(51/66): zlib-devel-1.2.11-17.el8.x86_64.rpm  128 kB/s |  58 kB     00:00    
(52/66): autoconf-2.69-29.el8.noarch.rpm      686 kB/s | 710 kB     00:01    
(53/66): automake-1.16.1-7.el8.noarch.rpm     687 kB/s | 713 kB     00:01    
(54/66): perl-Digest-1.17-395.el8.noarch.rpm   72 kB/s |  27 kB     00:00    
(55/66): perl-Digest-MD5-2.55-396.el8.x86_64. 102 kB/s |  37 kB     00:00    
(56/66): libtool-2.4.6-25.el8.x86_64.rpm      697 kB/s | 709 kB     00:01    
(57/66): perl-IO-Socket-IP-0.39-5.el8.noarch. 145 kB/s |  47 kB     00:00    
(58/66): perl-Mozilla-CA-20160104-7.module_el  27 kB/s |  15 kB     00:00    
(59/66): perl-IO-Socket-SSL-2.066-4.module_el 333 kB/s | 298 kB     00:00    
(60/66): perl-interpreter-5.26.3-420.el8.x86_ 1.1 MB/s | 6.3 MB     00:05    
(61/66): perl-Thread-Queue-3.13-1.el8.noarch. 214 kB/s |  24 kB     00:00    
(62/66): perl-Net-SSLeay-1.88-1.module_el8.3. 1.2 MB/s | 379 kB     00:00    
(63/66): perl-libnet-3.11-3.el8.noarch.rpm    414 kB/s | 121 kB     00:00    
(64/66): perl-URI-1.73-3.el8.noarch.rpm       321 kB/s | 116 kB     00:00    
(65/66): openssl-1.1.1k-5.el8_5.x86_64.rpm    716 kB/s | 709 kB     00:00    
(66/66): openssl-libs-1.1.1k-5.el8_5.x86_64.r 1.4 MB/s | 1.5 MB     00:01    
------------------------------------------------------------------------------
Total                                         1.6 MB/s |  22 MB     00:14     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                      1/1 
  Upgrading        : openssl-libs-1:1.1.1k-5.el8_5.x86_64                1/68 
  Running scriptlet: openssl-libs-1:1.1.1k-5.el8_5.x86_64                1/68 
  Installing       : libkadm5-1.18.2-14.el8.x86_64                       2/68 
  Upgrading        : openssl-1:1.1.1k-5.el8_5.x86_64                     3/68 
  Installing       : perl-Digest-1.17-395.el8.noarch                     4/68 
  Installing       : perl-Digest-MD5-2.55-396.el8.x86_64                 5/68 
  Installing       : perl-Data-Dumper-2.167-399.el8.x86_64               6/68 
  Installing       : perl-libnet-3.11-3.el8.noarch                       7/68 
  Installing       : perl-Net-SSLeay-1.88-1.module_el8.3.0+410+ff426a    8/68 
  Installing       : perl-URI-1.73-3.el8.noarch                          9/68 
  Installing       : perl-Pod-Escapes-1:1.07-395.el8.noarch             10/68 
  Installing       : perl-Time-Local-1:1.280-1.el8.noarch               11/68 
  Installing       : perl-IO-Socket-IP-0.39-5.el8.noarch                12/68 
  Installing       : perl-Mozilla-CA-20160104-7.module_el8.3.0+416+de   13/68 
  Installing       : perl-IO-Socket-SSL-2.066-4.module_el8.3.0+410+ff   14/68 
  Installing       : perl-Term-ANSIColor-4.06-396.el8.noarch            15/68 
  Installing       : perl-Term-Cap-1.17-395.el8.noarch                  16/68 
  Installing       : perl-File-Temp-0.230.600-1.el8.noarch              17/68 
  Installing       : perl-Pod-Simple-1:3.35-395.el8.noarch              18/68 
  Installing       : perl-HTTP-Tiny-0.074-1.el8.noarch                  19/68 
  Installing       : perl-podlators-4.11-1.el8.noarch                   20/68 
  Installing       : perl-Pod-Perldoc-3.28-396.el8.noarch               21/68 
  Installing       : perl-Text-ParseWords-3.30-395.el8.noarch           22/68 
  Installing       : perl-Pod-Usage-4:1.69-395.el8.noarch               23/68 
  Installing       : perl-MIME-Base64-3.15-396.el8.x86_64               24/68 
  Installing       : perl-Storable-1:3.11-3.el8.x86_64                  25/68 
  Installing       : perl-Getopt-Long-1:2.50-4.el8.noarch               26/68 
  Installing       : perl-Errno-1.28-420.el8.x86_64                     27/68 
  Installing       : perl-Socket-4:2.027-3.el8.x86_64                   28/68 
  Installing       : perl-Encode-4:2.97-3.el8.x86_64                    29/68 
  Installing       : perl-Exporter-5.72-396.el8.noarch                  30/68 
  Installing       : perl-Scalar-List-Utils-3:1.49-2.el8.x86_64         31/68 
  Installing       : perl-macros-4:5.26.3-420.el8.x86_64                32/68 
  Installing       : perl-parent-1:0.237-1.el8.noarch                   33/68 
  Installing       : perl-Text-Tabs+Wrap-2013.0523-395.el8.noarch       34/68 
  Installing       : perl-Unicode-Normalize-1.25-396.el8.x86_64         35/68 
  Installing       : perl-File-Path-2.15-2.el8.noarch                   36/68 
  Installing       : perl-IO-1.38-420.el8.x86_64                        37/68 
  Installing       : perl-PathTools-3.74-1.el8.x86_64                   38/68 
  Installing       : perl-constant-1.33-396.el8.noarch                  39/68 
  Installing       : perl-threads-1:2.21-2.el8.x86_64                   40/68 
  Installing       : perl-threads-shared-1.58-2.el8.x86_64              41/68 
  Installing       : perl-libs-4:5.26.3-420.el8.x86_64                  42/68 
  Installing       : perl-Carp-1.42-396.el8.noarch                      43/68 
  Installing       : perl-interpreter-4:5.26.3-420.el8.x86_64           44/68 
  Installing       : perl-Thread-Queue-3.13-1.el8.noarch                45/68 
  Installing       : zlib-devel-1.2.11-17.el8.x86_64                    46/68 
  Installing       : pcre2-utf32-10.32-2.el8.x86_64                     47/68 
  Installing       : pcre2-utf16-10.32-2.el8.x86_64                     48/68 
  Installing       : pcre2-devel-10.32-2.el8.x86_64                     49/68 
  Installing       : pcre-utf32-8.42-6.el8.x86_64                       50/68 
  Installing       : pcre-utf16-8.42-6.el8.x86_64                       51/68 
  Installing       : pcre-cpp-8.42-6.el8.x86_64                         52/68 
  Installing       : m4-1.4.18-7.el8.x86_64                             53/68 
  Running scriptlet: m4-1.4.18-7.el8.x86_64                             53/68 
  Installing       : libverto-devel-0.3.0-5.el8.x86_64                  54/68 
  Installing       : libsepol-devel-2.9-3.el8.x86_64                    55/68 
  Installing       : libselinux-devel-2.9-5.el8.x86_64                  56/68 
  Installing       : libcom_err-devel-1.45.6-2.el8.x86_64               57/68 
  Installing       : keyutils-libs-devel-1.5.10-9.el8.x86_64            58/68 
  Installing       : krb5-devel-1.18.2-14.el8.x86_64                    59/68 
  Installing       : emacs-filesystem-1:26.1-7.el8.noarch               60/68 
  Installing       : autoconf-2.69-29.el8.noarch                        61/68 
  Running scriptlet: autoconf-2.69-29.el8.noarch                        61/68 
  Installing       : automake-1.16.1-7.el8.noarch                       62/68 
  Installing       : libtool-2.4.6-25.el8.x86_64                        63/68 
  Running scriptlet: libtool-2.4.6-25.el8.x86_64                        63/68 
  Installing       : openssl-devel-1:1.1.1k-5.el8_5.x86_64              64/68 
  Installing       : pcre-devel-8.42-6.el8.x86_64                       65/68 
  Installing       : expat-devel-2.2.5-4.el8.x86_64                     66/68 
  Cleanup          : openssl-1:1.1.1k-4.el8.x86_64                      67/68 
  Cleanup          : openssl-libs-1:1.1.1k-4.el8.x86_64                 68/68 
  Running scriptlet: openssl-libs-1:1.1.1k-4.el8.x86_64                 68/68 
  Verifying        : emacs-filesystem-1:26.1-7.el8.noarch                1/68 
  Verifying        : expat-devel-2.2.5-4.el8.x86_64                      2/68 
  Verifying        : keyutils-libs-devel-1.5.10-9.el8.x86_64             3/68 
  Verifying        : krb5-devel-1.18.2-14.el8.x86_64                     4/68 
  Verifying        : libcom_err-devel-1.45.6-2.el8.x86_64                5/68 
  Verifying        : libkadm5-1.18.2-14.el8.x86_64                       6/68 
  Verifying        : libselinux-devel-2.9-5.el8.x86_64                   7/68 
  Verifying        : libsepol-devel-2.9-3.el8.x86_64                     8/68 
  Verifying        : libverto-devel-0.3.0-5.el8.x86_64                   9/68 
  Verifying        : m4-1.4.18-7.el8.x86_64                             10/68 
  Verifying        : openssl-devel-1:1.1.1k-5.el8_5.x86_64              11/68 
  Verifying        : pcre-cpp-8.42-6.el8.x86_64                         12/68 
  Verifying        : pcre-devel-8.42-6.el8.x86_64                       13/68 
  Verifying        : pcre-utf16-8.42-6.el8.x86_64                       14/68 
  Verifying        : pcre-utf32-8.42-6.el8.x86_64                       15/68 
  Verifying        : pcre2-devel-10.32-2.el8.x86_64                     16/68 
  Verifying        : pcre2-utf16-10.32-2.el8.x86_64                     17/68 
  Verifying        : pcre2-utf32-10.32-2.el8.x86_64                     18/68 
  Verifying        : perl-Carp-1.42-396.el8.noarch                      19/68 
  Verifying        : perl-Data-Dumper-2.167-399.el8.x86_64              20/68 
  Verifying        : perl-Encode-4:2.97-3.el8.x86_64                    21/68 
  Verifying        : perl-Errno-1.28-420.el8.x86_64                     22/68 
  Verifying        : perl-Exporter-5.72-396.el8.noarch                  23/68 
  Verifying        : perl-File-Path-2.15-2.el8.noarch                   24/68 
  Verifying        : perl-File-Temp-0.230.600-1.el8.noarch              25/68 
  Verifying        : perl-Getopt-Long-1:2.50-4.el8.noarch               26/68 
  Verifying        : perl-HTTP-Tiny-0.074-1.el8.noarch                  27/68 
  Verifying        : perl-IO-1.38-420.el8.x86_64                        28/68 
  Verifying        : perl-MIME-Base64-3.15-396.el8.x86_64               29/68 
  Verifying        : perl-PathTools-3.74-1.el8.x86_64                   30/68 
  Verifying        : perl-Pod-Escapes-1:1.07-395.el8.noarch             31/68 
  Verifying        : perl-Pod-Perldoc-3.28-396.el8.noarch               32/68 
  Verifying        : perl-Pod-Simple-1:3.35-395.el8.noarch              33/68 
  Verifying        : perl-Pod-Usage-4:1.69-395.el8.noarch               34/68 
  Verifying        : perl-Scalar-List-Utils-3:1.49-2.el8.x86_64         35/68 
  Verifying        : perl-Socket-4:2.027-3.el8.x86_64                   36/68 
  Verifying        : perl-Storable-1:3.11-3.el8.x86_64                  37/68 
  Verifying        : perl-Term-ANSIColor-4.06-396.el8.noarch            38/68 
  Verifying        : perl-Term-Cap-1.17-395.el8.noarch                  39/68 
  Verifying        : perl-Text-ParseWords-3.30-395.el8.noarch           40/68 
  Verifying        : perl-Text-Tabs+Wrap-2013.0523-395.el8.noarch       41/68 
  Verifying        : perl-Time-Local-1:1.280-1.el8.noarch               42/68 
  Verifying        : perl-Unicode-Normalize-1.25-396.el8.x86_64         43/68 
  Verifying        : perl-constant-1.33-396.el8.noarch                  44/68 
  Verifying        : perl-interpreter-4:5.26.3-420.el8.x86_64           45/68 
  Verifying        : perl-libs-4:5.26.3-420.el8.x86_64                  46/68 
  Verifying        : perl-macros-4:5.26.3-420.el8.x86_64                47/68 
  Verifying        : perl-parent-1:0.237-1.el8.noarch                   48/68 
  Verifying        : perl-podlators-4.11-1.el8.noarch                   49/68 
  Verifying        : perl-threads-1:2.21-2.el8.x86_64                   50/68 
  Verifying        : perl-threads-shared-1.58-2.el8.x86_64              51/68 
  Verifying        : zlib-devel-1.2.11-17.el8.x86_64                    52/68 
  Verifying        : autoconf-2.69-29.el8.noarch                        53/68 
  Verifying        : automake-1.16.1-7.el8.noarch                       54/68 
  Verifying        : libtool-2.4.6-25.el8.x86_64                        55/68 
  Verifying        : perl-Digest-1.17-395.el8.noarch                    56/68 
  Verifying        : perl-Digest-MD5-2.55-396.el8.x86_64                57/68 
  Verifying        : perl-IO-Socket-IP-0.39-5.el8.noarch                58/68 
  Verifying        : perl-IO-Socket-SSL-2.066-4.module_el8.3.0+410+ff   59/68 
  Verifying        : perl-Mozilla-CA-20160104-7.module_el8.3.0+416+de   60/68 
  Verifying        : perl-Net-SSLeay-1.88-1.module_el8.3.0+410+ff426a   61/68 
  Verifying        : perl-Thread-Queue-3.13-1.el8.noarch                62/68 
  Verifying        : perl-URI-1.73-3.el8.noarch                         63/68 
  Verifying        : perl-libnet-3.11-3.el8.noarch                      64/68 
  Verifying        : openssl-1:1.1.1k-5.el8_5.x86_64                    65/68 
  Verifying        : openssl-1:1.1.1k-4.el8.x86_64                      66/68 
  Verifying        : openssl-libs-1:1.1.1k-5.el8_5.x86_64               67/68 
  Verifying        : openssl-libs-1:1.1.1k-4.el8.x86_64                 68/68 

Upgraded:
  openssl-1:1.1.1k-5.el8_5.x86_64     openssl-libs-1:1.1.1k-5.el8_5.x86_64    
Installed:
  autoconf-2.69-29.el8.noarch                                                 
  automake-1.16.1-7.el8.noarch                                                
  emacs-filesystem-1:26.1-7.el8.noarch                                        
  expat-devel-2.2.5-4.el8.x86_64                                              
  keyutils-libs-devel-1.5.10-9.el8.x86_64                                     
  krb5-devel-1.18.2-14.el8.x86_64                                             
  libcom_err-devel-1.45.6-2.el8.x86_64                                        
  libkadm5-1.18.2-14.el8.x86_64                                               
  libselinux-devel-2.9-5.el8.x86_64                                           
  libsepol-devel-2.9-3.el8.x86_64                                             
  libtool-2.4.6-25.el8.x86_64                                                 
  libverto-devel-0.3.0-5.el8.x86_64                                           
  m4-1.4.18-7.el8.x86_64                                                      
  openssl-devel-1:1.1.1k-5.el8_5.x86_64                                       
  pcre-cpp-8.42-6.el8.x86_64                                                  
  pcre-devel-8.42-6.el8.x86_64                                                
  pcre-utf16-8.42-6.el8.x86_64                                                
  pcre-utf32-8.42-6.el8.x86_64                                                
  pcre2-devel-10.32-2.el8.x86_64                                              
  pcre2-utf16-10.32-2.el8.x86_64                                              
  pcre2-utf32-10.32-2.el8.x86_64                                              
  perl-Carp-1.42-396.el8.noarch                                               
  perl-Data-Dumper-2.167-399.el8.x86_64                                       
  perl-Digest-1.17-395.el8.noarch                                             
  perl-Digest-MD5-2.55-396.el8.x86_64                                         
  perl-Encode-4:2.97-3.el8.x86_64                                             
  perl-Errno-1.28-420.el8.x86_64                                              
  perl-Exporter-5.72-396.el8.noarch                                           
  perl-File-Path-2.15-2.el8.noarch                                            
  perl-File-Temp-0.230.600-1.el8.noarch                                       
  perl-Getopt-Long-1:2.50-4.el8.noarch                                        
  perl-HTTP-Tiny-0.074-1.el8.noarch                                           
  perl-IO-1.38-420.el8.x86_64                                                 
  perl-IO-Socket-IP-0.39-5.el8.noarch                                         
  perl-IO-Socket-SSL-2.066-4.module_el8.3.0+410+ff426aa3.noarch               
  perl-MIME-Base64-3.15-396.el8.x86_64                                        
  perl-Mozilla-CA-20160104-7.module_el8.3.0+416+dee7bcef.noarch               
  perl-Net-SSLeay-1.88-1.module_el8.3.0+410+ff426aa3.x86_64                   
  perl-PathTools-3.74-1.el8.x86_64                                            
  perl-Pod-Escapes-1:1.07-395.el8.noarch                                      
  perl-Pod-Perldoc-3.28-396.el8.noarch                                        
  perl-Pod-Simple-1:3.35-395.el8.noarch                                       
  perl-Pod-Usage-4:1.69-395.el8.noarch                                        
  perl-Scalar-List-Utils-3:1.49-2.el8.x86_64                                  
  perl-Socket-4:2.027-3.el8.x86_64                                            
  perl-Storable-1:3.11-3.el8.x86_64                                           
  perl-Term-ANSIColor-4.06-396.el8.noarch                                     
  perl-Term-Cap-1.17-395.el8.noarch                                           
  perl-Text-ParseWords-3.30-395.el8.noarch                                    
  perl-Text-Tabs+Wrap-2013.0523-395.el8.noarch                                
  perl-Thread-Queue-3.13-1.el8.noarch                                         
  perl-Time-Local-1:1.280-1.el8.noarch                                        
  perl-URI-1.73-3.el8.noarch                                                  
  perl-Unicode-Normalize-1.25-396.el8.x86_64                                  
  perl-constant-1.33-396.el8.noarch                                           
  perl-interpreter-4:5.26.3-420.el8.x86_64                                    
  perl-libnet-3.11-3.el8.noarch                                               
  perl-libs-4:5.26.3-420.el8.x86_64                                           
  perl-macros-4:5.26.3-420.el8.x86_64                                         
  perl-parent-1:0.237-1.el8.noarch                                            
  perl-podlators-4.11-1.el8.noarch                                            
  perl-threads-1:2.21-2.el8.x86_64                                            
  perl-threads-shared-1.58-2.el8.x86_64                                       
  zlib-devel-1.2.11-17.el8.x86_64                                             

Complete!
[root@localhost src]#

解压下载的压缩包

[root@localhost src]# ls
apr-1.7.0.tar.gz  apr-util-1.6.1.tar.gz  debug  httpd-2.4.54.tar.gz  kernels
[root@localhost src]# tar xf apr-1.7.0.tar.gz 
[root@localhost src]# tar xf apr-util-1.6.1.tar.gz 
[root@localhost src]# tar xf httpd-2.4.54.tar.gz 
[root@localhost src]# ls
apr-1.7.0         apr-util-1.6.1         debug         httpd-2.4.54.tar.gz
apr-1.7.0.tar.gz  apr-util-1.6.1.tar.gz  httpd-2.4.54  kernels
[root@localhost src]#

按照顺序依次编译安装:apr --> apr-util --> httpd

编译安装apr:

修改apr的configure脚本文件:删除或者注释 $RM "$cfgfile"这行

配置configure

[root@localhost apr-1.7.0]# ./configure --prefix=/usr/local/apr
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
Configuring APR library
Platform: x86_64-pc-linux-gnu
checking for working mkdir -p... yes
APR Version: 1.7.0
...
...(配置过程省略)

make

[root@localhost apr-1.7.0]# make
make[1]: Entering directory '/usr/src/apr-1.7.0'
/bin/sh /usr/src/apr-1.7.0/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I./include -I/usr/src/apr-1.7.0/include/arch/unix -I./include/arch/unix -I/usr/src/apr-1.7.0/include/arch/unix -I/usr/src/apr-1.7.0/include -I/usr/src/apr-1.7.0/include/private -I/usr/src/apr-1.7.0/include/private  -o encoding/apr_encode.lo -c encoding/apr_encode.c && touch encoding/apr_encode.lo
/usr/src/apr-1.7.0/build/mkdir.sh tools
...
...(过程略)

make install

[root@localhost apr-1.7.0]# make install
make[1]: Entering directory '/usr/src/apr-1.7.0'
make[1]: Nothing to be done for 'local-all'.
make[1]: Leaving directory '/usr/src/apr-1.7.0'
/usr/src/apr-1.7.0/build/mkdir.sh /usr/local/apr/lib /usr/local/apr/bin /usr/local/apr/build-1 \
	     /usr/local/apr/lib/pkgconfig /usr/local/apr/include/apr-1
/usr/bin/install -c -m 644 /usr/src/apr-1.7.0/include/apr.h /usr/local/apr/include/apr-1
for f in /usr/src/apr-1.7.0/include/apr_*.h; do \
    /usr/bin/install -c -m 644 ${f} /usr/local/apr/include/apr-1; \
done
/bin/sh /usr/src/apr-1.7.0/libtool --mode=install /usr/bin/install -c -m 755 libapr-1.la /usr/local/apr/lib
libtool: install: /usr/bin/install -c -m 755 .libs/libapr-1.so.0.7.0 /usr/local/apr/lib/libapr-1.so.0.7.0
libtool: install: (cd /usr/local/apr/lib && { ln -s -f libapr-1.so.0.7.0 libapr-1.so.0 || { rm -f libapr-1.so.0 && ln -s libapr-1.so.0.7.0 libapr-1.so.0; }; })
libtool: install: (cd /usr/local/apr/lib && { ln -s -f libapr-1.so.0.7.0 libapr-1.so || { rm -f libapr-1.so && ln -s libapr-1.so.0.7.0 libapr-1.so; }; })
libtool: install: /usr/bin/install -c -m 755 .libs/libapr-1.lai /usr/local/apr/lib/libapr-1.la
libtool: install: /usr/bin/install -c -m 755 .libs/libapr-1.a /usr/local/apr/lib/libapr-1.a
libtool: install: chmod 644 /usr/local/apr/lib/libapr-1.a
libtool: install: ranlib /usr/local/apr/lib/libapr-1.a
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/sbin" ldconfig -n /usr/local/apr/lib
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/apr/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the 'LD_RUN_PATH' environment variable
     during linking
   - use the '-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to '/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
/usr/bin/install -c -m 644 apr.exp /usr/local/apr/lib/apr.exp
/usr/bin/install -c -m 644 apr.pc /usr/local/apr/lib/pkgconfig/apr-1.pc
for f in libtool shlibtool; do \
    if test -f ${f}; then /usr/bin/install -c -m 755 ${f} /usr/local/apr/build-1; fi; \
done
/usr/bin/install -c -m 755 /usr/src/apr-1.7.0/build/mkdir.sh /usr/local/apr/build-1
for f in make_exports.awk make_var_export.awk; do \
    /usr/bin/install -c -m 644 /usr/src/apr-1.7.0/build/${f} /usr/local/apr/build-1; \
done
/usr/bin/install -c -m 644 build/apr_rules.out /usr/local/apr/build-1/apr_rules.mk
/usr/bin/install -c -m 755 apr-config.out /usr/local/apr/bin/apr-1-config
[root@localhost apr-1.7.0]#

编译安装apr-util

配置configure

[root@localhost src]# cd apr-util-1.6.1
[root@localhost apr-util-1.6.1]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking for working mkdir -p... yes
APR-util Version: 1.6.1
checking for chosen layout... apr-util
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
Applying apr-util hints file rules for x86_64-pc-linux-gnu
checking for APR... yes
  setting CPP to "gcc -E"
  adding "-pthread" to CFLAGS
  setting CPPFLAGS to " -DLINUX -D_REENTRANT -D_GNU_SOURCE"
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for ldap support...
checking for default DBM... sdbm (default)
checking for pg_config... no
checking libpq-fe.h usability... no
checking libpq-fe.h presence... no
checking for libpq-fe.h... no
checking postgresql/libpq-fe.h usability... no
checking postgresql/libpq-fe.h presence... no
checking for postgresql/libpq-fe.h... no
checking sqlite3.h usability... no
checking sqlite3.h presence... no
checking for sqlite3.h... no
checking sqlite.h usability... no
checking sqlite.h presence... no
checking for sqlite.h... no
checking for odbc_config... no
checking sql.h usability... no
checking sql.h presence... no
checking for sql.h... no
checking odbc/sql.h usability... no
checking odbc/sql.h presence... no
checking for odbc/sql.h... no
checking Expat 1.95.x... yes
  setting APRUTIL_EXPORT_LIBS to "-lexpat"
  setting APRUTIL_LIBS to "-lexpat"
checking iconv.h usability... yes
checking iconv.h presence... yes
checking for iconv.h... yes
checking for type of inbuf parameter to iconv... char **
checking for iconv.h... (cached) yes
checking langinfo.h usability... yes
checking langinfo.h presence... yes
checking for langinfo.h... yes
checking for nl_langinfo... yes
checking for CODESET in langinfo.h... yes
checking whether APR has DSO support... yes
checking for library containing crypt... -lcrypt
checking if system crypt() function is threadsafe... no
checking for crypt_r... yes
checking style of crypt_r... struct_crypt_data
checking whether the compiler handles weak symbols... yes
checking for memset_s support... no
checking for explicit_bzero support... yes
  adding "/usr/local/apr/lib/libapr-1.la" to APRUTIL_LIBS
  adding "-lrt" to APRUTIL_LIBS
  adding "-lcrypt" to APRUTIL_LIBS
  adding "-lpthread" to APRUTIL_LIBS
  adding "-ldl" to APRUTIL_LIBS
configure: creating ./config.status
config.status: creating Makefile
config.status: creating export_vars.sh
config.status: creating build/pkg/pkginfo
config.status: creating apr-util.pc
config.status: creating apu-1-config
config.status: creating include/private/apu_select_dbm.h
config.status: creating include/apr_ldap.h
config.status: creating include/apu.h
config.status: creating include/apu_want.h
config.status: creating test/Makefile
config.status: creating include/private/apu_config.h
config.status: executing default commands
[root@localhost apr-util-1.6.1]#

make

[root@localhost apr-util-1.6.1]# make
make[1]: Entering directory '/usr/src/apr-util-1.6.1'
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/src/apr-util-1.6.1/include -I/usr/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o buckets/apr_brigade.lo -c buckets/apr_brigade.c && touch buckets/apr_brigade.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/src/apr-util-1.6.1/include -I/usr/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o buckets/apr_buckets.lo -c buckets/apr_buckets.c && touch buckets/apr_buckets.lo
...
...(剩余过程省略)

make install

[root@localhost apr-util-1.6.1]# make install
make[1]: Entering directory '/usr/src/apr-util-1.6.1'
make[1]: Nothing to be done for 'local-all'.
make[1]: Leaving directory '/usr/src/apr-util-1.6.1'
/usr/local/apr/build-1/mkdir.sh /usr/local/apr-util/include/apr-1 /usr/local/apr-util/lib/pkgconfig \
	     /usr/local/apr-util/lib /usr/local/apr-util/bin
for f in /usr/src/apr-util-1.6.1/include/*.h /usr/src/apr-util-1.6.1/include/*.h; do \
	/usr/bin/install -c -m 644 ${f} /usr/local/apr-util/include/apr-1; \
done
/usr/bin/install -c -m 644 apr-util.pc /usr/local/apr-util/lib/pkgconfig/apr-util-1.pc
list=''; for i in $list; do \
	( cd $i ; make DESTDIR= install ); \
done
/bin/sh /usr/local/apr/build-1/libtool --mode=install /usr/bin/install -c -m 755 libaprutil-1.la /usr/local/apr-util/lib
libtool: install: /usr/bin/install -c -m 755 .libs/libaprutil-1.so.0.6.1 /usr/local/apr-util/lib/libaprutil-1.so.0.6.1
libtool: install: (cd /usr/local/apr-util/lib && { ln -s -f libaprutil-1.so.0.6.1 libaprutil-1.so.0 || { rm -f libaprutil-1.so.0 && ln -s libaprutil-1.so.0.6.1 libaprutil-1.so.0; }; })
libtool: install: (cd /usr/local/apr-util/lib && { ln -s -f libaprutil-1.so.0.6.1 libaprutil-1.so || { rm -f libaprutil-1.so && ln -s libaprutil-1.so.0.6.1 libaprutil-1.so; }; })
libtool: install: /usr/bin/install -c -m 755 .libs/libaprutil-1.lai /usr/local/apr-util/lib/libaprutil-1.la
libtool: install: /usr/bin/install -c -m 755 .libs/libaprutil-1.a /usr/local/apr-util/lib/libaprutil-1.a
libtool: install: chmod 644 /usr/local/apr-util/lib/libaprutil-1.a
libtool: install: ranlib /usr/local/apr-util/lib/libaprutil-1.a
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/sbin" ldconfig -n /usr/local/apr-util/lib
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/apr-util/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the 'LD_RUN_PATH' environment variable
     during linking
   - use the '-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to '/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
/usr/bin/install -c -m 644 aprutil.exp /usr/local/apr-util/lib
/usr/bin/install -c -m 755 apu-config.out /usr/local/apr-util/bin/apu-1-config
[root@localhost apr-util-1.6.1]# 

编译安装httpd

[root@localhost src]# cd httpd-2.4.54
[root@localhost httpd-2.4.54]# ./configure --prefix=/usr/local/apache \
> --sysconfdir=/etc/httpd24 \
> --enable-so \
> --enable-ssl \
> --enable-cgi \
> --enable-rewrite \
> --with-zlib \
> --with-pcre \
> --with-apr=/usr/local/apr \
> --with-apr-util=/usr/local/apr-util/ \
> --enable-modules=most \
> --enable-mpms-shared=all \
> --with-mpm=prefork

(内容省略)

make

[root@localhost httpd-2.4.54]# make
(过程省略)

make install

[root@localhost httpd-2.4.54]# make install
(过程省略)

可以看到/usr/local/目录有apr,apr-util,apache三个目录

[root@localhost ~]# ls /usr/local
apache  apr-util  etc    include  lib64    sbin   src
apr     bin       games  lib      libexec  share
[root@localhost ~]# 

看看apache目录下的内容

[root@localhost ~]# cd /usr/local/apache/
[root@localhost apache]# ls
bin    cgi-bin  htdocs  include  man     modules
build  error    icons   logs     manual
[root@localhost apache]#

有bin目录,我们需要配置环境变量,有include我们需要配置头文件,有man文档我们需要配置日志文件

配置环境变量

[root@localhost ~]# vim /etc/profile.d/apache.sh
[root@localhost ~]# cat /etc/profile.d/apache.sh
export PATH=/usr/local/apache/bin:$PATH
[root@localhost ~]# source /etc/profile.d/apache.sh
[root@localhost ~]# which httpd
/usr/local/apache/bin/httpd
[root@localhost ~]#

配置头文件

[root@localhost ~]# ln -s /usr/local/apache/include /usr/include/apache
[root@localhost ~]# ll /usr/include/apache
lrwxrwxrwx. 1 root root 25 Dec 23 19:43 /usr/include/apache -> /usr/local/apache/include
[root@localhost ~]#

配置日志文件

[root@localhost ~]# vim /etc/man_db.conf

在
MANDATORY_MANPATH                       /usr/man
MANDATORY_MANPATH                       /usr/share/man
MANDATORY_MANPATH                       /usr/local/share/man

后面添加一条

MANDATORY_MANPATH                       /usr/local/apache/man

开启服务

[root@localhost ~]# apachectl start
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain. Set the 'ServerName' directive globally to suppress this message    ##这是一条警告,不影响使用
[root@localhost ~]#

关闭防火墙和selinux

[root@localhost ~]# systemctl disable --now firewalld
Removed /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@localhost ~]# vim /etc/selinux/config
修改
SELINUX=disabled
[root@localhost ~]# getenforce
Enforcing
[root@localhost ~]#

 查看,有个端口号为80的服务,我们已经可使用这台主机地址来访问

[root@localhost ~]# ss -antl
State   Recv-Q  Send-Q     Local Address:Port     Peer Address:Port  Process  
LISTEN  0       128              0.0.0.0:22            0.0.0.0:*              
LISTEN  0       128                    *:80                  *:*              
LISTEN  0       128                 [::]:22               [::]:*              
[root@localhost ~]#

使用地址访问

http://rm3hv1bbp.hn-bkt.clouddn.com/itworks.png

你可能感兴趣的:(apache,服务器,linux)