Environment Introduction:
System Environment: CentOS6.4
Required Packages: apr-1.4.2.tar.gz, apr-util-1.4.2.tar.gz, httpd-2.2.32.tar.gz
Note: The official website prompts the Apr/arp-util version to be 1.4 (inclusive) version above.
Dependency Package: Zlib-devel
# yum Install Zlib-devel
Development Environment Package Group: Development Tools, Server Platform Development
# yum Groupinstall "Development Tools" "Serverplatform development"-Y
1, query the old version of the Apache package name and uninstall.
Rpm-q httpd
RPM-E--nodeps ttpd-2.2.15-59.el6.centos.x86_64
or use the following shell script to bulk delete legacy Apache packages
For name in ' Rpm-qa httpd* ';d o rpm-e--nodeps $name;d One
2. Download the source package
wget https://mirrors.aliyun.com/apache/apr/apr-1.5.2.tar.gz
wget https://mirrors.aliyun.com/apache/apr/apr-util-1.5.4.tar.gz
wget https://mirrors.aliyun.com/apache/httpd/httpd-2.2.32.tar.gz
3. Decompression
TAR-XVF apr-1.5.2.tar.gz
TAR-XF apr-util-1.5.4.tar.gz
TAR-XVF httpd-2.2.32.tar.gz
4. Compile and install apr-1.5.2
CD apr-1.5.2
./configure--prefix=/usr/local/apr-httpd/
Make
Make install
5. Compile and install apr-util-1.5.4
CD apr-util-1.5.4
./configure--prefix=/usr/local/apr-util-httpd/--with-apr=/usr/local/apr-httpd/
Make
Make install
6. Compile and install httpd-2.2.32
CD httpd-2.2.32
./configure--prefix=/usr/local/apache--sysconfdir=/etc/httpd/--enable-so--enable-deflate--enable-headers-- Enable-rewrite--with-mpm=prefork--with-apr=/usr/local/apr-httpd/-with-apr-util=/usr/local/apr-util-httpd/
--prefix: Installation path;
--sysconfdir: Specifies the configuration file path;
--ENABLE-SO:DSO compatible, dso=dynamic shared object, dynamic sharing objects, can realize the dynamic effective module;
--enable-deflate: Support compression function, need zlib-devel package support;
--enable-headers: Provides permission to control the HTTP request header;
--enable-rewrite: Provides rewrite functionality based on URL rules;
--WITH-MPM: Set the default enabled MPM mode, {prefork|worker|event};
--WITH-APR:APR installation path;
--with-apr-util:apr-util the installation path;
Make
Make install
7. Set the binary command PATH environment variable
Edit File/etc/profile.d/name.sh, enter export path=/path/to/bin: $PATH
vim/etc/profile.d/httpd.sh
Export Path=/usr/local/apache/bin: $PATH
. /etc/profile.d/httpd.sh
Note: The bin path is placed in front of the system when reading the configuration file will be read from left to right sequence
8. Create a link header file
ln-sv/usr/local/apache/include//usr/include/httpd
"/usr/include/httpd", "/usr/local/apache/include/"
9. Set Manpath
Add the Manpath directive to the/etc/man.config file and point to the new command manual path;
Vim/etc/man.config
Manpath/usr/local/apache/man
10. Start httpd-2.2.32 Service
Apachectl start
11. Check if port 80 is being monitored
Ss-tnl
12. Use browser to access test
650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M01/92/0D/wKioL1j690vTQazOAABEuAyWVlU634.png-wh_500x0-wm_ 3-wmp_4-s_2010313464.png "title=" screenshot 2017-04-22 pm 2.06.51.png "alt=" wkiol1j690vtqazoaabeuaywvlu634.png-wh_50 "/ >
Reference:
Http://www.cnblogs.com/musenl/p/4420067.html
http://xuding.blog.51cto.com/4890434/1728651
Http://httpd.apache.org/docs/2.2/install.html#download
Http://www.linuxidc.com/Linux/2017-02/140803.htm
This article is from the "Wangjian it road!" "Blog, be sure to keep this provenance http://asherwang.blog.51cto.com/11255017/1918457
Compiling and installing httpd-2.2.32