首页 > 代码库 > 在CentOS6.7操作系统上编译安装httpd2.4

在CentOS6.7操作系统上编译安装httpd2.4

功能描述:

  在CentOS6.7操作系统上,编译安装apache服务,实现定制功能等

一、安装前提

 1)安装编译httpd需要的软件包

 [root@bqe6tewv41kx ~]#  yum -y install wget gcc-c++ ncurses ncurses-devel cmake make perl bison openssl openssl-devel gcc* libxml2 libxml2-devel   curl-devel libjpeg* libpng* freetype* pcre-devel
2)安装pcre,apr,apr-uril

[root@bqe6tewv41kx ~]# wget http://mirrors.cnnic.cn/apache//apr/apr-util-1.5.4.tar.gz

[root@bqe6tewv41kx ~]# wget http://101.96.10.41/downloads.sourceforge.net/project/pcre/pcre2/10.22/pcre2-10.22.zip?r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2F&ts=1472808609&use_mirror=nchc

[root@bqe6tewv41kx ~]#wget http://mirrors.cnnic.cn/apache//apr/apr-1.5.2.tar.gz

[root@bqe6tewv41kx ~]#wget https://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-iconv-1.2.1.tar.gz

[root@bqe6tewv41kx ~]#unzip pcre2-10.22.zip

[root@bqe6tewv41kx pcre2-10.22]#cd pcre2-10.22

[root@bqe6tewv41kx pcre2-10.22]#./configure --prefix=/usr/local/pcre

[root@bqe6tewv41kx pcre2-10.22]#make && make install

[root@bqe6tewv41kx ~]#tar xf apr-1.5.2.tar.gz

[root@bqe6tewv41kx apr-1.5.2]#cd apr-1.5.2

[root@bqe6tewv41kx apr-1.5.2]#./configure --prefix=/usr/local/apr

[root@bqe6tewv41kx apr-1.5.2]#make && make install

[root@bqe6tewv41kx ~]#tar xf apr-util-1.5.4.tar.gz

[root@bqe6tewv41kx apr-util-1.5.4]#cd apr-util-1.5.4

[root@bqe6tewv41kx apr-util-1.5.4]#./configure --prefix=/usr/local/apr-uril --with-apr=/usr/local/apr

[root@bqe6tewv41kx apr-util-1.5.4]#make && make install

[root@bqe6tewv41kx ~]#tar xf apr-iconv-1.2.1.tar.gz

[root@bqe6tewv41kx apr-iconv-1.2.1]#cd apr-iconv-1.2.1

[root@bqe6tewv41kx apr-iconv-1.2.1]#./configure --prefix=/usr/local/apr-iconv --with-apr=/usr/local/apr

[root@bqe6tewv41kx apr-iconv-1.2.1]#make && make install

一、编译安装apache服务

 

 1)软件下载

[root@bqe6tewv41kx ~]#wget http://mirrors.sohu.com/apache/httpd-2.4.20.tar.gz

2) 创建apache用户

[root@bqe6tewv41kx ~]#useradd -r -s /sbin/nologin apache

3) 编译httpd2.4

[root@bqe6tewv41kx ~]#tar xf httpd-2.4.20.tar.gz

[root@bqe6tewv41kx httpd-2.4.20]#

[root@bqe6tewv41kx httpd-2.4.20]#make && make install

4)启动mysq服务

[root@bqe6tewv41kx httpd-2.4.20]# /usr/local/apache/bin/apachectl start

 

在CentOS6.7操作系统上编译安装httpd2.4