一、安装

  安装之前先将服务器的防火墙关掉。

  systemctl  stop  firewalld

  systemctl  disable  firewall

第一步:

  安装apr

    下载:

    wget -c http://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-1.6.3.tar.bz2

    解压该文件:

    tar -jvxf apr-1.6.3.tar.bz2
    检测:

    cd apr-1.6.3
    ./configure --prefix=/usr/local/apr/
    编译:

    make
    make install

第二步:

  安装apr-util

    下载:

    wget -c http://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-util-1.6.1.tar.bz2

    解压该文件:
    tar -jvxf apr-util-1.6.1.tar.bz2

    检测:
    cd apr-util-1.6.3
    ./configure --prefix=/usr/local/apr-util/ --with-apr=/usr/local/apr/

    编译:
    make
    make install

第三步:

  安装pcre

    下载:

    wget -c http://ftp.pcre.org/pub/pcre/pcre-8.42.tar.bz2

    解压该文件:
    tar -jvxf pcre-8.42.tar.bz2

    检测:
    cd pcre-8.42
    ./configure --prefix=/usr/local/pcre/

    编译:
    make
    make install

第四步:
  安装httpd

    下载:

    wget -c http://mirrors.cnnic.cn/apache/httpd/httpd-2.4.29.tar.bz2

    解压该文件:
    tar -jvxf httpd-2.4.29.tar.bz2

    检测:
    cd httpd-2.4.29
    ./configure --prefix=/usr/local/httpd/ --with-apr=/usr/local/apr/ --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre/

    编译:
    make
    make install

第五步:

  配置/usr/local/apache2/conf/httpd.conf

      ServerName www.examda.com:80
      改为
      ServerName localhost:80

第六步:

  启动apache服务

    /usr/local/apache2/bin/apachectl start


二、检测

  使用浏览器访问本地IP

  出现It works!成功


三、报错处理

  (1)configure: error: APR not found. Please read the documentation.

    这是没有安装apr或者apr安装失败导致的,重新安装apr。

      安装请查看第一步。

  (2)configure: error: APR-util not found. Please read the documentation.

    这是没有安装apr-util或者apr-util安装失败导致的,重新安装apr-util。

      安装请查看第二步。

  (3)configure: error: no acceptable C compiler found in $PATH

    这是没有安装gcc编译器或者gcc编译器安装失败导致的,重新安装gcc。

      yum  install  -y  gcc

  (4)xml/apr_xml.c:35:19: 致命错误:expat.h:没有那个文件或目录

    这是没有安装expat-devel或者expat-devel安装失败导致的,重新安装expat-devel。

      yum  install  -y  expat-devel

  (5)configure: error: Invalid C++ compiler or C++ compiler flags

    这是没有安装gcc-c++或者gcc-c++安装失败导致的,重新安装gcc-c++

      yum  install  -y  gcc-c++

  (6)configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/

    这是没有安装pcre或者pcre安装失败导致的,重新安装pcre。

      安装请查看第三步。

centos7编译安装Apache的更多相关文章

  1. linux中编译安装Apache、PHP、MySQL(上)

    1.简介 在阿里云买了个云服务器,一直没时间折腾.过了近十天了吧,才有时间好好玩玩这个云服务器.自己是做Web开发的,所以我需要的开发环境是LAMP.之前打算是采用yum安装,不过yum安装apach ...

  2. centos7 编译安装新版LNMP环境

    centos7 编译安装新版LNMP环境 环境版本如下: 1.系统环境:Centos 7 x86_64 2.NGINX:nginx-1.11.3.tar.gz 3.数据库:mariadb-10.0.2 ...

  3. centos手动编译安装apache、php、mysql

    64位centos 5.5手动安装lamp,要求curl.json.pdo_mysql.gd,记录如下. centos 5.4.5.5.5.6的内核都是2.6.18,都可以安装php 5.3. 卸载旧 ...

  4. Linux下编译安装Apache Http Server

    Linux下编译安装Apache Http Server [TOC] 1.下载httpd-2.4.12.tar.bz2 wget http://mirror.bit.edu.cn/apache/htt ...

  5. CentOS7编译安装Nginx-1.8.1和编译参数

    CentOS7编译安装Nginx-1.8.1和编译参数 Web服务器Nginx    LNMP是一组众所周知的Web网站服务器架构环境,即由Linux+Nginx+MySQL+PHP(MySQL有时也 ...

  6. centos7编译安装MySQL5.7.9

    title: centos7编译安装MySQL5.7.9 date: 2016-05-12 16:20:17 tags: --- Centos7编译安装mysql5.7.9 mysql5.7有更好的性 ...

  7. Linux 通过编译安装apache服务以及配置

    Linux 编译安装apache服务 一.安装 1.通过编译安装,首先需要下载源代码安装包 apache下载链接:http://httpd.apache.org/download.cgi 2.解开源代 ...

  8. Linux学习之编译安装apache

    疯狂吐槽腾某云..编译安装apache折腾了一下午..还是我不太熟练. 首先要先准备好安装apache的三个依赖包以及apache包.(一定要准备好!!折腾了一下午的小白握拳!!) -rw-r--r- ...

  9. 编译安装Apache httpd和php搭建KodExplorer网盘

    编译安装Apache httpd和php搭建KodExplorer网盘 环境说明: 系统版本    CentOS 6.9 x86_64 软件版本    httpd-2.2.31        php- ...

随机推荐

  1. Stage6--Python简单爬虫

    正则表达式简单介绍 正则表达式(regular expression)描述了一种字符串匹配的模式,可以用来检查一个串是否含有某种子串.将匹配的子串做替换或者从某个串中取出符合某个条件的子串等. 字符 ...

  2. 【阿里云产品公测】服务器测性能,PTS多快好省

    作者:阿里云用户goldsix PTS(性能测试服务)的官方定位是:集测试机管理.测试脚本管理.测试场景管理.测试任务管理.测试结果管理为一体的性能云测试平台.  不管定义是否高大上,一般用户尤其是我 ...

  3. 我是一只IT小小鸟读书笔记3

    Part6: 一.    无论在什么时候,师兄师姐都是我们最好的资源,遇到不会的问题一定要及时向他们请教,善于利用身边的人脉关系也是一个基本的技能. 二.    爱好很多,但特长一定要有.仔细思考一下 ...

  4. postgres循环sql

    CREATE OR replace function loop_addDevice(i integer) RETURNS integer as $$ declare count alias ; all ...

  5. Uva 10294 Polya

    #include <bits/stdc++.h> using namespace std; typedef long long LL; int gcd(int a,int b) { ? a ...

  6. LG3690 【【模板】Link Cut Tree (动态树)】

    题目 终于去写\(LCT\)了 这个大爷讲的挺好的 板子 #include<algorithm> #include<iostream> #include<cstring& ...

  7. 【[ZJOI2014]力】

    题目 好神仙啊 \[F_{j}=\sum_{i<j}\frac{q_iq_j}{(i-j)^2}-\sum_{j<i}\frac{q_iq_j}{(i-j)^2}\] 求\(\frac{F ...

  8. 【[CTSC2000]冰原探险】

    noip前练一下码力还是非常有前途的 这道题本来就是想写个大暴力弃疗的,所以直接强上暴力浑身舒爽 结果发现要不是判重的时候脑残了,就能\(A\)了 没什么好说的呀,就是每一次都暴力\(O(n)\)往上 ...

  9. Playrix Codescapes Cup (Codeforces Round #413, rated, Div. 1 + Div. 2) C. Fountains 【树状数组维护区间最大值】

    题目传送门:http://codeforces.com/contest/799/problem/C C. Fountains time limit per test 2 seconds memory ...

  10. POJ 1088 滑雪 【记忆化搜索经典】

    题目链接:http://poj.org/problem?id=1088 滑雪 Time Limit: 1000MS   Memory Limit: 65536K Total Submissions:  ...