我们的系统平台是在centos7.5的环境下安装httpd2.4版本的软件,2.4版本的软件有一个特征就是需要安装arp包以及arp-util包才可以。

1、首先是下载httpd2.4版本的包,以及安装开发环境,这里开发环境直接使用组安装“Development tools”即可,(注意centos6是安装“Development tools和Server Platform Development”两种开发环境)

wget http://ftp.cuhk.edu.hk/pub/packages/apache.org//httpd/httpd-2.4.37.tar.gz
yum groupinstall "Development tools"

2、解压到指定目录/usr/local目录下

tar -zxf httpd-2.4..tar.gz -C /usr/local

3、在/usr/local目录下创建一个httpd目录,然后在刚刚解压的目录里面开始执行configure检测依赖环境

./configure --prefix=/usr/local/httpd

发现报错:

configure:
configure: Configuring Apache Portable Runtime Utility library...
configure:
checking for APR-util... no
configure: error: APR-util not found. Please read the documentation.
configure:
configure: Configuring Apache Portable Runtime library...
configure:
checking for APR... no
configure: error: APR not found. Please read the documentation.

缺少apr-util包和apr包,那我们来安装即可

yum install apr apr-util apr-devel apr-util-devel

这两个包很重要,所以大家一定要记住。也有的人是下载apr源码包编译的,都是可以的。

4、继续执行configure检测环境

[root@:vg_adn_tidbCkhsTest:172.31.30.62 /usr/local/httpd-2.4.]#./configure --prefix=/usr/local/httpd
config.status: creating build/config_vars.sh
config.status: creating include/ap_config_auto.h
config.status: executing default commands
configure: summary of build options: Server Version: 2.4.
Install prefix: /usr/local/httpd
C compiler: gcc
CFLAGS: -pthread
CPPFLAGS: -DLINUX -D_REENTRANT -D_GNU_SOURCE
LDFLAGS:
LIBS:
C preprocessor: gcc -E

哈哈,终于编译成功了,继续安装

5、接下来执行make命令完成项目构建

[root@:vg_adn_tidbCkhsTest:172.31.30.62 /usr/local/httpd-2.4.]#make
/usr/lib64/apr-/build/libtool --silent --mode=link gcc  -pthread           -o mod_rewrite.la -rpath /usr/local/httpd/modules -module -avoid-version  mod_rewrite.lo
make[]: Leaving directory `/usr/local/httpd-2.4./modules/mappers'
make[]: Leaving directory `/usr/local/httpd-2.4./modules/mappers'
make[]: Leaving directory `/usr/local/httpd-2.4./modules'
make[]: Entering directory `/usr/local/httpd-2.4./support'
make[]: Leaving directory `/usr/local/httpd-2.4./support' make[]: Leaving directory `/usr/local/httpd-2.4.'

看到这里说明编译成功了。

6、执行make install 安装

[root@:vg_adn_tidbCkhsTest:172.31.30.62 /usr/local/httpd-2.4.]#make install
Installing man pages and online manual
mkdir /usr/local/httpd/man
mkdir /usr/local/httpd/man/man1
mkdir /usr/local/httpd/man/man8
mkdir /usr/local/httpd/manual
make[]: Leaving directory `/usr/local/httpd-2.4.'

安装成功。

7、看下安装的目录

[root@:vg_adn_tidbCkhsTest:172.31.30.62 /usr/local]#cd httpd
[root@:vg_adn_tidbCkhsTest:172.31.30.62 /usr/local/httpd]#ls
bin build cgi-bin conf error htdocs icons include logs man manual modules
[root@:vg_adn_tidbCkhsTest:172.31.30.62 /usr/local/httpd]#cd bin
[root@:vg_adn_tidbCkhsTest:172.31.30.62 /usr/local/httpd/bin]#ls
ab apxs dbmmanage envvars-std htcacheclean htdigest httpd logresolve
apachectl checkgid envvars fcgistarter htdbm htpasswd httxt2dbm rotatelogs
[root@:vg_adn_tidbCkhsTest:172.31.30.62 /usr/local/httpd/bin]#

8、我们看到了安装的目录里面有我们想要的文件,但是到这里还没有完成,我们还有一些后续工作需要做。

9、设置环境变量

[root@:vg_adn_tidbCkhsTest:172.31.30.62 /usr/local/httpd/bin]#cd /etc/profile.d/
[root@:vg_adn_tidbCkhsTest:172.31.30.62 /etc/profile.d]#ls
256term.csh colorgrep.csh colorls.csh csh.local lang.sh less.sh sh.local vim.sh which2.sh
256term.sh colorgrep.sh colorls.sh lang.csh less.csh path.sh vim.csh which2.csh
[root@:vg_adn_tidbCkhsTest:172.31.30.62 /etc/profile.d]#vim httpd.sh
[root@:vg_adn_tidbCkhsTest:172.31.30.62 /etc/profile.d]#cat httpd.sh
HTTPD_HOME=/usr/local/httpd
PATH=$PATH:$HTTPD_HOME/bin

最后记得source一下立即生效。

10、建立库文件信息(以.so结尾的文件)

一般上我们运行程序,Linux系统会在特定的路径下为应用查找所以来的库文件:/usr/lib、/usr/lib64、/lib、/lib64这四个目录下面,但是自己编译安装的程序提供的库文件有可能不在系统搜索的路径中,因此我们需要在系统里面添加一下。注意以.conf结尾。

[root@:vg_adn_tidbCkhsTest:172.31.30.62 /usr/local/httpd/modules]#cd /etc/ld.so.conf.d/
[root@:vg_adn_tidbCkhsTest:172.31.30.62 /etc/ld.so.conf.d]#ls
dyninst-x86_64.conf kernel-3.10.-862.3..el7.x86_64.conf mysql-x86_64.conf
[root@:vg_adn_tidbCkhsTest:172.31.30.62 /etc/ld.so.conf.d]#echo /usr/local/httpd/modules > httpd-2.4..conf
[root@:vg_adn_tidbCkhsTest:172.31.30.62 /etc/ld.so.conf.d]#cat httpd-2.4..conf
/usr/local/httpd/modules
[root@:vg_adn_tidbCkhsTest:172.31.30.62 /etc/ld.so.conf.d]#

11、然后重新执行ldconfig命令重新生成映射缓存ld.so.conf

[root@:vg_adn_tidbCkhsTest:172.31.30.62 /etc/ld.so.conf.d]#ldconfig

12、除了我们刚刚设置的环境变量、库文件外,我们还需要设置头文件信息。我们这里复制头文件过去即可。

[root@:vg_adn_tidbCkhsTest:172.31.30.62 /usr/local/httpd/include]#ls
apache_noprobes.h ap_expr.h ap_regkey.h http_core.h mod_auth.h util_cookies.h util_script.h
ap_compat.h ap_hooks.h ap_release.h httpd.h mod_core.h util_ebcdic.h util_time.h
ap_config_auto.h ap_listen.h ap_slotmem.h http_log.h mod_request.h util_fcgi.h util_varbuf.h
ap_config_auto.h.in ap_mmn.h ap_socache.h http_main.h mpm_common.h util_filter.h util_xml.h
ap_config.h ap_mpm.h heartbeat.h http_protocol.h scoreboard.h util_ldap.h
ap_config_layout.h ap_provider.h http_config.h http_request.h util_cfgtree.h util_md5.h
ap_config_layout.h.in ap_regex.h http_connection.h http_vhost.h util_charset.h util_mutex.h
[root@:vg_adn_tidbCkhsTest:172.31.30.62 /usr/local/httpd/include]#mkdir /usr/include/httpd
[root@:vg_adn_tidbCkhsTest:172.31.30.62 /usr/local/httpd/include]#cp ./* /usr/include/httpd/

其实我们就是把httpd安装目录下的include目录的所有头文件复制一份,放置在/usr/include/httpd目录下,注意,这个httpd需要提前创建好。

13、最后就是man手册了,Centos7下面的man手册配置文件是/etc/man_db.conf文件,我们修改一下即可。

Centos7源码安装httpd2.4版本web服务器的更多相关文章

  1. CentOS7源码安装qbittorrent最新版本

    CentOS的软件 yum 里 yum search qbittorrent yum info qbittorrent 找到的是3.37版本 官网最新的是4.12版本.但需要源码安装: 官网下载最新版 ...

  2. CentOS7 实战源码安装mysql5.7.17数据库服务器

    CentOS7 实战源码安装mysql5.7.17数据库服务器 简介:实战演练mysql数据库服务器的搭建  mysql简介: mysql是一个开源的关系型数据库管理系统,现在是oracle公司旗下的 ...

  3. centos7源码安装Python3的前提条件

    centos7源码安装Python3的前提条件: # yum -y install openssl-devel bzip2-devel expat-devel gdbm-devel readline- ...

  4. centos7 源码安装指定版本的php7

    很多时候可能会遇到需要手动源码安装软件的时候,所以自己实践了一把,并且把安装过程中遇到的问题,以及在网上找到的解决办法(实测有效)都记录下来,方便日后学习实践. 1. 系统环境 # cat /etc/ ...

  5. centos7源码安装mysql5.7.19

    centos7源码包安装mysql5.7 5.7.20安装方法和5.7.19的一样. 1.安装前准备 清空环境.安装相应的软件包 1>关闭防火墙和SELinux 2>配置yum源(阿里云, ...

  6. Centos7源码安装mysql及读写分离,互为主从

       Linux服务器 -源码安装mysql 及读写分离,互为主从   一.环境介绍: Linux版本: CentOS 7 64位 mysq版本: mysql-5.6.26 这是我安装时所使用的版本, ...

  7. Centos6.6上源码安装Nodejs V4版本

    本来就是想在vps上装一个Ghost博客,这个博客依赖的是Nodejs,然后推荐的是V4版本.然后我就对着官网的步骤安装,发现根本没有Centos6 i386的资源了(64位的还是有的), 我只能在那 ...

  8. CentOS7 源码安装 PostgreSQL 12

    PostgreSQL 12 源码安装 Table of Contents 1. 下载 2. 准备环境 3. 编译安装 4. 设置环境变量 5. 初始化数据库 6. 配置参数文件 6.1. postgr ...

  9. Centos7源码安装Apache和PHP

    源码安装Apache 安装需要的依赖 yum -y install gcc autoconf automake make pcre pcre-devel openssl openssl-devel​# ...

随机推荐

  1. 第3章:Hadoop分布式文件系统(2)

    数据流 读取文件数据的剖析 为了知道客户端与HDFS,NameNode,DataNode交互过程中数据的流向,请看图3-2,这张图显示了读取文件过程中主要的事件顺序. 客户端通过调用FileSyste ...

  2. .net 多线程的使用(Thread)

    上篇 net 同步异步 中篇 多线程的使用(Thread) 下篇 net 任务工厂实现异步多线程 Thread多线程概述 上一篇我们介绍了net 的同步与异步,我们异步演示的时候使用的是委托多线程来实 ...

  3. 关于电脑重装win10系统导致编译环境失效(jdk)

    年前换了固态,于是重装了系统发现之前装在非系统盘的jdk1.8配置过系统环境后仍然不能正常使用的问题,在犹豫一会后选择了重装jdk, 由于之前用的是win7在环境配置上是 变量值内加;即可自行分行,但 ...

  4. 求解方程A5+B5+C5+D5+E5=F5

    方程A5+B5+C5+D5+E5=F5刚好有一个满足0<A≤B≤C≤D≤E≤F≤75的整数解.请编写一个求出该解的程序: using System; namespace ReverseTheEx ...

  5. HDU3001(KB2-J 状态压缩dp)

    Travelling Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total ...

  6. layui点击弹框页面 表单请求

    $("#addSite").click(function () { layer.open({ title: '添加站点', type: 1, area: ['700px', '40 ...

  7. [World Final 2016] Branch Assignment

    链接 PDF bzoj 先求出正置边和反置边时b+1到前b个点的最短路dis[0/1][x](x∈[1,b]), 令D[x]=dis[0][x]+dis[1][x] 然后分组后每个x对代价的贡献为D[ ...

  8. css翻译名词术语

    原文 本书译法 其它译法(未采用) CSS - 层叠样式表.级联样式表.样式单 cascade 层叠(机制) 级联 fallback 回退(机制.措施.方案) 后备.回落.降级 selector 选择 ...

  9. mysql数据库操作指令

    数据库相关 查询所有数据库 show databases; 创建数据库 create database 数据库名: 创建数据库指定字符集 create database 数据库名 character ...

  10. 去除img默认的边框

    //当img属性src没有值时,会有难看的边框和难看的一个小图 有什么办法去掉呢? <img  src=" " /> //不要这样写 <img   />  ...