First, compile and install apache2.4.9
1. Pre-preparation
httpd-2.4.9 requires a newer version of APR and Apr-util, so it needs to be upgraded beforehand. There are two ways to upgrade, one is to compile the installation through source code, and the other is to upgrade the RPM package directly. Here you choose the way to compile the source code. Want the server to upload three source code package apr-1.5.0.tar.bz2 apr-util-1.5.3.tar.bz2 httpd-2.4.9.tar.bz2
2. Installing Apache Details
(1) Compile and install Apr
[Email protected] mnt]# Tar XF apr-1.5.0.tar.bz2
[Email protected] mnt]# CD apr-1.5.0
[Email protected] apr-1.5.0]#/configure--PREFIX=/USR/LOCAL/APR
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
[[email protected] apr-1.5.0]# make && make install
(2) Compile and install Apr-until
[Email protected] mnt]# Tar XF apr-util-1.5.3.tar.bz2
[Email protected] mnt]# CD apr-util-1.5.3
[Email protected] apr-util-1.5.3]#/configure--prefix=/usr/local/apr-util--with-apr=/usr/local/apr
[[email protected] apr-util-1.5.3]# make && make install
(3) Compile and install apache2.4.9
The httpd-2.4.9 compilation process also relies on the Pcre-devel software package, which needs to be installed beforehand. This package system CD comes with the installation using Yum local source.
[email protected] packages]# Yum install pcre-devel-7.8-6.el6.x86_64.rpm
After that, start installing Apapche and perform the following configuration
./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=event
Encounter Configure:WARNING:OpenSSL version is too old No
Checking whether to enable Mod_ssl ... Configure:error:mod_ssl have been requested but can not is built due to prerequisit E Failures
Workaround: Use Yum to install the new Openssl-devel to resolve, after the installation is complete again configuration, smoothly through
[[email protected] httpd-2.4.9]# make && make install
Smooth installation Completed
Add:
(1) Constructing MPM as static module
In all platforms, MPM can be built as a static module. Select a mpm at build time, linked to the server. If you want to change MPM, you must rebuild it. In order to use the specified MPM, use the parameter--with-mpm=name when executing the Configure script. Name is the specified MPM name. After the compilation is complete, you can use./httpd-l to determine the selected MPM. This command lists all modules that are compiled into the server program, including MPM.
(2) Build MPM as dynamic module
In UNIX or similar platforms, MPM can be built as a dynamic module and loaded at run time as with other dynamic modules. Building MPM as a dynamic module allows you to change the MPM by modifying the contents of the LoadModule directive without rebuilding the server program. Use the--enable-mpms-shared option to enable this feature when you execute a configure script. All MPM modules supported by this platform will be installed when the given parameter is all. You can also give a list of modules in the parameters. The default MPM, which can be automatically selected or specified by the--WITH-MPM option when the Configure script is executed, then appears in the generated server configuration file. Edit the loadmodule instruction content to select a different mpm.
Second, the production of the Web SSL certificate
1. Build a private CA agency
650) this.width=650; "title=" image "style=" border-left-0px; Border-right-width: 0px; Background-image:none; border-bottom-width:0px; padding-top:0px; padding-left:0px; padding-right:0px; border-top-width:0px "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M01/74/EF/ Wkiol1yvdqzgkdpgaaqapmyayjc623.jpg "width=" 710 "height=" 548 "/>
650) this.width=650;" title= "image" style= " border-left-0px; border-right-width:0px; Background-image:none; border-bottom-width:0px; padding-top:0px; padding-left:0px; padding-right:0px; border-top-width:0px "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M02/74/F2/ Wkiom1yvdnrwpjpbaabml1gtfbg188.jpg "width=" 714 "height="/>
2.web Server creates a certificate and produces a signed request to a privately built CA
650) this.width=650; "title=" image "style=" border-left-0px; border-right-width:0px; Background-image:none; border-bottom-width:0px; padding-top:0px; padding-left:0px; padding-right:0px; border-top-width:0px "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M02/74/EF/ Wkiol1yvdq3r0mh1aal-ylo6jqe835.jpg "width=" 727 "height=" 459 "/>
2. The privately built CA is signed for the signing request and returned to the Web server
650) this.width=650; "title=" image "style=" border-left-0px; border-right-width:0px; Background-image:none; border-bottom-width:0px; padding-top:0px; padding-left:0px; padding-right:0px; border-top-width:0px "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M00/74/EF/ Wkiol1yvdq6iiwvaaam0pxmihss191.jpg "width=" 730 "height=" 558 "/>
Third, the Web server configuration SSL module function
Edit httpd2.4.9 main profile load two modules
650) this.width=650; "title=" image "style=" border-left-0px; border-right-width:0px; Background-image:none; border-bottom-width:0px; padding-top:0px; padding-left:0px; padding-right:0px; border-top-width:0px "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M01/74/EF/ Wkiol1yvdrlgfk9waabmy5mv5u0190.jpg "width=" 453 "height="/>
650) this.width=650; "title=" image "style=" border-left-0px; border-right-width:0px; Background-image:none; border-bottom-width:0px; padding-top:0px; padding-left:0px; padding-right:0px; border-top-width:0px "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M02/74/F2/ Wkiom1yvdn-whx0maabtoof4ftm946.jpg "width=" 458 "height=" "/>"
Opening a fragment profile httpd-ssl.conf
650) this.width=650; "title=" image "style=" border-top:0px; border-right:0px; Background-image:none; border-bottom:0px; padding-top:0px; padding-left:0px; border-left:0px; padding-right:0px "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M00/74/F2/ Wkiom1yvdodywm6zaabdllvy80s442.jpg "460" height= "/>"
And then edit ssl.conf edits, roughly the same as apache2.2.
650) this.width=650; "title=" image "style=" border-top:0px; border-right:0px; Background-image:none; border-bottom:0px; padding-top:0px; padding-left:0px; border-left:0px; padding-right:0px "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M01/74/F2/ Wkiom1yvdodiumzkaafyaf40gqg208.jpg "" 485 "height=" 359 "/>
650) this.width=650; "title=" image "style=" border-top:0px; border-right:0px; Background-image:none; border-bottom:0px; padding-top:0px; padding-left:0px; border-left:0px; padding-right:0px "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M00/74/F2/ Wkiom1yvdohzhm5haacttq-pnui817.jpg "" 569 "height=" 319 "/>
Deploying an apache2.4.9-based HTTPS experiment