One, Centos 6 under the compiler installation:
1. Preparing the environment
① Installing the Build environment
Yum groupinstall-y "Developmenttools" "Server Platform Development"
② Installing Apr
httpd2.4 requires 1.4_ version of Apr and APR-UTIL,CENTOS6 comes with a version of 1.3
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/8C/4F/wKiom1hp-FbwINVdAADe8k33tow674.png "title=" B.png " alt= "Wkiom1hp-fbwinvdaade8k33tow674.png"/>
TAR-XJVF apr-1.5.0.tar.bz2
tar-xjvfapr-util-1.5.3.tar.bz2 // Unzip
CD apr-1.5.0
./CONFIGURE--PREFIX=/USR/LOCAL/APR // Specify APR installation path to avoid overwriting older versions
Make && make install
CD apr-util-1.5.3
./configure--prefix=/usr/local/apr-util --with-apr=/usr/local/apr
// Specify the path of your own installed Apr
Make && make install
③ installation Pcre-devel
Yum Install-y pcre-devel
2. Installing httpd2.4
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/8C/4B/wKioL1hp-HHQMYFbAAHq3fR6KSM498.png "title=" B.png " alt= "Wkiol1hp-hhqmyfbaahq3fr6ksm498.png"/>
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/8C/4B/wKioL1hp-InjE0kVAAD2EOKd3VU120.png "title=" B.png " alt= "Wkiol1hp-inje0kvaad2eokd3vu120.png"/>
TAR-XJVF httpd-2.4.9.tar.bz2
CD httpd-2.4.9
./configure --prefix=/usr/local/apache --sysconf=/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=prefork
// Specify the installation path and profile path, use your own APR and apr-util, enable most modules (select all for all modules), specify the default mode of operation is prefork (you can select Worker and event)
Make && make install
3. Follow-up work
vim/etc/profile.d/http24.sh
// Add environment variables, add httpd2.4 to the leftmost, match to httpd2.4 when using command
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/8C/4F/wKiom1hp-KCimFNtAACI5serZSI844.png "title=" B.png " alt= "Wkiom1hp-kcimfntaaci5serzsi844.png"/>
source/etc/profile.d/http24.sh // make environment variables effective immediately
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/8C/4B/wKioL1hp-LaTpPL0AACWNpS0ccI929.png "title=" B.png " alt= "Wkiol1hp-latppl0aacwnps0cci929.png"/>
echo "manpath/usr/local/apache/man/" >>/etc/man.config // add a man path
ln-s/usr/local/apache/include//usr/include/httpd24 // Link Header file
cp/etc/rc.d/init.d/httpd/etc/rc.d/init.d/httpd24 // editing a service script as a template for a service action script
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/8C/4F/wKiom1hp-M-y69TEAAGOzT82M3c362.png "title=" B.png " alt= "Wkiom1hp-m-y69teaagozt82m3c362.png"/>
chkconfig--add httpd24 // Add as Service script
chkconfig--level httpd24 on // Set boot up
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/8C/4F/wKiom1hp-OewCB41AACKLgjM8Fg522.png "title=" B.png " alt= "Wkiom1hp-oewcb41aacklgjm8fg522.png"/>
Service httpd24 Start // Start the service
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/8C/4B/wKioL1hp-P2DOSgKAACJUMXk00Y496.png "title=" B.png " alt= "Wkiol1hp-p2dosgkaacjumxk00y496.png"/>
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/8C/4F/wKiom1hp-RPT8SXLAALMkW5CS04836.png "title=" B.png " alt= "Wkiom1hp-rpt8sxlaalmkw5cs04836.png"/>
Second, the Centos 7 installation:
Yum Install-y httpd
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/8C/4F/wKiom1hp-SvRS9CDAAB50b-vMYQ257.png "title=" B.png " alt= "Wkiom1hp-svrs9cdaab50b-vmyq257.png"/>
Systemctl Enable Httpd.service // Set boot up
systemctl start Httpd.service // Start the service
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/8C/4F/wKiom1hp-UKwy0thAAJDDWZFsq0768.png "title=" B.png " alt= "Wkiom1hp-ukwy0thaajddwzfsq0768.png"/>
It is recommended to install using httpd2.4 on CentOS 7 and use httpd2.2 on CentOS 6
Installing httpd2.4