Installieren Sie Apache 2.4.46 von der Quelle unter CentOS 7

Einführung

Dies ist der Verlauf der Installation von Apache 2.4.46 aus dem Quellcode unter CentOS7. Gelegentlich habe ich versucht, es von der Quelle zu installieren.

Umgebung

# cat /etc/centos-release
CentOS Linux release 7.7.1908 (Core)

Installation

Quelle herunterladen

# cd /usr/local/src/
# curl -OL https://ftp.jaist.ac.jp/pub/apache//httpd/httpd-2.4.46.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   338  100   338    0     0    789      0 --:--:-- --:--:-- --:--:--   812
100 9143k  100 9143k    0     0  9108k      0  0:00:01  0:00:01 --:--:-- 50.1M

# ls
httpd-2.4.46.tar.gz

Einsatz

# tar zxf httpd-2.4.46.tar.gz
# ls
httpd-2.4.46  httpd-2.4.46.tar.gz

Konfigurieren ausführen

# cd httpd-2.4.46/
# ./configure
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... no
configure: error: APR not found.  Please read the documentation.

Da ein Fehler auftritt, werde ich gebeten, das Dokument vorerst anzusehen. Schauen Sie sich also das Dokument an

# ls
ABOUT_APACHE     ap.d          CHANGES         configure     httpd.dsp   InstallBin.dsp  LICENSE       NWGNUmakefile     ROADMAP  VERSIONING
acinclude.m4     build         CMakeLists.txt  configure.in  httpd.mak   LAYOUT          Makefile.in   os                server
Apache-apr2.dsw  BuildAll.dsp  config.layout   docs          httpd.spec  libhttpd.dep    Makefile.win  README            srclib
Apache.dsw       BuildBin.dsp  config.log      emacs-style   include     libhttpd.dsp    modules       README.cmake      support
apache_probes.d  buildconf     config.nice     httpd.dep     INSTALL     libhttpd.mak    NOTICE        README.platforms  test

Überprüfen Sie die README-Datei

# cat README
<~ Ausgelassen ~>
  Installation
  ------------

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

Meinen Sie README.platforms? Versuche zu denken

# cat README.platforms

                          Apache HTTP Server

  Platform specific notes:
  ------------------------

================
  Darwin (OS X):
   Apache 2 relies heavily on the use of autoconf and libtool to
   provide a build environment.  Darwin provides these tools as part
   of the Developers Tools package. Under Darwin, however, GNUlibtool
   is installed as 'glibtool' to avoid conflicting with the Darwin
   'libtool' program.  Apache 2 knows about this so that's not a
   problem.

   As of OS X 10.2 (Jaguar), the bundled versions work perfectly. Partly
   this is due to the fact that /bin/sh is now 'bash' and not 'zsh' as
   well as the fact that the bundled versions are up-to-date:
   autoconf 2.52 and (g)libtool 1.4.2.

   You will note that GNU libtool should actually be installed as
   glibtool, to avoid conflict with a Darwin program of the same
   name.

   There have been some reports that autoconf 2.52 prevents Apache's
   build system from correctly handling passing multi-value envvars
   to the build system (eg: CFLAGS="-g -O3" ./configure),  causing
   errors.  Use of bash does not seem to help in this situation.  If
   this affects you, downgrading to autoconf 2.13 (which is installed
   on Darwin) will help.

   With Leopard (at least up to 10.5.2), when running configure
   you will likely see errors such as:

      rm: conftest.dSYM: is a directory

   This is a known issue and will be fixed in a later version of the
   autoconf suite. These errors can be safely ignored.

   For later versions of OS X, (10.8 and 10.9), be sure to have Xcode
   AND Xcode Command Line Tools installed. httpd will built both with
   gcc and clang.

==========
  FreeBSD:
   autoconf 2.52 creates scripts that are incompatible with the Posix
   shell implementation (/bin/sh) on FreeBSD.  Be sure to use v2.13
   of autoconf.

   Threaded MPMs are not supported on FreeBSD 4.x.  Current releases of
   FreeBSD 5.x (5.2 or later) support threaded MPMs correctly.  You must pass
   '--enable-threads=yes' to APR's configure in order to enable threads.
   Additionally, you must use libthr or libkse via libmap.conf as the default
   libc_r is still broken as of this writing.  Please consult the man page for
   libmap.conf for more details about configuring libthr or libkse.
================
  HP-UX:
   The dlopen() system call in HP-UX has problems when loading/unloading
   C++ modules. The problem can be resolved by using shl_load() instead
   of dlopen(). This is fixed in the Apache 2.0.44 release.
   To enable loading of C++ modules, the httpd binary has to be linked with
   the following libraries :

   HP-UX (11.0 / 11i):
      When using shl_load        : "cpprt0_stub.s -lcl"
      When using dlopen          : "cpprt0_stub.s -lcl -lCsup"

   HP-UX (11i version 1.5 and greater):
      When using dlopen/shl_load : "cpprt0_stub.s -lcl -lunwind"

   The cpprt0_stub.s can be downloaded from the web site :
      http://h21007.www2.hp.com/hpux-devtools/CXX/hpux-devtools.0107/0083.html

   Compile cpprt0_stub.s with the PIC option
     cc -c +z cpprt0_stub.s
       - OR -
     gcc -c -fPIC cpprt0_stub.s
================
  AIX, using the vendor C compiler with optimization:
    There is an issue with compiling server/core.c with optimization enabled
    which has been seen with C for AIX 5.0.2.3 and above.  (5.0.2.0, 5.0.2.1,
    and 5.0.2.2 have an additional problem with Apache 2.0.x, so either upgrade
    the compiler or don't use optimization in order to avoid it.)

    cc_r works fine with -O2 but xlc_r does not.  In order to use xlc_r with
    -O2, apply the patch at

    http://www.apache.org/dist/httpd/patches/apply_to_2.0.49/aix_xlc_optimization.patch

    (That patch works with many recent levels of Apache 2+.)

================
  Solaris:

    On Solaris, better performance may be achieved by using the Sun Studio
    compiler instead of gcc.  As of version 11, it is now free (registration
    required).  Download the compiler from:

    http://developers.sun.com/prodtech/cc/downloads/index.jsp

    If you use Sun Studio, the following compiler flags (CFLAGS) are
    recommended:

      -XO4 -xchip=generic

================
  Ubuntu:

    You will need to ensure that you have either libtool 1.5.6
    or 2.2.6b, or later. Expat 2.0.1 and PCRE 8.02 are also
    recommended to be installed. If building PCRE from source,
    you'll also need g++.

Ich dachte, ich hätte nicht über Linux geschrieben, aber sollte ich libtool einschließen? Und installieren

# rpm -q libtool
package libtool is not installed

# yum install libtool
<~ Ausgelassen ~>
Installed:
  libtool.x86_64 0:2.4.2-22.el7_3

Dependency Installed:
  autoconf.noarch 0:2.69-11.el7         automake.noarch 0:1.13.4-3.el7          cpp.x86_64 0:4.8.5-39.el7                      gcc.x86_64 0:4.8.5-39.el7
  glibc-devel.x86_64 0:2.17-307.el7.1   glibc-headers.x86_64 0:2.17-307.el7.1   kernel-headers.x86_64 0:3.10.0-1127.19.1.el7   libmpc.x86_64 0:1.0.1-3.el7
  m4.x86_64 0:1.4.16-10.el7             mpfr.x86_64 0:3.1.1-4.el7               perl-Test-Harness.noarch 0:3.28-3.el7          perl-Thread-Queue.noarch 0:3.02-2.el7

Dependency Updated:
  glibc.x86_64 0:2.17-307.el7.1                                                   glibc-common.x86_64 0:2.17-307.el7.1

Erneut konfigurieren

# ./configure
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... no
configure: error: APR not found.  Please read the documentation.

gleicher Inhalt. Soll ich APR installieren? Überprüfen Sie also das Paket

# yum search apr
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.jaist.ac.jp
 * extras: ftp.jaist.ac.jp
 * updates: ftp.jaist.ac.jp
=========================================================================== N/S matched: apr ===========================================================================
apr-devel.i686 : APR library development kit
apr-devel.x86_64 : APR library development kit
apr-util-devel.i686 : APR utility library development kit
apr-util-devel.x86_64 : APR utility library development kit
apr-util-ldap.x86_64 : APR utility library LDAP support
apr-util-mysql.x86_64 : APR utility library MySQL DBD driver
apr-util-nss.x86_64 : APR utility library NSS crytpo support
apr-util-odbc.x86_64 : APR utility library ODBC DBD driver
apr-util-openssl.x86_64 : APR utility library OpenSSL crytpo support
apr-util-pgsql.x86_64 : APR utility library PostgreSQL DBD driver
apr-util-sqlite.x86_64 : APR utility library SQLite DBD driver
pcp-pmda-haproxy.x86_64 : Performance Co-Pilot (PCP) metrics for HAProxy
apr.i686 : Apache Portable Runtime library
apr.x86_64 : Apache Portable Runtime library
apr-util.i686 : Apache Portable Runtime Utility library
apr-util.x86_64 : Apache Portable Runtime Utility library
haproxy.x86_64 : TCP/HTTP proxy and load balancer for high availability environments

  Name and summary matches only, use "search all" for everything.

Es scheint zu geben. Ich denke, ich brauche auch das Entwicklungspaket, also installiere es

# yum install  apr-devel
<~ Ausgelassen ~>
Installed:
  apr-devel.x86_64 0:1.4.8-5.el7

Dependency Installed:
  apr.x86_64 0:1.4.8-5.el7

Noch einmal durchgeführt

# ./configure
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... yes
  setting CC to "gcc"
  setting CPP to "gcc -E"
  setting CFLAGS to "  -pthread"
  setting CPPFLAGS to " -DLINUX -D_REENTRANT -D_GNU_SOURCE"
  setting LDFLAGS to " "
configure:
configure: Configuring Apache Portable Runtime Utility library...
configure:
checking for APR-util... no
configure: error: APR-util not found.  Please read the documentation.

Ich ging ein wenig. Geben Sie ein, da APR-util erforderlich ist

# yum -y install apr-util
<~ Ausgelassen ~>
Installed:
  apr-util.x86_64 0:1.5.2-6.el7

Complete!

Versuchen Sie es nochmal

# ./configure
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... yes
  setting CC to "gcc"
  setting CPP to "gcc -E"
  setting CFLAGS to "  -pthread"
  setting CPPFLAGS to " -DLINUX -D_REENTRANT -D_GNU_SOURCE"
  setting LDFLAGS to " "
configure:
configure: Configuring Apache Portable Runtime Utility library...
configure:
checking for APR-util... no
configure: error: APR-util not found.  Please read the documentation.

Wie gewöhnlich. Ich denke, wir brauchen auch ein Entwicklungspaket. Ich dachte, es wurde installiert

# yum install apr-util-devel
<~ Ausgelassen ~>
Installed:
  apr-util-devel.x86_64 0:1.5.2-6.el7

Dependency Installed:
  cyrus-sasl.x86_64 0:2.1.26-23.el7           cyrus-sasl-devel.x86_64 0:2.1.26-23.el7     expat-devel.x86_64 0:2.1.0-11.el7     libdb-devel.x86_64 0:5.3.21-25.el7
  openldap-devel.x86_64 0:2.4.44-21.el7_6

Dependency Updated:
  expat.x86_64 0:2.1.0-11.el7

Complete!

Ohne Disziplin neu implementiert

# ./configure
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... yes
  setting CC to "gcc"
  setting CPP to "gcc -E"
  setting CFLAGS to "  -pthread"
  setting CPPFLAGS to " -DLINUX -D_REENTRANT -D_GNU_SOURCE"
  setting LDFLAGS to " "
configure:
configure: Configuring Apache Portable Runtime Utility library...
configure:
checking for APR-util... yes
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
checking how to run the C preprocessor... gcc -E
checking for gcc option to accept ISO C99... -std=gnu99
checking for pcre-config... false
configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/

Ein wenig fortgeschritten, aber es wird gesagt, dass es keine libpcre gibt

# yum search libpcre
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.jaist.ac.jp
 * extras: ftp.jaist.ac.jp
 * updates: ftp.jaist.ac.jp
=========================================================================== Matched: libpcre ===========================================================================
pcre.i686 : Perl-compatible regular expression library
pcre.x86_64 : Perl-compatible regular expression library
pcre2.i686 : Perl-compatible regular expression library
pcre2.x86_64 : Perl-compatible regular expression library

Error: Nothing to do

Es scheint, dass es ein Paket namens pcre gibt, also installieren Sie es

# yum install pcre
<~ Ausgelassen ~>
Installed:
  pcre2.x86_64 0:10.23-2.el7

Complete!

Ich werde es nochmal versuchen.

# ./configure
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... yes
  setting CC to "gcc"
  setting CPP to "gcc -E"
  setting CFLAGS to "  -pthread"
  setting CPPFLAGS to " -DLINUX -D_REENTRANT -D_GNU_SOURCE"
  setting LDFLAGS to " "
configure:
configure: Configuring Apache Portable Runtime Utility library...
configure:
checking for APR-util... yes
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
checking how to run the C preprocessor... gcc -E
checking for gcc option to accept ISO C99... -std=gnu99
checking for pcre-config... false
configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/

An derselben Stelle tritt ein Fehler auf. Überprüfen Sie das PCRE-Paket

# yum search pcre
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.jaist.ac.jp
 * extras: ftp.jaist.ac.jp
 * updates: ftp.jaist.ac.jp
========================================================================== N/S matched: pcre ===========================================================================
pcre-devel.i686 : Development files for pcre
pcre-devel.x86_64 : Development files for pcre
pcre-static.i686 : Static library for pcre
pcre-static.x86_64 : Static library for pcre
pcre-tools.x86_64 : Auxiliary utilities for pcre
pcre2-devel.i686 : Development files for pcre2
pcre2-devel.x86_64 : Development files for pcre2
pcre2-static.i686 : Static library for pcre2
pcre2-static.x86_64 : Static library for pcre2
pcre2-tools.x86_64 : Auxiliary utilities for pcre2
pcre2-utf16.i686 : UTF-16 variant of PCRE2
pcre2-utf16.x86_64 : UTF-16 variant of PCRE2
pcre2-utf32.i686 : UTF-32 variant of PCRE2
pcre2-utf32.x86_64 : UTF-32 variant of PCRE2
pcre.i686 : Perl-compatible regular expression library
pcre.x86_64 : Perl-compatible regular expression library
pcre2.i686 : Perl-compatible regular expression library
pcre2.x86_64 : Perl-compatible regular expression library

  Name and summary matches only, use "search all" for everything.
You have new mail in /var/spool/mail/root

Benötigen Sie ein Entwicklungspaket? Also installieren

# yum install pcre-devel
<~ Ausgelassen ~>
Installed:
  pcre-devel.x86_64 0:8.32-17.el7

Complete!

nochmal

# ./configure
checking for chosen layout... Apache
checking for working mkdir -p... yes
<~ Ausgelassen ~>
config.status: creating include/ap_config_auto.h
config.status: executing default commands
configure: summary of build options:

    Server Version: 2.4.46
    Install prefix: /usr/local/apache2
    C compiler:     gcc -std=gnu99
    CFLAGS:           -pthread
    CPPFLAGS:        -DLINUX -D_REENTRANT -D_GNU_SOURCE
    LDFLAGS:
    LIBS:
    C preprocessor: gcc -E

erledigt

make

# make
Making all in srclib
make[1]: Entering directory `/usr/local/src/httpd-2.4.46/srclib'
make[1]: Leaving directory `/usr/local/src/httpd-2.4.46/srclib'
Making all in os

<~ Ausgelassen ~>

make[4]: Leaving directory `/usr/local/src/httpd-2.4.46/modules/mappers'
make[3]: Leaving directory `/usr/local/src/httpd-2.4.46/modules/mappers'
make[2]: Leaving directory `/usr/local/src/httpd-2.4.46/modules'
make[2]: Entering directory `/usr/local/src/httpd-2.4.46/support'
make[2]: Leaving directory `/usr/local/src/httpd-2.4.46/support'

make[1]: Leaving directory `/usr/local/src/httpd-2.4.46'

erledigt

make install

# make install
Making install in srclib
make[1]: Entering directory `/usr/local/src/httpd-2.4.46/srclib'
make[2]: Entering directory `/usr/local/src/httpd-2.4.46/srclib

<~ Ausgelassen ~>

Installing build system files
mkdir /usr/local/apache2/build
Installing man pages and online manual
mkdir /usr/local/apache2/man
mkdir /usr/local/apache2/man/man1
mkdir /usr/local/apache2/man/man8
mkdir /usr/local/apache2/manual
make[1]: Leaving directory `/usr/local/src/httpd-2.4.46'

erledigt.

Starten Sie Apache

# /usr/local/apache2/bin/apachectl start

# ps axuwf |grep apache
root     29457  0.0  0.0 112812   972 pts/0    S+   06:24   0:00                      \_ grep --color=auto apache
root     29367  0.0  0.1  79164  2528 ?        Ss   06:23   0:00 /usr/local/apache2/bin/httpd
daemon   29368  0.0  0.2 368128  4268 ?        Sl   06:23   0:00  \_ /usr/local/apache2/bin/httpd
daemon   29369  0.0  0.2 368128  4268 ?        Sl   06:23   0:00  \_ /usr/local/apache2/bin/httpd
daemon   29370  0.0  0.2 368128  4268 ?        Sl   06:23   0:00  \_ /usr/local/apache2/bin/httpd

Surfen im Internet

Bestätigen Sie, dass es funktioniert! Wird angezeigt

Zusammenfassung

――Unerwarteterweise war die Installation einfach.

Recommended Posts

Installieren Sie Apache 2.4.46 von der Quelle unter CentOS 7
Installieren Sie samba4 aus dem Quellcode unter CentOS8
Installieren Sie Golang unter CentOS 8
Installieren Sie Neo4j 4.1.3 unter centOS
Installieren Sie Vertica 10.0 unter CentOS 6.10
Installieren Sie PostgreSQL 12 auf Centos8
Installieren Sie Python 3 unter CentOS 7
Installieren Sie kuromoji unter CentOS7
Installieren Sie PostGIS 2.5.5 unter CentOS7
Installieren Sie jpndistrict unter CentOS 7
Installieren Sie Redmine 4.1.1 unter CentOS 7
Smokeping Installation unter CentOS7
Installieren Sie PostgreSQL 13 unter CentOS 7.5
Erstellen Sie openssl, apache2.4, php7.4 aus dem Quellcode auf Ubuntu-server20.04.
Installieren Sie OpenFOAM v2006 unter CentOS
Installieren Sie Jenkins auf Dockers CentOS
Installieren Sie Ruby 2.7 unter CentOS 7 (SCL)
Installieren Sie den neuesten Hardwaretreiber von EL Repo unter CentOS
Installieren Sie Ruby 2.5 unter CentOS 7 mit SCL
Hinweis: Installieren Sie nginx aus dem offiziellen Repository unter CentOS 8 mit dnf
Java Open JDK 8 unter CentOS 7 installieren
Schritte zum Installieren von devtoolset-6 unter CentOS 7
Installieren Sie Java 9 unter Windows 10 und CentOS 7
Installieren Sie den Webmail-Client Rainloop unter CentOS 8
So installieren Sie Beta PHP8.0 unter CentOS8
Installieren Sie CentOS 7 auf Raspberry pi 4 Model B.
Installieren Sie Apache J Meter
Installieren Sie MariaDB (CentOS 8)
[CentOS] Installieren Sie Apache-Loggen
Installieren Sie NextCloud unter CentOS 7 mit Alibaba Cloud ECS
Befehl zum Installieren von nginx / PHP7 / php-fpm unter CentOS7
Installieren Sie SonarQube auf einem Mac und fordern Sie die Quellanalyse heraus
Installieren Sie Java, Apache, Tomcat 9 auf EC2 (Amazon Linux 2)
Installieren Sie gradle auf dem Mac
Installieren Sie Corretto 8 unter Windows
Maven auf CentOS 7 Tutorial
Installieren Sie OpenJDK unter macOS
Installieren Sie Java auf dem Mac
Docker-Installation unter CentOS 6
Verwenden Sie perltidy unter CentOS 8
Installieren Sie pyqt5 auf Ubuntu
Installieren Sie das BookStack-Dokumentations-Wiki im Elastic Compute Service unter CentOS 7
Probieren Sie OpenLiteSpeed unter CentOS8 aus
Eval Java-Quelle von Java
[CentOS7] Installiere aws cli
Installieren Sie Docker auf Manjaro
Installieren Sie Ruby unter Ubuntu 20.04
Verwenden Sie mod_auth_cas unter CentOS 8
Installieren Sie lombok auf SpringToolSuite4
Anlegestelle v8 auf CentOS7
OpenJDK-Installation unter CentOS7
Apache2 unter Ubuntu20.04 LTS