1. 程式人生 > >Linux學習之 軟體包管理-原始碼包管理-原始碼包與RPM包的區別

Linux學習之 軟體包管理-原始碼包管理-原始碼包與RPM包的區別

Linux原始碼安裝:

一、原始碼包和RPM包的區別

1、原始碼包和RPM包安裝前的區別:

安裝之前的區別:概念上的區別

原始碼包開源 安裝自由 效率更高  安裝慢 容易出錯

rpm 安裝更快,不容易報錯,

安裝之後的區別:安裝位置不同,帶來管理上的區別

rpm 安裝在預設位置

原始碼包自定義位置

2、RPM包安裝位置

是安裝在預設位置中

RPM包預設安裝位置

/etc/

配置檔案安裝目錄
/usr/bin/ 可執行的命令安裝目錄
/usr/lib/ 程式所使用的函式儲存位置
/usr/share/doc 基本的軟體使用手冊儲存位置
/usr/share/man/ 幫助檔案儲存位置

 

 

 

 

 

 

示例:Apache的安裝資訊查詢,如下命令可檢視

[[email protected] ~]# rpm -q httpd
httpd-2.2.15-69.el6.centos.x86_64
[[email protected] ~]# 
[[email protected]
~]# rpm -ql httpd /etc/httpd /etc/httpd/conf /etc/httpd/conf.d /etc/httpd/conf.d/README /etc/httpd/conf.d/welcome.conf /etc/httpd/conf/httpd.conf /etc/httpd/conf/magic /etc/httpd/logs /etc/httpd/modules /etc/httpd/run /etc/logrotate.d/httpd /etc/rc.d/init.d/htcacheclean /etc/rc.d/init.d/httpd /etc/sysconfig/htcacheclean /etc/sysconfig/httpd /usr/lib64/httpd /usr/lib64/httpd/modules /usr/lib64/httpd/modules/mod_actions.so /usr/lib64/httpd/modules/mod_alias.so /usr/lib64/httpd/modules/mod_asis.so /usr/lib64/httpd/modules/mod_auth_basic.so /usr/lib64/httpd/modules/mod_auth_digest.so /usr/lib64/httpd/modules/mod_authn_alias.so /usr/lib64/httpd/modules/mod_authn_anon.so /usr/lib64/httpd/modules/mod_authn_dbd.so /usr/lib64/httpd/modules/mod_authn_dbm.so

3)原始碼包安裝位置

安裝在指定位置當中,一般是

/usr/local/軟體名/

比如原始碼包安裝位置不同,Apache 原始碼包一般安裝在/usr/local/httpd下

4)安裝位置不同帶來的影響

RPM 包安裝的服務可以使用系統服務管理命令(service)來管理,例如

RPM包安裝的Apache 的啟動方法是:

方法一: /etc/rc.d/init.d/httpd  start

方法二:/service httpd start

方法三:  快捷方式(後續shell命令中介紹)

所說的管理,主要的就是啟動 停止 暫停等

[[email protected] init.d]# service httpd start
正在啟動 httpd:httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName
                                                           [確定]
[[email protected] init.d]# 

以上bug後續解決

如下為rpm 安裝的軟體,可以通過service 命令執行的服務,比如

[[email protected] ~]# cd /etc/rc
rc          rc1.d/      rc3.d/      rc5.d/      rc.d/       rc.sysinit  
rc0.d/      rc2.d/      rc4.d/      rc6.d/      rc.local    
[[email protected] ~]# cd /etc/rc.d/init.d/
[[email protected] init.d]# lls
-bash: lls: command not found
[[email protected] init.d]# ls
abrt-ccpp         crond         irqbalance      nfs           rdisc        single
abrtd             cups          kdump           nfslock       rdma         smartd
abrt-oops         dnsmasq       killall         nfs-rdma      restorecond  spice-vdagentd
acpid             firstboot     lvm2-lvmetad    ntpd          rngd         sshd
atd               functions     lvm2-monitor    ntpdate       rpcbind      sssd
auditd            haldaemon     mdmonitor       oddjobd       rpcgssd      sysstat
autofs            halt          messagebus      portreserve   rpcidmapd    udev-post
blk-availability  htcacheclean  netconsole      postfix       rpcsvcgssd   wdaemon
bluetooth         httpd         netfs           pppoe-server  rsyslog      winbind
certmonger        ip6tables     network         psacct        sandbox      wpa_supplicant
cpuspeed          iptables      NetworkManager  quota_nld     saslauthd    ypbind
[[email protected] init.d]# 

上方ls列出的服務都可以通過service  服務直接管理

示例:

[[email protected] init.d]# service httpd start
正在啟動 httpd:httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName
                                                           [確定]
[[email protected] init.d]# 

以上bug後續解決

6)service 命令 Red  Hat系列專有的,其他Linux可能沒有

7)因為服務管理命令,比如service、config 命令等只會搜尋固定的檔案,無法搜尋到使用者原始碼包自定義安裝的位置,所以服務找不到相應的管理命令,相應地也就無法管理原始碼包安裝的檔案

 

而原始碼包安裝的服務則不能被服務管理命令管理,因為沒有安裝到預設路徑中。

所以只能用絕對路徑進行服務的管理,如:

方法:  /usr/local/apache2/bin/apache  start

 

二、原始碼包安裝過程

1、安裝準備

1)安裝C語言編輯器

[[email protected] init.d]# rpm -q gcc
gcc-4.4.7-23.el6.x86_64

2)下載原始碼包:http://mirrot.bit.edu.cn/apache/httpd/

檢視當前是否已經安裝httpd

[[email protected] init.d]# rpm -q httpd
httpd-2.2.15-69.el6.centos.x86_64

如此表示已經安裝過,

那如果已經通過rpm包安裝軟體的方式安裝過,是否可以再次安裝,也就是是否可以同時安裝兩個httpd?

答案:是的。因為Linux中rpm安裝包安裝軟體的位置和通過原始碼包安裝的位置不同,不像Windows,所以,可以同時安裝兩個。

2、安裝注意事項

1)原始碼儲存位置:/usr/local/src/

 

2)軟體安裝位置:/usr/local/             類似於Windows的program files資料夾

3)如何確定安裝過程報錯:

  》安裝過程停止,必須是停止時的警告等提示,才算錯誤,一般一旦出錯,很難解決

 》並出現error、warning或no提示

3、原始碼包安裝過程:

1)下載原始碼包,可以在Windows中下載好後,通過跨系統軟體傳輸方式,傳輸到Linux軟體中,比如Windows cp  wcp

2)解壓縮下載的原始碼包

進入Linux中剛下載的httpd原始碼包軟體包所在目錄
[[email protected] httpd-2.4.37]# cd /root/下載/
[[email protected] 下載]# ls

CentOS-6.10-x86_64-bin-DVD1 httpd-2.4.37.tar.bz2
[[email protected] 下載]# 
解壓

[[email protected] 下載]# tar -jxvf httpd-2.4.37.tar.bz2 

httpd-2.4.37/docs/manual/urlmapping.html
httpd-2.4.37/buildconf
httpd-2.4.37/Makefile.in
httpd-2.4.37/srclib/
httpd-2.4.37/srclib/Makefile.in
檢視當前目錄
[[email protected] 下載]# ls
CentOS-6.10-x86_64-bin-DVD1  httpd-2.4.37  httpd-2.4.37.tar.bz2

3)進入解壓縮目錄

進入到解壓後的目錄中
[[email protected] 下載]# cd httpd-2.4.37
[[email protected] httpd-2.4.37]# cd ..
[[email protected] 下載]# do -sh httpd-2.4.37
-bash: syntax error near unexpected token `do'
[[email protected] 下載]# cd httpd-2.4.37
[[email protected] httpd-2.4.37]# ls
ABOUT_APACHE     BuildBin.dsp    emacs-style     LAYOUT        NOTICE            srclib
acinclude.m4     buildconf       httpd.dep       libhttpd.dep  NWGNUmakefile     support
Apache-apr2.dsw  CHANGES         httpd.dsp       libhttpd.dsp  os                test
Apache.dsw       CMakeLists.txt  httpd.mak       libhttpd.mak  README            VERSIONING
apache_probes.d  config.layout   httpd.spec      LICENSE       README.cmake
ap.d             configure       include         Makefile.in   README.platforms
build            configure.in    INSTALL         Makefile.win  ROADMAP
BuildAll.dsp     docs            InstallBin.dsp  modules       server

4)如果遇到一個陌生的軟體安裝包,先檢視軟體安裝資訊,獲取安裝步驟等。如何獲取,步驟如下:

[[email protected] 下載]# ls
CentOS-6.10-x86_64-bin-DVD1  httpd-2.4.37  httpd-2.4.37.tar.bz2
[[email protected] 下載]# cd httpd-2.4.37
[[email protected] httpd-2.4.37]# ls
ABOUT_APACHE     BuildBin.dsp    emacs-style     LAYOUT        NOTICE            srclib
acinclude.m4     buildconf       httpd.dep       libhttpd.dep  NWGNUmakefile     support
Apache-apr2.dsw  CHANGES         httpd.dsp       libhttpd.dsp  os                test
Apache.dsw       CMakeLists.txt  httpd.mak       libhttpd.mak  README            VERSIONING
apache_probes.d  config.layout   httpd.spec      LICENSE       README.cmake
ap.d             configure       include         Makefile.in   README.platforms
build            configure.in    INSTALL         Makefile.win  ROADMAP
BuildAll.dsp     docs            InstallBin.dsp  modules       server
[[email protected] httpd-2.4.37]# vim README

                        Apache HTTP Server

  What is it?
  -----------

  The Apache HTTP Server is a powerful and flexible HTTP/1.1 compliant
  web server.  Originally designed as a replacement for the NCSA HTTP
  Server, it has grown to be the most popular web server on the
  Internet.  As a project of the Apache Software Foundation, the
  developers aim to collaboratively develop and maintain a robust,
  commercial-grade, standards-based server with freely available
  source code.

  The Latest Version
  ------------------

  Details of the latest version can be found on the Apache HTTP
  server project page under http://httpd.apache.org/.

  Documentation
  -------------

  The documentation available as of the date of this release is
  included in HTML format in the docs/manual/ directory.  The most
  up-to-date documentation can be found at
  http://httpd.apache.org/docs/2.4/.

  Installation
  ------------

  Please see the file called INSTALL.  Platform specific notes can be
  found in README.platforms.

  Licensing
  ---------

  Please see the file called LICENSE.

  Cryptographic Software Notice
  -----------------------------

  This distribution may include software that has been designed for use
  with cryptographic software.  The country in which you currently reside
  may have restrictions on the import, possession, use, and/or re-export
  to another country, of encryption software.  BEFORE using any encryption
  software, please check your country's laws, regulations and policies
  concerning the import, possession, or use, and re-export of encryption
  software, to see if this is permitted.  See <http://www.wassenaar.org/>
  for more information.

  The U.S. Government Department of Commerce, Bureau of Industry and
  Security (BIS), has classified this software as Export Commodity
  Control Number (ECCN) 5D002.C.1, which includes information security
  software using or performing cryptographic functions with asymmetric
  algorithms.  The form and manner of this Apache Software Foundation
  distribution makes it eligible for export under the License Exception
  ENC Technology Software Unrestricted (TSU) exception (see the BIS
  Export Administration Regulations, Section 740.13) for both object
  code and source code.

  The following provides more details on the included files that
  may be subject to export controls on cryptographic software:

    Apache httpd 2.0 and later versions include the mod_ssl module under
       modules/ssl/
    for configuring and listening to connections over SSL encrypted
    network sockets by performing calls to a general-purpose encryption
    library, such as OpenSSL or the operating system's platform-specific
    SSL facilities.

    In addition, some versions of apr-util provide an abstract interface
    for symmetrical cryptographic functions that make use of a
    general-purpose encryption library, such as OpenSSL, NSS, or the
    operating system's platform-specific facilities. This interface is
    known as the apr_crypto interface, with implementation beneath the
    /crypto directory. The apr_crypto interface is used by the
    mod_session_crypto module available under
      modules/session
    for optional encryption of session information.

    Some object code distributions of Apache httpd, indicated with the
    word "crypto" in the package name, may include object code for the
    OpenSSL encryption library as distributed in open source form from
    <http://www.openssl.org/source/>.

  The above files are optional and may be removed if the cryptographic
  functionality is not desired or needs to be excluded from redistribution.
  Distribution packages of Apache httpd that include the word "nossl"
  in the package name have been created without the above files and are
  therefore not subject to this notice.

  Contacts
  --------

     o If you want to be informed about new code releases, bug fixes,
       security fixes, general news and information about the Apache server
       subscribe to the apache-announce mailing list as described under
       <http://httpd.apache.org/lists.html#http-announce>

     o If you want freely available support for running Apache please see the
       resources at <http://httpd.apache.org/support.html>

     o If you have a concrete bug report for Apache please see the instructions
       for bug reporting at <http://httpd.apache.org/bug_report.html>

     o If you want to participate in actively developing Apache please
       subscribe to the `[email protected]' mailing list as described at
       <http://httpd.apache.org/lists.html#http-dev>

如何知道軟體如何安裝,可以檢視一般軟體包的INSTALL檔案

[[email protected] httpd-2.4.37]# vim INSTALL 


  APACHE INSTALLATION OVERVIEW

  Quick Start - Unix
  ------------------

  For complete installation documentation, see [ht]docs/manual/install.html or
  http://httpd.apache.org/docs/2.4/install.html

     $ ./configure --prefix=PREFIX
     $ make
     $ make install
     $ PREFIX/bin/apachectl start

     NOTES: * Replace PREFIX with the filesystem path under which
              Apache should be installed.  A typical installation
              might use "/usr/local/apache2" for PREFIX (without the
              quotes).

            * Consider if you want to use a previously installed APR and
              APR-Util (such as those provided with many OSes) or if you
              need to use the APR and APR-Util from the apr.apache.org
              project. If the latter, download the latest versions and
              unpack them to ./srclib/apr and ./srclib/apr-util (no
              version numbers in the directory names) and use
              ./configure's --with-included-apr option. This is required
              if you don't have the compiler which the system APR was
              built with.  It can also be advantageous if you are a
              developer who will be linking your code with Apache or using
              a debugger to step through server code, as it removes the
              possibility of version or compile-option mismatches with APR
              and APR-Util code. As a convenience, prepackaged source-code
              bundles of APR and APR-Util are occasionally also provided
              as a httpd-2.X.X-deps.tar.gz download.

            * If you are a developer building Apache directly from
              Subversion, you will need to run ./buildconf before running
              configure. This script bootstraps the build environment and
              requires Python as well as GNU autoconf and libtool. If you
              build Apache from a release tarball, you don't have to run
              buildconf.

            * If you want to build a threaded MPM (for instance worker)
              on  FreeBSD, be aware that threads do not work well with
              Apache on FreeBSD versions before 5.4-RELEASE. If you wish
              to try a threaded Apache on an earlier version of FreeBSD,
              use the --enable-threads parameter to ./configure in
              addition to the --with-mpm parameter.

            * If you are building directly from Subversion on Mac OS X
              (Darwin), make sure to use GNU Libtool 1.4.2 or newer. All
              recent versions of the developer tools on this platform
              include a sufficiently recent version of GNU Libtool (named
              glibtool, but buildconf knows where to find it).

  For a short impression of what possibilities you have, here is a
  typical example which configures Apache for the installation tree
  /sw/pkg/apache with a particular compiler and flags plus the two
  additional modules mod_rewrite and mod_speling for later loading
  through the DSO mechanism:

     $ CC="pgcc" CFLAGS="-O2" \
     ./configure --prefix=/sw/pkg/apache \
     --enable-rewrite=shared \
     --enable-speling=shared

  The easiest way to find all of the configuration flags for Apache 2.4
  is to run ./configure --help.


  Quick Start - Windows
  ---------------------

  For complete documentation, see manual/platform/windows.html.en or
  <http://httpd.apache.org/docs/2.4/platform/windows.html>


  Postscript
  ----------

  To obtain help with installation problems, please see the resources at
  <http://httpd.apache.org/support.html>

  Thanks for using the Apache HTTP Server, version 2.4.

                                     The Apache Software Foundation
                                     http://www.apache.org/
                                                                          87,38        底端

4)./configure    軟體配置與檢查(編譯前準備)

》定義需要的功能選項

》檢測系統環境是否符合安裝要求

》把定義好的功能選項和檢測系統環境的資訊都寫入Makefile檔案,用於後續的編輯

[email protected] httpd-2.4.37]# ./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/apache2]
  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
                          [PREFIX]

By default, `make install' will install all the files in
`/usr/local/apache2/bin', `/usr/local/apache2/lib' etc.  You can specify
an installation prefix other than `/usr/local/apache2' 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]
  --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:
  --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]
  --enable-layout=LAYOUT
  --enable-dtrace         Enable DTrace probes
  --enable-hook-probes    Enable APR hook probes
  --enable-exception-hook Enable fatal exception hook
  --enable-load-all-modules
                          Load all modules
  --enable-maintainer-mode
                          Turn on debugging and compile time warnings and load
                          all compiled modules
  --enable-debugger-mode  Turn on debugging and compile time warnings and turn
                          off optimization
  --enable-pie            Build httpd as a Position Independent Executable
  --enable-modules=MODULE-LIST
                          Space-separated list of modules to enable | "all" |
                          "most" | "few" | "none" | "reallyall"
  --enable-mods-shared=MODULE-LIST
                          Space-separated list of shared modules to enable |
                          "all" | "most" | "few" | "reallyall"
  --enable-mods-static=MODULE-LIST
                          Space-separated list of static modules to enable |
                          "all" | "most" | "few" | "reallyall"
  --disable-authn-file    file-based authentication control
  --enable-authn-dbm      DBM-based authentication control
  --enable-authn-anon     anonymous user authentication control
  --enable-authn-dbd      SQL-based authentication control
  --enable-authn-socache  Cached authentication control
  --disable-authn-core    core authentication module
  --disable-authz-host    host-based authorization control
  --disable-authz-groupfile
                          'require group' authorization control
  --disable-authz-user    'require user' authorization control
  --enable-authz-dbm      DBM-based authorization control
  --enable-authz-owner    'require file-owner' authorization control
  --enable-authz-dbd      SQL based authorization and Login/Session support
  --disable-authz-core    core authorization provider vector module
  --enable-authnz-ldap    LDAP based authentication
  --enable-authnz-fcgi    FastCGI authorizer-based authentication and
                          authorization
  --disable-access-compat mod_access compatibility
  --disable-auth-basic    basic authentication
  --enable-auth-form      form authentication
  --enable-auth-digest    RFC2617 Digest authentication
  --enable-allowmethods   restrict allowed HTTP methods
  --enable-isapi          isapi extension support
  --enable-file-cache     File cache
  --enable-cache          dynamic file caching. At least one storage
                          management module (e.g. mod_cache_disk) is also
                          necessary.
  --enable-cache-disk     disk caching module
  --enable-cache-socache  shared object caching module
  --enable-socache-shmcb  shmcb small object cache provider
  --enable-socache-dbm    dbm small object cache provider
  --enable-socache-memcache
                          memcache small object cache provider
  --enable-socache-dc     distcache small object cache provider
  --enable-so             DSO capability. This module will be automatically
                          enabled unless you build all modules statically.
  --enable-watchdog       Watchdog module
  --enable-macro          Define and use macros in configuration files
  --enable-dbd            Apache DBD Framework
  --enable-bucketeer      buckets manipulation filter. Useful only for
                          developers and testing purposes.
  --enable-dumpio         I/O dump filter
  --enable-echo           ECHO server
  --enable-example-hooks  Example hook callback handler module
  --enable-case-filter    Example uppercase conversion filter
  --enable-case-filter-in Example uppercase conversion input filter
  --enable-example-ipc    Example of shared memory and mutex usage
  --enable-buffer         Filter Buffering
  --enable-data           RFC2397 data encoder
  --enable-ratelimit      Output Bandwidth Limiting
  --disable-reqtimeout    Limit time waiting for request from client
  --enable-ext-filter     external filter module
  --enable-request        Request Body Filtering
  --enable-include        Server Side Includes
  --disable-filter        Smart Filtering
  --enable-reflector      Reflect request through the output filter stack
  --enable-substitute     response content rewrite-like filtering
  --enable-sed            filter request and/or response bodies through sed
  --disable-charset-lite  character set translation. Enabled by default only
                          on EBCDIC systems.
  --enable-charset-lite   character set translation. Enabled by default only
                          on EBCDIC systems.
  --enable-deflate        Deflate transfer encoding support
  --enable-xml2enc        i18n support for markup filters
  --enable-proxy-html     Fix HTML Links in a Reverse Proxy
  --enable-brotli         Brotli compression support
  --enable-http           HTTP protocol handling. The http module is a basic
                          one that enables the server to function as an HTTP
                          server. It is only useful to disable it if you want
                          to use another protocol module instead. Don't
                          disable this module unless you are really sure what
                          you are doing. Note: This module will always be
                          linked statically.
  --disable-mime          mapping of file-extension to MIME. Disabling this
                          module is normally not recommended.
  --enable-ldap           LDAP caching and connection pooling services
  --disable-log-config    logging configuration. You won't be able to log
                          requests to the server without this module.
  --enable-log-debug      configurable debug logging
  --enable-log-forensic   forensic logging
  --enable-logio          input and output logging
  --enable-lua            Apache Lua Framework
  --enable-luajit         Enable LuaJit Support
  --disable-env           clearing/setting of ENV vars
  --enable-mime-magic     automagically determining MIME type
  --enable-cern-meta      CERN-type meta files
  --enable-expires        Expires header control
  --disable-headers       HTTP header control
  --enable-ident          RFC 1413 identity check
  --enable-usertrack      user-session tracking
  --enable-unique-id      per-request unique ids
  --disable-setenvif      basing ENV vars on headers
  --disable-version       determining httpd version in config files
  --enable-remoteip       translate header contents to an apparent client
                          remote_ip
  --enable-proxy          Apache proxy module
  --enable-proxy-connect  Apache proxy CONNECT module. Requires
                          --enable-proxy.
  --enable-proxy-ftp      Apache proxy FTP module. Requires --enable-proxy.
  --enable-proxy-http     Apache proxy HTTP module. Requires --enable-proxy.
  --enable-proxy-fcgi     Apache proxy FastCGI module. Requires
                          --enable-proxy.
  --enable-proxy-scgi     Apache proxy SCGI module. Requires --enable-proxy.
  --enable-proxy-uwsgi    Apache proxy UWSGI module. Requires --enable-proxy.
  --enable-proxy-fdpass   Apache proxy to Unix Daemon Socket module. Requires
                          --enable-proxy.
  --enable-proxy-wstunnel Apache proxy Websocket Tunnel module. Requires
                          --enable-proxy.
  --enable-proxy-ajp      Apache proxy AJP module. Requires --enable-proxy.
  --enable-proxy-balancer Apache proxy BALANCER module. Requires
                          --enable-proxy.
  --enable-proxy-express  mass reverse-proxy module. Requires --enable-proxy.
  --enable-proxy-hcheck   reverse-proxy health-check module. Requires
                          --enable-proxy and --enable-watchdog.
  --enable-session        session module
  --enable-session-cookie session cookie module
  --enable-session-crypto session crypto module
  --enable-session-dbd    session dbd module
  --enable-slotmem-shm    slotmem provider that uses shared memory
  --enable-slotmem-plain  slotmem provider that uses plain memory
  --enable-ssl            SSL/TLS support (mod_ssl)
  --enable-ssl-staticlib-deps
                          link mod_ssl with dependencies of OpenSSL's static
                          libraries (as indicated by "pkg-config --static").
                          Must be specified in addition to --enable-ssl.
  --enable-optional-hook-export
                          example optional hook exporter
  --enable-optional-hook-import
                          example optional hook importer
  --enable-optional-fn-import
                          example optional function importer
  --enable-optional-fn-export
                          example optional function exporter
  --enable-dialup         rate limits static files to dialup modem speeds
  --enable-static-support Build a statically linked version of the support
                          binaries
  --enable-static-htpasswd
                          Build a statically linked version of htpasswd
  --enable-static-htdigest
                          Build a statically linked version of htdigest
  --enable-static-rotatelogs
                          Build a statically linked version of rotatelogs
  --enable-static-logresolve
                          Build a statically linked version of logresolve
  --enable-static-htdbm   Build a statically linked version of htdbm
  --enable-static-ab      Build a statically linked version of ab
  --enable-static-checkgid
                          Build a statically linked version of checkgid
  --enable-static-htcacheclean
                          Build a statically linked version of htcacheclean
  --enable-static-httxt2dbm
                          Build a statically linked version of httxt2dbm
  --enable-static-fcgistarter
                          Build a statically linked version of fcgistarter
  --enable-http2          HTTP/2 protocol handling in addition to HTTP
                          protocol handling. Implemented by mod_http2. This
                          module requires a libnghttp2 installation. See
                          --with-nghttp2 on how to manage non-standard
                          locations. This module is usually linked shared and
                          requires loading.
  --enable-nghttp2-staticlib-deps
                          link mod_http2 with dependencies of libnghttp2's
                          static libraries (as indicated by "pkg-config
                          --static"). Must be specified in addition to
                          --enable-http2.
  --enable-proxy-http2    HTTP/2 proxy module. This module requires a
                          libnghttp2 installation. See --with-nghttp2 on how
                          to manage non-standard locations. Also requires
                          --enable-proxy.
  --enable-md             Managed Domain handling
  --enable-jansson-staticlib-deps
                          link mod_md with dependencies of libjansson's static
                          libraries (as indicated by "pkg-config --static").
                          Must be specified in addition to --enable-md.
  --enable-curl-staticlib-deps
                          link mod_md with dependencies of libcurl's static
                          libraries (as indicated by "pkg-config --static").
                          Must be specified in addition to --enable-md.
  --enable-lbmethod-byrequests
                          Apache proxy Load balancing by request counting
  --enable-lbmethod-bytraffic
                          Apache proxy Load balancing by traffic counting
  --enable-lbmethod-bybusyness
                          Apache proxy Load balancing by busyness
  --enable-lbmethod-heartbeat
                          Apache proxy Load balancing from Heartbeats
  --enable-mpms-shared=MPM-LIST
                          Space-separated list of MPM modules to enable for
                          dynamic loading. MPM-LIST=list | "all"
  --enable-unixd          unix specific support
  --enable-privileges     Per-virtualhost Unix UserIDs and enhanced security
                          for Solaris
  --enable-heartbeat      Generates Heartbeats
  --enable-heartmonitor   Collects Heartbeats
  --enable-dav            WebDAV protocol handling. --enable-dav also enables
                          mod_dav_fs
  --disable-status        process/thread monitoring
  --disable-autoindex     directory listing
  --enable-asis           as-is filetypes
  --enable-info           server information
  --enable-suexec         set uid and gid for spawned processes
  --enable-cgid           CGI scripts. Enabled by default with threaded MPMs
  --enable-cgi            CGI scripts. Enabled by default with non-threaded
                          MPMs
  --enable-dav-fs         DAV provider for the filesystem. --enable-dav also
                          enables mod_dav_fs.
  --enable-dav-lock       DAV provider for generic locking
  --enable-vhost-alias    mass virtual hosting module
  --enable-negotiation    content negotiation
  --disable-dir           directory request handling
  --enable-imagemap       server-side imagemaps
  --enable-actions        Action triggering on requests
  --enable-speling        correct common URL misspellings
  --enable-userdir        mapping of requests to user-specific directories
  --disable-alias         mapping of requests to different filesystem parts
  --enable-rewrite        rule based URL manipulation
  --enable-suexec-capabilities
                          Use Linux capability bits not setuid root suexec
  --enable-v4-mapped      Allow IPv6 sockets to handle IPv4 connections

Optional Packages:
  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
  --with-included-apr     Use bundled copies of APR/APR-Util
  --with-apr=PATH         prefix for installed APR or the full path to
                             apr-config
  --with-apr-util=PATH    prefix for installed APU or the full path to
                             apu-config
  --with-pcre=PATH        Use external PCRE library
  --with-port=PORT        Port on which to listen (default is 80)
  --with-sslport=SSLPORT  Port on which to securelisten (default is 443)
  --with-distcache=PATH   Distcache installation directory
  --with-z=PATH           use a specific zlib library
  --with-libxml2=PATH     location for libxml2
  --with-brotli=PATH      Brotli installation directory
  --with-lua=PATH         Path to the Lua 5.3/5.2/5.1 prefix
  --with-ssl=PATH         OpenSSL installation directory
  --with-nghttp2=PATH     nghttp2 installation directory
  --with-jansson=PATH     jansson installation directory
  --with-curl=PATH        curl installation directory
  --with-mpm=MPM          Choose the process model for Apache to use by
                          default. MPM={event|worker|prefork|winnt} This will
                          be statically linked as the only available MPM
                          unless --enable-mpms-shared is also specified.
  --with-module=module-type:module-file
                          Enable module-file in the modules/<module-type>
                          directory.
  --with-program-name     alternate executable name
  --with-suexec-bin       Path to suexec binary
  --with-suexec-caller    User allowed to call SuExec
  --with-suexec-userdir   User subdirectory
  --with-suexec-docroot   SuExec root directory
  --with-suexec-uidmin    Minimal allowed UID
  --with-suexec-gidmin    Minimal allowed GID
  --with-suexec-logfile   Set the logfile
  --with-suexec-syslog    Use syslog for suexec logging
  --with-suexec-safepath  Set the safepath
  --with-suexec-umask     umask for suexec'd process

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

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.

可見,Apache可定義的安裝配置幫助資訊如此之多

[[email protected] httpd-2.4.37]# ./configure --prefix=/usr/local/apache2
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
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
configure: 
configure: Configuring Apache Portable Runtime library...
configure: 
checking for APR... configure: WARNING: APR version 1.4.0 or later is required, found 1.3.9
configure: WARNING: skipped APR at apr-1-config, version not acceptable
no
configure: error: APR not found.  Please read the documentation.
[[email protected] httpd-2.4.37]# rpm -q A
ABOUT_APACHE     Apache-apr2.dsw  Apache.dsw       
[[email protected] httpd-2.4.37]# 
如上可見已經發生錯誤,如何解決呢?百度

如上,安裝前的配置檢查資訊發生錯誤表示某個軟體未安裝成功,所以,如果網路yum源如果設定ok的話,可以提前安裝好相應軟體,再繼續執行該步驟。此處時間問題,決定暫時放棄查詢解決的辦法。

 

如果未報錯,正確執行,

5)編譯  :make 

編譯,呼叫gcc,把原始碼包翻譯成機器語言,耗時最長,安裝過程不用看,只要看最後停止時是否有報錯資訊,沒有,則表示正常執行

6)make install   編譯安裝,該句表示安裝,如果這句命令未執行,系統都不會在安裝目錄下寫任何內容

也就是說,如果./configure 和make命令出錯,不需要解除安裝命令,只需要make  clean 即可清空之前的操作,無任何垃圾產生

   如果make install  

7)啟動服務

命令:

PREFIX/bin/apachectl start

注:正常生產伺服器不會安裝兩個同樣的軟體,此處只是為學習不同軟體安裝包的安裝方式