查看是否安装 rpm -qa httpd
        如果已安装,则卸载:rpm -e 卸载  --nodeps 不考虑意外
        下载 wget http://mirrors.sohu.com/apache/httpd-2.2.31.tar.gz
            查看大小 ll -sh
        解压 tar xvf
        查看文件readme、install以了解该软件安装方式。
        编译环境部署及若干参数解析:
            ./configure
            --prefix=/application/apache2.2.31  //安装的目录
            --enable-deflate //压缩  对文本压缩
            --enable-expires //过期  浏览器缓存多久
            --enable-headers //激活头
            --enable-modules //激活大多数模块
            --enable-so      //
            --with-mpm=worker //由进程生成的线程(worker)提供服务
            --enable-rewrite  //激活rewrite功能(伪静态)
            
            查看错误:echo $? 或error
            configure: error: in `/root/httpd-2.2.31/srclib/apr':
            configure: error: no acceptable C compiler found in $PATH
            See `config.log' for more details
            configure failed for srclib/apr
                解决办法:yum -y install gcc
            再次检查部署环境,还有错误
            checking for zlib location... not found
            checking whether to enable mod_deflate... configure: error: mod_deflate has been requested but can not be built due to prerequisite failures
                解决办法:yum -y install zlib-devel
        make
        make install
        创建软链接:ln -sv apache2.2.31 apache
        查看安装目录 ls          (emeditor软件)
        检查语法:/application/apache/bin/apachectl -t
        启动:/application/apache/bin/apachectl start
            或:/application/apache/bin/httpd -k start
        存在以下错误,不过没关系:
            httpd: apr_sockaddr_info_get() failed for min
            httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
        
        查看是否启动:lsof -i :80    或 ps -ef | grep httpd
        root     30976     1  0 07:51 ?        00:00:00 /application/apache2.2.31/bin/httpd -k start
        daemon   30977 30976  0 07:51 ?        00:00:00 /application/apache2.2.31/bin/httpd -k start
        daemon   30978 30976  0 07:51 ?        00:00:00 /application/apache2.2.31/bin/httpd -k start
        daemon   30979 30976  0 07:51 ?        00:00:00 /application/apache2.2.31/bin/httpd -k start
        daemon   30980 30976  0 07:51 ?        00:00:00 /application/apache2.2.31/bin/httpd -k start
        root     31064  1464  0 07:54 pts/0    00:00:00 grep httpd
        从结果来看已经启动。
        
        在浏览器上访问主机ip,显示 It works!
        
        如果错误,按照以下方式检查:
            1、检查iptables防火墙
            2、检查selinux getenforce
            3、检查端口 80
            4、检查进程
            5、wget或curl
        
        查看已经生效的模块:/application/apache/bin/apachectl -l
            重点查看以下模块:
                /application/apache/bin/apachectl -l|egrep "so|rewrite|header|expire|deflate"
                    mod_deflate.c
                    mod_expires.c
                    mod_headers.c
                    mod_rewrite.c
                    mod_so.c
                
        跟踪进程使用情况 strace
            strace /application/apache/bin/apachectl -M
    
    部署站点:
        cd /application/apache
        cd conf/    //查看配置文件
        grep -i documentroot httpd.conf    //查看网站的根目录
            DocumentRoot "/application/apache2.2.31/htdocs"
        进入网站的根目录,放入网站文件
        刷新浏览器,成功。

apache源码编译安装详解的更多相关文章

  1. linux http服务源码编译安装详解

    相信大家大多都听过linux 的编译安装,但它到底是怎么把源代码变为自己电脑里可以应用的软件哪?今天,小编就以httpd 为例详细讲解一下. 什么是编译安装——编译:将源代码变为机器可执行的代码文件. ...

  2. apache源码编译安装

    源码安装apche 下载apache的源码包文件 访问http://mirror.bit.edu.cn/apache/httpd/,复制如下gz文件的链接地址,并使用wget下载到本地 wget -P ...

  3. 基于cdh5.10.x hadoop版本的apache源码编译安装spark

    参考文档:http://spark.apache.org/docs/1.6.0/building-spark.html spark安装需要选择源码编译方式进行安装部署,cdh5.10.0提供默认的二进 ...

  4. Apache源码编译安装脚本

      Apache是开源的的.最流行的Web服务器软件之一,它快速.可靠并且可通过简单的API扩充,将Perl/Python/PHP等解释器编译到服务器中.Apache的模块超多,以及具有运行稳定,强大 ...

  5. QGIS源码编译步骤详解——官方新方案

    目录 源码下载 环境下载 Cygwin64 OSGeo4W CMAKE Visual Studio 2017 环境配置 配置 编译   方案详细可见源码文件中INSTALL.md. 源码下载   QG ...

  6. centos 7.1 apache 源码编译安装

    Apache编译安装 一,需要软件: http://mirrors.cnnic.cn/apache//apr/apr-1.5.2.tar.gz 1.apr-1.5.2.tar.gz http://mi ...

  7. 源码编译安装MySQL8.0.20

    1 概述 本文章主要讲述了如何从源码编译安装MySQL社区版8.0.20,首先会介绍一些编译安装的相关知识,然后开始编译安装 2 源码编译安装的相关知识 2.1 make与configure make ...

  8. centos7源码编译安装lamp/lnmp

    centos7源码编译安装lamp/lnmp 进程:是包工头(相当于是个门,只管开门关门,不管门内的事儿) 线程:是各种工种(cpu调度的是线程) 进程 是一件事情, 线程 是 同一个时间范围内 同时 ...

  9. Centos7.X 源码编译安装subversion svn1.8.x

    说明:SVN(subversion)的运行方式有两种:一种是基于Apache的http.https网页访问形式:还有一种是基于svnserve的独立服务器模式.SVN的数据存储方式也有两种:一种是在B ...

随机推荐

  1. Android应用架构

    Android开发生态圈的节奏非常之快.每周都会有新的工具诞生,类库的更新,博客的发表以及技术探讨.如果你外出度假一个月,当你回来的时候可能已经发布了新版本的Support Library或者Play ...

  2. app:layout_scrollFlags不起作用

    http://stackoverflow.com/questions/31722798/enteralwayscollapsed-does-not-bring-back-the-toolbar-whe ...

  3. google python/c++ code style naming

    python: Guidelines derived from Guido's Recommendations Type Public Internal Packages lower_with_und ...

  4. 【HDOJ】2732 Leapin' Lizards

    贪心+网络流.对于每个结点,构建入点和出点.对于每一个lizard>0,构建边s->in position of lizard, 容量为1.对于pillar>0, 构建边in pos ...

  5. C++ Prime:范围for语句

    C++11新标准引入了一种更简单的for语句,这种语句可以遍历容器或者其他序列的所有元素.范围for语句的语法形式是: for( declaration : expression) statement ...

  6. SPOJ_10628_Count_on_a_Tree_(主席树+Tarjan)

    描述 http://www.spoj.com/problems/COT/ 给出一棵n个节点的树,树上每一个节点有权值.m次询问,求书上u,v路径中第k小的权值. COT - Count on a tr ...

  7. android学习——必学基础组件

    android基础组件是一个Android的开发人员必须要了解,且深刻理解的东西: 1.应用程序基础 2.应用程序组件 2.1.活动(Activities) 2.2.服务(Services) 2.3. ...

  8. RIDE常用快捷键

    重命名: F2 搜索关键字: F5 执行用例: F8 创建新工程: Ctrl+N 创建新测试套: Ctrl+Shift+F 创建新用例: Ctrl+Shift+T 创建新关键字: Ctrl+Shift ...

  9. 向老项目JSP集成JSTL遇到的问题

    today,I Failed to load or instantiate TagLibraryValidator class - JstlCoreTLV <%@ page contentTyp ...

  10. C语言、Java的编译系统

    Java是跨平台的. Java代码的编译是由Java语言的编译器来执行的,执行后生成的是.class文件,该文件是字节码文件. 然后交给虚拟机进行运行,虚拟机是在各个平台上可移植的.从而决定了Java ...