Centos 6 默认安装http版本为2.2,如果想安装2.4版本则需要升级apr
centos6默认:apr-1.3.9,apr-util-1.3.9
编译安装步骤:
1.4+版的apr和apr-util
前提:安装开发环境,安装pcre-devel
1:apr
(1):yum groupinstall “Development Tools” “Server Platform Development” -y
yum -y install pcre-devel
(2):下载升级的版本;apr-1.5.0.tar.bz2 ; apr-util-1.5.3.tar.gz2
(3):tar xf apr-1.5.0.tar.bz2
(4):cd apr-1.5.0
(5):./configure --prefix=/usr/local/apr
(6):make && make install
2:apr-util
(1):tar xf apr-util-1.5.3.tar.gz2
(2):cd apr-util-1.5.3
(3):./configire --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
(4):make && make install
3:安装httpd 2.4
# groupadd -r apache
# useradd -r -g apache apahce
下载:httpd-2.4.10.tar.gz2
tar xf httpd-2.4.10.tar.gz2
cd httpd-2.4.10
# ./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
# make && make install
启动服务:apachectl
查看默认运行模块:
[root@localhost ~]# cd /etc/httpd/
[root@localhost httpd]# ls
conf conf.d conf.modules.d logs modules run
[root@localhost httpd]# cd conf.modules.d/
[root@localhost conf.modules.d]# ls
00-base.conf 00-dav.conf 00-lua.conf 00-mpm.conf 00-proxy.conf 00-systemd.conf 01-cgi.conf
[root@localhost conf.modules.d]# less 00-mpm.conf