zoukankan      html  css  js  c++  java
  • Ubuntu 16.04安装httpd

    1.下载httpd源码(当前版本为2.4.37)

    http://httpd.apache.org/download.cgi

    2.解压编译

    tar -zxf httpd-2.4.37.tar.gz
    cd httpd-2.4.37
    ./configure --prefix=/usr/local/apache2

    如果出现报错 error: APR not found,则需要安装下面的依赖库

     

    3.依赖库

    wget http://archive.apache.org/dist/apr/apr-1.4.5.tar.gz
    tar -zxf apr-1.4.5.tar.gz  
    cd  apr-1.4.5  
    ./configure --prefix=/usr/local/apr  
    make && make install

    wget http://archive.apache.org/dist/apr/apr-util-1.3.12.tar.gz
    tar -zxf apr-util-1.3.12.tar.gz
    cd apr-util-1.3.12
    ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/
    make && make install

    wget http://jaist.dl.sourceforge.net/project/pcre/pcre/8.10/pcre-8.10.zip
    unzip -o pcre-8.10.zip
    cd pcre-8.10
    ./configure --prefix=/usr/local/pcre
    make && make install

     

    4.编译

    cd httpd-2.4.37
    ./configure --prefix=/usr/local/httpd --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre --enable-ssl --with-ssl=/usr/local/openssl
    make && make install

     

    5.如果报以下错误

    checking for OpenSSL version >= 0.9.7… FAILED
    configure: WARNING: OpenSSL version is too old
    no
    checking whether to enable mod_ssl… configure: error: mod_ssl has been requested but can not be built due to prerequisite failures

    则解决办法为:

    apt-get install openssl
    apt-get install libssl-dev

     

    6.检验是否安装成功

    ①启动httpd

    /usr/local/httpd/bin
    ./httpd -k start

    ②使用浏览器打开对应地址,显示如下表示成功。

    以上。

  • 相关阅读:
    DDOS和cc攻击的防御
    shell脚本基础知识
    MySQL常用的查询命令
    shell常见脚本30例
    shell中的函数
    shell中的数字
    shell中的ps3为何物以及select循环
    FPGA设计经验谈 —— 10年FPGA开发经验的工程师肺腑之言
    FPAG结构 组成 工作原理 开发流程(转)
    modelsim仿真中 do文件的写法技巧
  • 原文地址:https://www.cnblogs.com/chevin/p/10222681.html
Copyright © 2011-2022 走看看