zoukankan      html  css  js  c++  java
  • 源码包安装httpd,apache

    1、安排装包下载位置(如果出现报错没有apr、apr-util、pcre可以下下载如下安装包)

    wget http://mirror.bit.edu.cn/apache//httpd/httpd-2.4.41.tar.gz
    wget http://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-1.7.0.tar.gz
    wget http://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-util-1.6.1.tar.gz
    wget https://sourceforge.net/projects/pcre/files/pcre/8.44/pcre-8.44.tar.gz

    2、源码安装httpd依赖包,解决报错没有apr、apr-util、pcre

    yum -y install gcc gcc-c++ make openssl openssl-devel

    tar -xf apr-1.7.0.tar.gz
    tar -xf apr-util-1.6.1.tar.gz
    tar -xf httpd-2.4.41.tar.gz

    2.1、编译安装apr
    cp -r apr-1.7.0 httpd-2.4.41/srclib/apr    (有时候编译安装httpd,指定apr、apr-util会报错,可以把解压包文件拷贝到httpd解压目录下)
    cp -r apr-util-1.6.1 httpd-2.4.41/srclib/apr-util

    cd apr-1.7.0/
    ./configure --prefix=/usr/local/apr && make && make install

    yum install expat-devel(解决安装apr-util报错)

    2.2、编译安装apr-util
    cd apr-util-1.6.1/
    ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr && make && make install

    2.3、编译安装pcre
    tar -xf pcre-8.44.tar.gz
    cd pcre-8.44/
    ./configure --prefix=/usr/local/pcre && make && make install

    3、编译安装apache
    cd httpd-2.4.41/
    ./configure --prefix=/usr/local/apache2 --with-pcre=/usr/local/pcre --with-included-apr --enable-so --enable-dav --enable-dav-fs --enable-maintainer-mode --enable-deflate=shared --enable-expires=shared --enable-headers=shared --enable-rewrite=shared --enable-static-support --with-mpm=prefork --enable-cache --enable-file-cache --enable-rewrite --enable-ssl --enable-proxy --enable-proxy-http --with-sqlite=/usr/local/sqlite/ --with-pcre=/usr/local/pcre/ && make && make install

    4、修改apache配置文件,开启apache
    vim /usr/local/apache2/conf/httpd.conf
    ServerName www.example.com:80 (去掉注释)
    /usr/local/apache2/bin/apachectl start (开启)
    /usr/local/apache2/bin/apachectl stop (关闭)

     

     

  • 相关阅读:
    Spring Boot重定向的使用方法
    Jmeter性能测试之Monitor监控(SSHMon Samples Collector)
    Jmeter性能测试之分布式(五)
    Jmeter性能测试之Monitor监控(四)
    Jmeter性能测试之关联(三)
    Jmeter性能测试之参数化(二)
    JVM 内存溢出(转载~)
    MySql workbeach 更改侧边栏大小
    Mybati example generatorConfig.xml 配置详解
    Rvm 进行gem安装时必须输入密码Your user account isn't allowed to install to the system RubyGems 解决方案
  • 原文地址:https://www.cnblogs.com/shinian12138/p/11316106.html
Copyright © 2011-2022 走看看