httpd配置

创建apache用户组

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

下载apr和apr-util和apache

[root@node2 src]# wget https://downloads.apache.org/apr/apr-1.7.0.tar.gz
--2022-12-25 15:25:21--  https://downloads.apache.org/apr/apr-1.7.0.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.
^C
[root@node2 src]# wget https://downloads.apache.org/apr/apr-1.7.0.tar.gz
--2022-12-25 15:26:44--  https://downloads.apache.org/apr/apr-1.7.0.tar.gz
Resolving downloads.apache.org (downloads.apache.org)... 88.99.95.219, 135.181.214.104, 2a01:4f8:10a:201a::2, ...
Connecting to downloads.apache.org (downloads.apache.org)|88.99.95.219|:443... connected.
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  13.8KB/s    in 82s     

2022-12-25 15:28:07 (13.1 KB/s) - ‘apr-1.7.0.tar.gz’ saved [1093896/1093896]

[root@node2 src]# wget https://downloads.apache.org/apr/apr-util-1.6.1.tar.gz
--2022-12-25 15:28:15--  https://downloads.apache.org/apr/apr-util-1.6.1.tar.gz
Resolving downloads.apache.org (downloads.apache.org)... 88.99.95.219, 135.181.214.104, 2a01:4f8:10a:201a::2, ...
Connecting to downloads.apache.org (downloads.apache.org)|88.99.95.219|:443... connected.
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.gz           66%[================================>                 ] 360.00K  11.8KB/s    eta 15s    ^apr-util-1.6.1.tar.gz          100%[=================================================>] 541.31K  12.7KB/s    in 46s     

2022-12-25 15:29:03 (11.8 KB/s) - ‘apr-util-1.6.1.tar.gz’ saved [554301/554301]

[root@node2 src]# wget https://downloads.apache.org/httpd/httpd-2.4.54.tar.gz
--2022-12-25 15:29:24--  https://downloads.apache.org/httpd/httpd-2.4.54.tar.gz
Resolving downloads.apache.org (downloads.apache.org)... 88.99.95.219, 135.181.214.104, 2a01:4f9:3a:2c57::2, ...
Connecting to downloads.apache.org (downloads.apache.org)|88.99.95.219|: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  11.5KB/s    in 13m 3s  

2022-12-25 15:42:29 (12.2 KB/s) - ‘httpd-2.4.54.tar.gz’ saved [9743277/9743277]

[root@node2 src]# 

安装依赖包openssl-devel pcre-devel expat-devel libtool

[root@node2 apr-1.7.0]# yum -y install openssl-devel pcre-devel expat-devel libtool
Last metadata expiration check: 0:33:52 ago on Sun 25 Dec 2022 03:24:03 PM CST.
Dependencies resolved.
=========================================================================================================================
 Package                        Architecture   Version                                           Repository         Size
=========================================================================================================================
Installing:
 expat-devel                    x86_64         2.2.5-4.el8                                       baseos             55 k
 libtool                        x86_64         2.4.6-25.el8                                      appstream         709 k
 openssl-devel                  x86_64         1:1.1.1k-5.el8_5                                  ·
·
·                                                                          
  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@node2 apr-1.7.0]# 

解压apr、apr-util、apache

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

进入apr目录修改文件

[root@node2 src]# cd apr-1.7.0
[root@node2 apr-1.7.0]# ls
apr-config.in  atomic            config.layout  file_io     LICENSE       network_io     README.cmake  time
apr.dep        build             configure      helpers     locks         NOTICE         shmem         tools
apr.dsp        build.conf        configure.in   include     Makefile.in   NWGNUmakefile  strings       user
apr.dsw        buildconf         docs           libapr.dep  Makefile.win  passwd         support
apr.mak        build-outputs.mk  dso            libapr.dsp  memory        poll           tables
apr.pc.in      CHANGES           emacs-mode     libapr.mak  misc          random         test
apr.spec       CMakeLists.txt    encoding       libapr.rc   mmap          README         threadproc 
[root@node2 apr-1.7.0]# vim configure
   $RM "$cfgfile" /删除这一行或者注释
wq /保存退出
[root@node2 apr-1.7.0]# 

安装编译软件

[root@node2 apr-1.7.0]# yum -y install gcc gcc-c++ make
Last metadata expiration check: 0:28:10 ago on Sun 25 Dec 2022 03:24:03 PM CST.
Dependencies resolved.
=========================================================================================================================
 Package                          Architecture         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                      baseos                  498 k
Upgrading:
 libgcc                           x86_64               8.5.0-4.el8_5                       baseos                   79 k
 libgomp                          x86_64               8.5.0-4.el8_5                       baseos                  206 k
 libstdc++                        x86_64               8.5.0-4.el8_5                       baseos                  453 k
Installing dependencies:
 binutils                         x86_64               2.30-108.el8_5.1                    baseos                  5.8 M
 cpp                              x86_64               8.5.0-4.el8_5                       appstream                10 M
 glibc-devel                      x86_64               2.28-164.el8                        baseos                  1.0 M
 glibc-headers                    x86_64               2.28-164.el8                        baseos                  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                baseos                  8.3 M
 libmpc                           x86_64               1.1.0-9.1.el8                       appstream                61 k
 libpkgconf                       x86_64               1.4.2-1.el8                         baseos                   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                         baseos                   25 k
 pkgconf                          x86_64               1.4.2-1.el8                         baseos                   38 k
 pkgconf-m4                       noarch               1.4.2-1.el8                         baseos                   17 k
 pkgconf-pkg-config               x86_64               1.4.2-1.el8                         baseos                   15 k

Transaction Summary
=========================================================================================================================
Install  16 Packages
Upgrade   3 Packages

Total download size: 66 M
Downloading Packages:
(1/19): gcc-c++-8.5.0-4.el8_5.x86_64.rpm                                                 3.4 MB/s |  12 MB     00:03    
(2/19): isl-0.16.1-6.el8.x86_64.rpm                                                      3.0 MB/s | 841 kB     00:00    
(3/19): libmpc-1.1.0-9.1.el8.x86_64.rpm                                                  421 kB/s |  61 kB     00:00    
(4/19): cpp-8.5.0-4.el8_5.x86_64.rpm                                                     2.3 MB/s |  10 MB     00:04    
(5/19): libstdc++-devel-8.5.0-4.el8_5.x86_64.rpm                                         3.4 MB/s | 2.0 MB     00:00    
(6/19): glibc-devel-2.28-164.el8.x86_64.rpm                                              2.5 MB/s | 1.0 MB     00:00    
(7/19): glibc-headers-2.28-164.el8.x86_64.rpm                                            1.7 MB/s | 480 kB     00:00    
(8/19): binutils-2.30-108.el8_5.1.x86_64.rpm                                             2.4 MB/s | 5.8 MB     00:02    
(9/19): libpkgconf-1.4.2-1.el8.x86_64.rpm                                                134 kB/s |  35 kB     00:00    
(10/19): libxcrypt-devel-4.1.1-6.el8.x86_64.rpm                                          156 kB/s |  25 kB     00:00    
(11/19): kernel-headers-4.18.0-348.7.1.el8_5.x86_64.rpm                                  3.9 MB/s | 8.3 MB     00:02    
(12/19): pkgconf-1.4.2-1.el8.x86_64.rpm                                                  244 kB/s |  38 kB     00:00    
(13/19): make-4.2.1-10.el8.x86_64.rpm                                                    1.6 MB/s | 498 kB     00:00    
(14/19): pkgconf-m4-1.4.2-1.el8.noarch.rpm                                               103 kB/s |  17 kB     00:00    
(15/19): pkgconf-pkg-config-1.4.2-1.el8.x86_64.rpm                                        49 kB/s |  15 kB     00:00    
(16/19): libgcc-8.5.0-4.el8_5.x86_64.rpm                                                 342 kB/s |  79 kB     00:00    
(17/19): gcc-8.5.0-4.el8_5.x86_64.rpm                                                    2.9 MB/s |  23 MB     00:08    
(18/19): libgomp-8.5.0-4.el8_5.x86_64.rpm                                                1.0 MB/s | 206 kB     00:00    
(19/19): libstdc++-8.5.0-4.el8_5.x86_64.rpm                                              1.9 MB/s | 453 kB     00:00    
-------------------------------------------------------------------------------------------------------------------------
Total                                                                                    7.9 MB/s |  66 MB     00:08     
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/22 
  Running scriptlet: libgcc-8.5.0-4.el8_5.x86_64                                                                    1/22 
  Upgrading        : libstdc++-8.5.0-4.el8_5.x86_64                                                                 2/22 
  Running scriptlet: libstdc++-8.5.0-4.el8_5.x86_64                                                                 2/22 
  Installing       : libmpc-1.1.0-9.1.el8.x86_64                                                                    3/22 
  Installing       : cpp-8.5.0-4.el8_5.x86_64                                                                       4/22 
  Running scriptlet: cpp-8.5.0-4.el8_5.x86_64                                                                       4/22 
  Installing       : libstdc++-devel-8.5.0-4.el8_5.x86_64                                                           5/22 
  Installing       : binutils-2.30-108.el8_5.1.x86_64                                                               6/22 
  Running scriptlet: binutils-2.30-108.el8_5.1.x86_64                                                               6/22 
  Upgrading        : libgomp-8.5.0-4.el8_5.x86_64                                                                   7/22 
  Running scriptlet: libgomp-8.5.0-4.el8_5.x86_64                                                                   7/22 
  Installing       : pkgconf-m4-1.4.2-1.el8.noarch                                                                  8/22 
  Installing       : libpkgconf-1.4.2-1.el8.x86_64                                                                  9/22 
  Installing       : pkgconf-1.4.2-1.el8.x86_64                                                                    10/22 
  Installing       : pkgconf-pkg-config-1.4.2-1.el8.x86_64                                                         11/22 
  Installing       : kernel-headers-4.18.0-348.7.1.el8_5.x86_64                                                    12/22 
  Running scriptlet: glibc-headers-2.28-164.el8.x86_64                                                             13/22 
  Installing       : glibc-headers-2.28-164.el8.x86_64                                                             13/22 
  Installing       : libxcrypt-devel-4.1.1-6.el8.x86_64                                                            14/22 
  Installing       : glibc-devel-2.28-164.el8.x86_64                                                               15/22 
  Running scriptlet: glibc-devel-2.28-164.el8.x86_64                                                               15/22 
  Installing       : isl-0.16.1-6.el8.x86_64                                                                       16/22 
  Running scriptlet: isl-0.16.1-6.el8.x86_64                                                                       16/22 
  Installing       : gcc-8.5.0-4.el8_5.x86_64                                                                      17/22 
  Running scriptlet: gcc-8.5.0-4.el8_5.x86_64                                                                      17/22 
  Installing       : gcc-c++-8.5.0-4.el8_5.x86_64                                                                  18/22 
  Installing       : make-1:4.2.1-10.el8.x86_64                                                                    19/22 
  Running scriptlet: make-1:4.2.1-10.el8.x86_64                                                                    19/22 
  Cleanup          : libstdc++-8.5.0-3.el8.x86_64                                                                  20/22 
  Running scriptlet: libstdc++-8.5.0-3.el8.x86_64                                                                  20/22 
  Cleanup          : libgcc-8.5.0-3.el8.x86_64                                                                     21/22 
  Running scriptlet: libgcc-8.5.0-3.el8.x86_64                                                                     21/22 
  Running scriptlet: libgomp-8.5.0-3.el8.x86_64                                                                    22/22 
  Cleanup          : libgomp-8.5.0-3.el8.x86_64                                                                    22/22 
  Running scriptlet: libgomp-8.5.0-3.el8.x86_64                                                                    22/22 
  Verifying        : cpp-8.5.0-4.el8_5.x86_64                                                                       1/22 
  Verifying        : gcc-8.5.0-4.el8_5.x86_64                                                                       2/22 
  Verifying        : gcc-c++-8.5.0-4.el8_5.x86_64                                                                   3/22 
  Verifying        : isl-0.16.1-6.el8.x86_64                                                                        4/22 
  Verifying        : libmpc-1.1.0-9.1.el8.x86_64                                                                    5/22 
  Verifying        : libstdc++-devel-8.5.0-4.el8_5.x86_64                                                           6/22 
  Verifying        : binutils-2.30-108.el8_5.1.x86_64                                                               7/22 
  Verifying        : glibc-devel-2.28-164.el8.x86_64                                                                8/22 
  Verifying        : glibc-headers-2.28-164.el8.x86_64                                                              9/22 
  Verifying        : kernel-headers-4.18.0-348.7.1.el8_5.x86_64                                                    10/22 
  Verifying        : libpkgconf-1.4.2-1.el8.x86_64                                                                 11/22 
  Verifying        : libxcrypt-devel-4.1.1-6.el8.x86_64                                                            12/22 
  Verifying        : make-1:4.2.1-10.el8.x86_64                                                                    13/22 
  Verifying        : pkgconf-1.4.2-1.el8.x86_64                                                                    14/22 
  Verifying        : pkgconf-m4-1.4.2-1.el8.noarch                                                                 15/22 
  Verifying        : pkgconf-pkg-config-1.4.2-1.el8.x86_64                                                         16/22 
  Verifying        : libgcc-8.5.0-4.el8_5.x86_64                                                                   17/22 
  Verifying        : libgcc-8.5.0-3.el8.x86_64                                                                     18/22 
  Verifying        : libgomp-8.5.0-4.el8_5.x86_64                                                                  19/22 
  Verifying        : libgomp-8.5.0-3.el8.x86_64                                                                    20/22 
  Verifying        : libstdc++-8.5.0-4.el8_5.x86_64                                                                21/22 
  Verifying        : libstdc++-8.5.0-3.el8.x86_64                                                                  22/22 

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  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 

Complete!
[root@node2 apr-1.7.0]# 

配置apr

[root@node2 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
·
·
·
config.status: creating Makefile
config.status: creating include/apr.h
config.status: creating build/apr_rules.mk
config.status: creating build/pkg/pkginfo
config.status: creating apr-1-config
config.status: creating apr.pc
config.status: creating test/Makefile
config.status: creating test/internal/Makefile
config.status: creating include/arch/unix/apr_private.h
config.status: executing libtool commands
config.status: executing default commands
[root@node2 apr-1.7.0]# 

编译apr

[root@node2 apr-1.7.0]# make
·
·
· 
pr_lib.h /usr/src/apr-1.7.0/include/apr_mmap.h /usr/src/apr-1.7.0/include/apr_network_io.h /usr/src/apr-1.7.0/include/apr_perms_set.h /usr/src/apr-1.7.0/include/apr_poll.h /usr/src/apr-1.7.0/include/apr_pools.h /usr/src/apr-1.7.0/include/apr_portable.h /usr/src/apr-1.7.0/include/apr_proc_mutex.h /usr/src/apr-1.7.0/include/apr_random.h /usr/src/apr-1.7.0/include/apr_ring.h /usr/src/apr-1.7.0/include/apr_shm.h /usr/src/apr-1.7.0/include/apr_signal.h /usr/src/apr-1.7.0/include/apr_skiplist.h /usr/src/apr-1.7.0/include/apr_strings.h /usr/src/apr-1.7.0/include/apr_support.h /usr/src/apr-1.7.0/include/apr_tables.h /usr/src/apr-1.7.0/include/apr_thread_cond.h /usr/src/apr-1.7.0/include/apr_thread_mutex.h /usr/src/apr-1.7.0/include/apr_thread_proc.h /usr/src/apr-1.7.0/include/apr_thread_rwlock.h /usr/src/apr-1.7.0/include/apr_time.h /usr/src/apr-1.7.0/include/apr_user.h /usr/src/apr-1.7.0/include/apr_version.h /usr/src/apr-1.7.0/include/apr_want.h > export_vars.c
gcc -E -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  exports.c | grep "ap_hack_" | sed -e 's/^.*[)]\(.*\);$/\1/' >> apr.exp
gcc -E -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  export_vars.c | sed -e 's/^\#[^!]*//' | sed -e '/^$/d' >> apr.exp
sed 's,^\(location=\).*$,\1installed,' < apr-1-config > apr-config.out
sed -e 's,^\(apr_build.*=\).*$,\1/usr/local/apr/build-1,' -e 's,^\(top_build.*=\).*$,\1/usr/local/apr/build-1,' < build/apr_rules.mk > build/apr_rules.out
make[1]: Leaving directory '/usr/src/apr-1.7.0'
[root@node2 apr-1.7.0]# 

安装apr

[root@node2 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@node2 apr-1.7.0]# 

配置 apr-util

[root@node2 apr-util-1.6.1]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr   //依赖于主包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@node2 apr-util-1.6.1]# 

编译apr-util

[root@node2 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
/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_alloc.lo -c buckets/apr_buckets_alloc.c && touch buckets/apr_buckets_alloc.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_eos.lo -c buckets/apr_buckets_eos.c && touch buckets/apr_buckets_eos.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -·
·
·
·
1.6.1/include/private/apr_crypto_internal.h /usr/src/apr-util-1.6.1/include/private/apr_dbd_internal.h /usr/src/apr-util-1.6.1/include/private/apr_dbd_odbc_v2.h /usr/src/apr-util-1.6.1/include/private/apr_dbm_private.h /usr/src/apr-util-1.6.1/include/private/apu_internal.h > export_vars.c
gcc -E -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    exports.c | grep "ap_hack_" | sed -e 's/^.*[)]\(.*\);$/\1/' >> aprutil.exp
gcc -E -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    export_vars.c | sed -e 's/^\#[^!]*//' | sed -e '/^$/d' >> aprutil.exp
sed 's,^\(location=\).*$,\1installed,' < apu-1-config > apu-config.out
make[1]: Leaving directory '/usr/src/apr-util-1.6.1'
[root@node2 apr-util-1.6.1]# 

安装apr-util

[root@node2 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-until/include/apr-1 /usr/local/apr-until/lib/pkgconfig \
	     /usr/local/apr-until/lib /usr/local/apr-until/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-until/include/apr-1; \
done
/usr/bin/install -c -m 644 apr-util.pc /usr/local/apr-until/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-until/lib
libtool: install: /usr/bin/install -c -m 755 .libs/libaprutil-1.so.0.6.1 /usr/local/apr-until/lib/libaprutil-1.so.0.6.1
libtool: install: (cd /usr/local/apr-until/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-until/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-until/lib/libaprutil-1.la
libtool: install: /usr/bin/install -c -m 755 .libs/libaprutil-1.a /usr/local/apr-until/lib/libaprutil-1.a
libtool: install: chmod 644 /usr/local/apr-until/lib/libaprutil-1.a
libtool: install: ranlib /usr/local/apr-until/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-until/lib
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/apr-until/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-until/lib
/usr/bin/install -c -m 755 apu-config.out /usr/local/apr-until/bin/apu-1-config
[root@node2 apr-util-1.6.1]# 

编译httpd

[root@node2 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@node2 httpd-2.4.54]# make

make install

[root@node2 httpd-2.4.54]# make install

查看

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

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值