90807 发表于 2016-11-3 08:38:24

centos6.8简易编译安装httpd2.4

                      httpd:是Apache超文本传输协议(HTTP)服务器的主程序

前言:httpd是一个web服务器,功能强大且应用广泛。

httpd2.4下载地址:http://apache.fayea.com/httpd/httpd-2.4.23.tar.bz2
apr下载地址:http://apache.fayea.com/apr/apr-1.5.2.tar.gz
apr-util下载地址:http://apache.fayea.com/apr/apr-util-1.5.4.tar.gz

1、准备工作:配置yum源安装开发环境
# vim /etc/yum.repos.d/CentOS-Base.repo

name=centos sohu.mirrors
baseurl=http://mirrors.sohu.com/centos/6.8/centosplus/x86_64/Packages/
enabled=1
gpgcheck=0


# yum groupinstall"Desktop Platform Development""Server Platform Development""Developmenttools" -y

注意:因为httpd依赖pcre-devel包,所以需要安装pcre-devel包,因为是编译安装,需要apr和apr-util包,该包主要为上层的应用程序提供一个可以跨越多操作系统平台使用的底层支持接口库。

# yum -y install pcre-devel

2、将所有工具包放入linux虚拟机中,我放在/root下
# ls
anaconda-ks.cfg   apr-util-1.5.4.tar.gzinstall.log      install.log.syslog
apr-1.5.2.tar.gzhttpd-2.4.23.tar.bz2   install.log.bakscripts

3、编译安装apr
# tar xf apr-1.5.2.tar.gz
# cd apr-1.5.2
# ./configure --prefix=/usr/local/apr
# make
# make install
# cd

4、编译安装apr-util
# tar xf apr-util-1.5.4.tar.gz
# cd apr-util-1.5.4
# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
# make
# make install
# cd


5、编译安装httpd
# tar xf httpd-2.4.23.tar.bz2
# cd httpd-2.4.23
# ./configure --prefix=/usr/local/httpd --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util
# make
# make install
# cd

6、启动httpd服务,并验证
# /usr/local/httpd/bin/httpd
# netstat -tnlp|grep 80

tcp      0      0 :::80                     :::*                        LISTEN      50741/httpd

                   

页: [1]
查看完整版本: centos6.8简易编译安装httpd2.4