转载

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. PHP之常用操作

    在最高权限下执行相关命令 1)查看PHP配置 php --ini Configuration File (php.ini) Path: /www/server/php//etc Loaded Conf ...

  2. vue中v-if和v-for优先级

    v-for和v-if不应该一起使用,必要情况下应该替换成computed属性.原因:v-for比v-if优先,如果每一次都需要遍历整个数组,将会影响速度,尤其是当之需要渲染很小一部分的时候.   错误 ...

  3. 第三篇 HTML 表单及表格

    表单及表格 表单,常用在登录.注册等地方,这也是一个最基本的.   我们就用登录,来学习什么是表单!   表单 form 标签,在某些好用的编辑工具,比如:WebStorm  你在上面写出form再按 ...

  4. dubbo学习笔记二(服务调用)

    项目结构 代码示例 由于之前的IEchoService 的一个方法只是在服务端控制台打印,不便在浏览器测试,所以新添加的方法 api和服务端代码变更 public interface IEchoSer ...

  5. Zookeeper启动失败,报错 can not open chanel to 2

    zookeeper 3.4.8 安装在 7 台不同的虚拟机上,配置文件如下: tickTime= initLimit= syncLimit= dataDir=/var/zookeeper client ...

  6. python用jdbc读取oracle表和列的信息,生成java代码

    这个项目的地址 传送门 第一个python3项目,对python 还是学习中,请大佬轻喷,欢迎指点 import jaydebeapi from .database import Database d ...

  7. java 文件上传与解析(excel,txt)

    excel上传与解析 https://blog.csdn.net/zsysu_it/article/details/79074067 txt解析 https://blog.csdn.net/CSDNw ...

  8. 宝塔linux面板命令大全 - 宝塔面板

    安装宝塔 Centos安装脚本 yum install -y wget && wget -O install.sh http://download.bt.cn/install/inst ...

  9. Puppet部署:安装puppet server、client

    Puppet部署:安装puppet server.client   puppet与其他手工操作工具有一个最大的区别就是 puppet的配置具有稳定性,因此你可以多次执行puppet,一旦你更新了你的配 ...

  10. python基础(变量、基础数据类型、流程控制)

    今日内容html {overflow-x: initial !important;}:root { --bg-color:#ffffff; --text-color:#333333; --select ...