CentOS 7.4下源码安装 Apache HTTP Server(httpd-2.4.35)

CentOS 7.4下源码安装 Apache HTTP Server(httpd-2.4.35)

  • 前提:确保安装了expat-devel, APR包 (apr-1.6.3.tar.gz 和 apr-util-1.6.1.tar.gz);
  • 用YUM方式安装expat-devel 和 apr-util-devel

    yum -y install expat-devel
    yum -y install apr-util-devel

  • 解压apr-1.6.3.tar.gz后进入该目录下,执行:

    ./configure --prefix=/usr/local/apr
    make
    make install

  • 解压apr-util-1.6.1.tar.gz后进入该目录下,执行:

    ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
    make
    make install

CentOS 7.4下源码安装 Apache HTTP Server(httpd-2.4.35)

  • 上述必要的组件和包安装完成后,开始进行apache http server 的安装

  • 获取Apache源码包 httpd-2.4.35.tar.bz2

wget http://mirrors.shu.edu.cn/apache/httpd/httpd-2.4.35.tar.bz2

CentOS 7.4下源码安装 Apache HTTP Server(httpd-2.4.35)

  • 解压源码包

    tar -jxvf httpd-2.4.35.tar.bz2

CentOS 7.4下源码安装 Apache HTTP Server(httpd-2.4.35)

扫描二维码关注公众号,回复: 3662962 查看本文章
  • 进入解压好的目录执行 configure, 完成configure后,执行make和make install

[root@centos7 httpd-2.4.35]# ./configure \
--prefix=/opt/httpd-2.4.35 \
--enable-so \
--enable-mods-shared=most \
--enable-proxy-http=shared \
--enable-rewrite

CentOS 7.4下源码安装 Apache HTTP Server(httpd-2.4.35)

  • 注意:
  • 一般在遇到源码方法安装的时候,如果 ./configure 或者 make 不成功,依据error的信息来安装相应的包,如果相应的包也安装了,还是报错的话,确保其该包的devel包也需要安装。
  • 在安装好的目录下,进入bin目录,执行 ./httpd -V 查询其安装的具体细节。

    ./httpd -V

猜你喜欢

转载自blog.51cto.com/snowlai/2307124