Centos7 安装 Apache-2.4.38
1、从官网下载源码
wget http://www.apache.org/dist/httpd/httpd-2.4.38.tar.bz2
wegt http://mirror.bit.edu.cn/apache//apr/apr-1.7.0.tar.gz
wget http://mirror.bit.edu.cn/apache//apr/apr-util-1.6.1.tar.gz
2、减压软件包,编译安装
- 2.1 减压
httpd-2.4.38.tar.bz2 apr-1.7.0.tar.gz apr-util-1.6.1.tar.gz
- 2.2 将
apr-1.7.0.tar.gz apr-util-1.6.1.tar.gz
重命名为apr apr-util
- 2.3 ```cp -a apr/ apr-uril````到/httpd-2.4.38/srclib 中
- 2.4 然后使用./configure进行编译
./configure --prefix=/usr/local/httpd --sysconfdir=/etc/http --with-included-apr
3、然后进行安装即可make &&make install
4、若在make 时出现如下错误
xml/apr_xml.c:35:19: fatal error: expat.h: No such file or directory
#include <expat.h>
须要编译安装expat软件包,步骤如下:
4.1 下载expat 软件包
wget https://github.com/libexpat/libexpat/releases/download/R_2_2_7/expat-2.2.7.tar.bz2
4.2 安装expat
./configure --prefix = / path-to-expat-installation-dir
make && make install
4.3 然后回到httpd目录下加上如下参数重新编译再安装即可
--with-expat = / path-to-expat-installation-dir
PS:安装的Httpd 为最新版软件包。
原文地址:https://blog.51cto.com/8686505/2427497
时间: 2024-10-15 20:29:42