转载

1.先进入/usr/local/中创建三个文件夹 apr apr-util apache

cd /usr/local目录

mkdir apr

mkdir apr-util

mkdir apache

2.再进入 src中  cd src

3.在 src中 下载apr-1.6.5   apr-util-1.6.1  httpd-2.4.37源码包

wget http://archive.apache.org/dist/apr/apr-1.6.5.tar.gz

wget http://archive.apache.org/dist/apr/apr-util-1.6.1.tar.gz

wget  http://archive.apache.org/dist/httpd/httpd-2.4.37.tar.gz

4.分别解压它们

tar -zxvf apr-1.6.5.tar.gz

tar -zxvf apr-util-1.6.1.tar.gz

tar -zxvf httpd-2.4.37.tar.gz

5. 先不要急着安装,先确保它所依赖的库是否有,怎样查看软件是否安装(rpm -q xxx),如果没有安装依赖则进行安装(笔者一般安装依赖库直接使用yum 默认安装,这样在软件安装的时候就不需要知道依赖库的安装路径,省去不少麻烦)

需要安装的依赖包有 gcc  expat-devel  openssl-devel pcre pcre-devel

在src目录下 yum install gcc

yum install -y expat-devel

yum install openssl-devel

yum install -y pcre pcre-devel

yum install pcre-devel

6.接下来就是编译安装了,步骤四步: 下载wget  --- 加压tar ------ 编译 make ----安装 make install

进入 apr-1.6.5目录中

cd apr-1.6.5

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

make && make install

(此时没有报任何error错误)

7. 退出apr-1.6.5目录,进入 apr-util-1.6.1目录中

cd apr-util-1.6.1

./configure --prefix=/usr/local/apr-util  --with-apr=/usr/local/apr/

make && make install

(此时也没有任何error错误)

8.下面开始对Apache进行安装配置,可以使用

cd httpd-2.4.37

./configure \
--prefix=/usr/local/apache/ \
--with-apr=/usr/local/apr/ \
--with-apr-util=/usr/local/apr-util/ \
--enable-so \
--enable-ssl\
--enable-deflate=shared \
--enable-expires=shared \
--enable-rewrite=shared \
--enable-static-support

检查无误,然后开始编译安装

make && make install

9.等安装完以后进入到安装目录,开启apache服务

cd /usr/local/apache/bin/

./apachectl start

10. 哎,发现报错

AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain. Set the 'ServerName' directive globally to suppress this message

额,原来就是配置文件中没有serverName,那就在httpd.conf 中增加 ServerName

11.  vim /usr/local/apache/conf/httpd.conf

#增加

ServerName wx.xxxx.club (就是增加域名)

12. 完了之后再重新启动apache,发现一切正常,然后我们访问下看看是否OK

当输入域名时显示it works! ,就表示apache源码安装就此完成,

记住 想要重启apache 必须切换到

cd /usr/local/apache/bin/ 目录

使用

./apachectl start 开启apache

./apachectl restart 重启apache

./apachectl configtest  检测apache配置文件语法是否正确

apache源码安装 转载的更多相关文章

  1. apache源码安装必须依赖的库apr----/etc/ld.so.conf 文件介绍

    Apache所依赖的库,封装了各个系统相关的API等.虽然都是Apache开发的,但是现在最新版本的Apache和APR源码是分开的.要编Apache就必须使用APR. /etc/ld.so.conf ...

  2. Apache源码安装--httpd-2.2.34

    一.下载源码包 二.将源码包移动/usr/src/目录 三.解压源码包,并进入目录:tar -xzvf httpd-2.2.34.tar.gz,cd httpd-2.2.34 四.安装依赖包:yum ...

  3. centos apache源码安装过程记录

    1.下载相关源文件 wget http://mirror.bjtu.edu.cn/apache/httpd/httpd-2.4.18.tar.gzwget http://mirrors.hust.ed ...

  4. win7 php5.5 apache 源码安装 imagick扩展

    最近公司项目有用到php 的imagick,折腾了好长时间才把扩展装上,最主要的就是最新的不一定是最合适的,最开始一直找最新包安装,一直都不成功,经过google了好长时间,终于找到一个有用的,灵机一 ...

  5. Apache 源码安装

    8.20]# make[root@yahoo pcre-8.20]# make install 二.安装apache1.下载httpd-2.4.3.tar.gz,地址是:http://httpd.ap ...

  6. apache源码安装

    1.apr和apr-util,下载地址: http://apr.apache.org/download.cgi yum install gcc yum install libtool yum inst ...

  7. linux下源码安装apache服务

    1.搭建静态网站是,我们只需要搭建apache服务即可满足要求. 例如:如果我再客户端游览器输入地址,他会找到192.168.1.100这个服务器,然后根据端口会找到apache服务器.apache他 ...

  8. CentOS 6.3下源码安装LAMP(Linux+Apache+Mysql+Php)环境【转载】

    本文转载自 园友David_Tang的博客,如有侵权请联系本人及时删除,原文地址: http://www.cnblogs.com/mchina/archive/2012/11/28/2778779.h ...

  9. 烂泥:php5.6源码安装与apache集成

    本文由秀依林枫提供友情赞助,首发于烂泥行天下. apache对php的支持是通过apache的mod_php5模块来支持的,这点与nginx不同.nginx是通过第三方的fastcgi处理器才可以对p ...

随机推荐

  1. Axure(一)

    axure1.原型工具 2.软件开发 1.可行性分析2.需求分析    产品经理(和甲方对接需求,)    乙方     --   甲方 ps(专业性强,精美)  设计师        html(可变 ...

  2. HttpClient 释放连接

    Release the Connection:释放连接 This is a crucial step to keep things flowing. We must tell HttpClient t ...

  3. mysql explain解析一 extra中的using index,using where,using index condition

    1.简单介绍 using index 和using where只要使用了索引我们基本都能经常看到,而using index condition则是在mysql5.6后新加的新特性,我们先来看看mysq ...

  4. mac系统下Eclipse + pydev配置python Interpreter

    mac系统下Eclipse + pydev配置python Interpreter   之前都在windows下使用Eclipse + pydev 进行开发,未发现什么异常,最近对wxpy.itcha ...

  5. 1、linux基础优化

    1.添加一个用户 [root@oldboy ~]# useradd oldboy [root@oldboy ~]# id oldboy uid=500(oldboy) gid=500 (oldboy) ...

  6. git push 到 github

    今天来简单整理一下,如何利用git命令把代码提交到GitHub平台上去,当然要提交代码到GitHub上去,您首先得要有GitHub账号,账号如何申请这里就不多做解释了 第一步:先到官网下载git安装包 ...

  7. poj 1458 Common Subsequence(dp)

    Common Subsequence Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 46630   Accepted: 19 ...

  8. switch的参数类型

    switch(expr1)中,expr1是一个整数表达式,整数表达式可以是int基本类型或Integer包装类型,由于,byte,short,char都可以隐含转换为int,所以,这些类型以及这些类型 ...

  9. Redis的部署使用文档

    Redis的部署使用文档   简述: redis是一个key-value存储系统.和Memcached类似,它支持存储的value类型相对更多,包括string(字符 串).list(链表).set( ...

  10. WDigest

    WDigest 是windows在XP系统中应用的,其作用主要是与超文本传输协议(HTTP)和简单的身份验证安全层(SASL)一起交换使用.而Digest与NTLM协议类似,也是挑战认证协议. 简单说 ...