Compilation
< Technique | Apache
Sauter à la navigation
Sauter à la recherche
Révision datée du 25 janvier 2020 à 15:33 par Jordan (discussion | contributions)
Sommaire
Présentation
Cette page a pour objet de décrire comment compiler le serveur web Apache.
Plus d'informations sur le site de l'éditeur :
- Apache 2.2 : http://httpd.apache.org/docs/2.2/fr/
- Apache 2.4 : http://httpd.apache.org/docs/2.4/fr/
Téléchargement des sources
Se rendre sur la page de téléchargement d'Apache et aller à la section de téléchargement de la "Stable Release - Latest Version". Copier le lien de téléchargement de la version en cours (2.4.41 à la rédaction de ce document).
Se connecter au serveur, se rendre dans le dossier de téléchargement et télécharger les sources Apache :
wget http://apache.crihan.fr/dist//httpd/httpd-2.4.41.tar.gz
[root@centos8temp downloads]# wget http://apache.crihan.fr/dist//httpd/httpd-2.4.41.tar.gz --2020-01-25 15:55:58-- http://apache.crihan.fr/dist//httpd/httpd-2.4.41.tar.gz Résolution de apache.crihan.fr (apache.crihan.fr)… 195.221.21.36, 2001:660:7401:211::36 Connexion à apache.crihan.fr (apache.crihan.fr)|195.221.21.36|:80… connecté. requête HTTP transmise, en attente de la réponse… 200 OK Taille : 9267917 (8,8M) [application/x-gzip] Sauvegarde en : « httpd-2.4.41.tar.gz » httpd-2.4.41.tar.gz 100%[=====================================================================================>] 8,84M 32,0MB/s ds 0,3s 2020-01-25 15:55:58 (32,0 MB/s) — « httpd-2.4.41.tar.gz » sauvegardé [9267917/9267917]
Décompression de l'archive
Décompresser l'archive dans le dossier cible de compilation :
tar -zxvf httpd-2.4.41.tar.gz -C /local/builds/
Compilation
Options de compilation disponibles
Se rendre dans le dossier de compilation et taper la commande suivante pour afficher les options de compilation disponibles :
./configure --help
[root@myserver downloads]# cd /local/builds/httpd-2.4.41
[root@myserver httpd-2.4.41]# ./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]
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
--datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
--datadir=DIR read-only architecture-independent data [DATAROOTDIR]
--infodir=DIR info documentation [DATAROOTDIR/info]
--localedir=DIR locale-dependent data [DATAROOTDIR/locale]
--mandir=DIR man documentation [DATAROOTDIR/man]
--docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE]
--htmldir=DIR html documentation [DOCDIR]
--dvidir=DIR dvi documentation [DOCDIR]
--pdfdir=DIR pdf documentation [DOCDIR]
--psdir=DIR ps documentation [DOCDIR]
System types:
--build=BUILD configure for building on BUILD [guessed]
--host=HOST cross-compile to build programs to run on HOST [BUILD]
--target=TARGET configure for building compilers for TARGET [HOST]
Optional Features:
--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
Configuration de la compilation
Pour lancer la compilation avec les options désirées, lancer la commande suivante :