Linux Apache source code compilation installation

Source: Internet
Author: User
Tags egrep

Download, unzip the Apache source code

[Email protected] ~]# Mkdir/usr/local/apache

[Email protected] ~]# cd/usr/local/apache/

[Email protected] apache]# wget http://mirrors.sohu.com/apache/httpd-2.4.25.tar.gz

[Email protected] apache]# TAR-ZXVF httpd-2.4.25.tar.gz

Setting up the installation environment

[[email protected] apache]# ls
httpd-2.4.25 httpd-2.4.25.tar.gz

[Email protected] apache]# CD httpd-2.4.25/

[[email protected] httpd-2.4.25]#./configure--prefix=/opt/httpd-2.4.25--enable-so--enable-mods-shared= Most--enable-proxy-balancer=shared--enable-proxy-http=shared--enable-p
ROXY-AJP--enable-rewrite
Checking For chosen layout ... Apache
Checking for working mkdir-p ... yes
checking for grep that handles long lines and-e .../usr/bin/grep
che cking for egrep .../usr/bin/grep-e
Checking build system type ... X86_64-unknown-linux-gnu
Checking host system Typ E ... x86_64-unknown-linux-gnu
checking target system type ... x86_64-unknown-linux-gnu
Configure:
Configure : Configuring Apache Portable Runtime Library ...
Configure:
checking for APR ... no
Configure:error:APR not found.   Please read the documentation.
[[email protected] httpd-2.4.25]#
[[email protected] httpd-2.4.25]# cd/usr/local/src/

[Email protected] src]# wget http://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-1.5.2.tar.gz

[Email protected] src]# tar zxvf apr-1.5.2.tar.gz
[Email protected] src]# CD APR-1.5.2/

[Email protected] apr-1.5.2]#/configure--PREFIX=/USR/LOCAL/APR

[[email protected] apr-1.5.2]# make

[[email protected] apr-1.5.2]# make install

[Email protected] httpd-2.4.25]#/configure--prefix=/opt/httpd-2.4.25--enable-so--enable-mods-shared=most-- enable-proxy-balancer=shared--enable-proxy-http=shared--ENABLE-PROXY-AJP--enable-rewrite
Checking for chosen layout ... Apache
Checking for working mkdir-p ... yes
Checking for grep that handles long lines and-e .../usr/bin/grep
Checking for egrep .../usr/bin/grep-e
Checking build system Type ... X86_64-unknown-linux-gnu
Checking host system Type ... X86_64-unknown-linux-gnu
Checking target system Type ... X86_64-unknown-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 "-g-o2-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.


[Email protected] httpd-2.4.25]#

[Email protected] src]# wget http://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-util-1.5.4.tar.gz

[Email protected] src]# tar zxvf apr-util-1.5.4.tar.gz

[Email protected] apr-util-1.5.4]#/configure--prefix=/usr/local/apr-util--with-apr=/usr/local/apr

[[email protected] apr-util-1.5.4]# make

[[email protected] apr-util-1.5.4]# make install

[Email protected] httpd-2.4.25]#/configure--prefix=/opt/httpd-2.4.25--enable-so--enable-mods-shared=most-- enable-proxy-balancer=shared--enable-proxy-http=shared--ENABLE-PROXY-AJP--enable-rewrite--with-apr-util=/usr/ local/apr-util/


[Email protected] httpd-2.4.25]#/configure--prefix=/opt/httpd-2.4.25--enable-so--enable-mods-shared=most-- enable-proxy-balancer=shared--enable-proxy-http=shared--ENABLE-PROXY-AJP--enable-rewrite--with-apr-util=/usr/ local/apr-util/
Checking for chosen layout ... Apache
Checking for working mkdir-p ... yes
Checking for grep that handles long lines and-e .../usr/bin/grep
Checking for egrep .../usr/bin/grep-e
Checking build system Type ... X86_64-unknown-linux-gnu
Checking host system Type ... X86_64-unknown-linux-gnu
Checking target system Type ... X86_64-unknown-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 "-g-o2-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 is 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/


It is best to download pcre do not download pcre2. version

[Email protected] src]# wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.39.tar.gz

[Email protected] src]#

[Email protected] src]#

[Email protected] src]# tar ZXFV pcre-8.39.tar.gz
[Email protected] src]# CD pcre-8.39/

[Email protected] pcre-8.39]#/configure--prefix=/usr/local/pcre

[[email protected] pcre-8.39]# make && make install

[Email protected] pcre-8.39]# CD. /httpd-2.4.25/
[Email protected] httpd-2.4.25]#/configure--prefix=/opt/httpd-2.4.25--enable-so--enable-mods-shared=most-- enable-proxy-balancer=shared--enable-proxy-http=shared--ENABLE-PROXY-AJP--enable-rewrite--with-apr-util=/usr/ local/apr-util/--with-pcre=/usr/local/pcre

--enable-so means that Apache can support DSO mode

--enable-mods-shared=most represents a dynamic compilation of most commonly used modules. Optionally, you can load some modules

, most of which means that only commonly used modules are included and loaded in dynamic load mode.

--enable-proxy-balancer=shared

--enable-proxy-http=shared

--enable-proxy-ajp

--enable-rewrite


3. Compiling and installing the software

[[email protected] httpd-2.4.25]# make

[[email protected] httpd-2.4.25]# make install



Linux Apache source code compilation installation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.