httpd-2.4 编译安装


 ①依赖于更高版本的apr和apr-util。apr全称为apache portable runtime(一个让apache跨平台的     工具,底层库)

 ②依赖于pcre-devel

安装包

wKiom1MpuU3zHDbTAACTlzS3tBw681.jpg

1、关闭当前系统的httpd服务


# service httpd stop   停止服务
# chkconfig httpd off  开机不启动


2、安装pcre-devel


#yum -y install pcre-devel


3、编译安装apr-1.5.0


#tar xf apr-1.5.0.tar.bz2
#cd apr-1.5.0
#./configure --prefix=/usr/local/apr
#make && make install

4、编译安装apr-util-1.5.3


# tar xf apr-util-1.5.3.tar.bz2
# cd apr-util-1.5.3
# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
# make && make install
# tar xf apr-util-1.5.3.tar.bz2
# cd apr-util-1.5.3
# ./configure
# make && make install


5、 编译安装httpd


# tar xf httpd-2.4.9.tar.bz2
# cd httpd-2.4.9
# ./configure --help
# ./configure --prefix=/usr/local/apache --sysconfdir=
/etc/httpd24 --enable-so --enable-ssl --enable-cgi --en
able-rewrite --with-zlib --with-pcre --with-apr=/usr/lo
cal/apr --with-apr-util=/usr/local/apr-util --enable-mo
dules=most --enable-mpms-shared=all -with-mpm=event
# make && make install


6、编译后的配置

  6.1 导出头文件  

# ln -sv /usr/local/apache/include /usr/include/httpd


  6.2 导出库文件

# ln -sv /usr/local/apache/include /usr/include/httpd


  6.3 配置二进制文件


# vim /etc/profile.d/httpd.sh
  export PATH=/usr/local/apache/bin:$PATH


  6.4 配置man手册


# vim /etc/man.config
  MANPATH /usr/local/apache/man
# man -M /usr/local/apache/man httpd


  6.5 检测


# apachectl start
# apachectl stop
# apachectl restart
# ss -ntl

wKiom1MqVqfAiXrMAADBauH35H4523.jpg