在CentOS 7 1804 中 源码 安装 Apache HTTP Server


  1. 安装相关依赖:
    yum -y install gcc expat-devel pcre-devel
    gcc:源码安装所需依赖(编译软件)
    expat-devel:源码安装apr-util所需依赖
    pcre-devel:源码安装httpd所需依赖
  2. 创建下载目录:
    mkdir -p /data/httpd
    cd /data/httpd
  3. apr下载与安装:
    网址:https://apr.apache.org/download.cgi
    wget http://mirrors.shu.edu.cn/apache//apr/apr-1.6.5.tar.gz
    tar -zxvf apr-1.6.5.tar.gz
    cd apr-1.6.5
     配置安装目录:
    ./configure --prefix=/usr/local/apr
     编译及安装:
    make && make install
  4. apr-util下载与安装:
    网站:https://apr.apache.org/download.cgi
    wget http://mirrors.shu.edu.cn/apache//apr/apr-util-1.6.1.tar.gz
    tar -zxvf apr-util-1.6.1.tar.gz
    cd apr-util-1.6.1
    配置安装目录:
    ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
      编译及安装:
    make && make install
  5. httpd下载与安装:
    网站:http://httpd.apache.org/download.cgi
    wget http://mirrors.shu.edu.cn/apache//httpd/httpd-2.4.35.tar.gz
    tar -zxvf httpd-2.4.35.tar.gz
    cd httpd-2.4.35
    配置安装目录:
    ./configure --prefix=/usr/local/apache2 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util
      编译及安装:
    make && make install

猜你喜欢

转载自blog.csdn.net/qq_32596527/article/details/83246408