在 centos 8.x 上源码编译安装 httpd-2.4.x, 自行configure 时报:

1
2
3
4
checking whether to enable mod_privileges... no
checking whether to enable mod_systemd... checking dependencies
configure: WARNING: Your system does not support systemd.
checking whether to enable mod_systemd... configure: error: mod_systemd has been requested but can not be built due to prerequisite failures

编译参数:

1
2
3
4
5
6
7
8
9
10
11
./configure --prefix=/usr/local/apache2 \
--enable-load-all-modules \
--with-apr=/usr/local/apr \
--with-apr-util=/usr/local/apr-util \
--with-pcre=/usr \
--with-z=/usr \
--with-libxml2=/usr \
--with-lua=/usr \
--with-ssl=/usr \
--with-curl=/usr \
--enable-systemd
报错原因:

编译参数中启用了参数 –enable-systemd ,使其支持 systemd 管理

解决方法:

使用 dnf 命令安装 systemd-devel

1
dnf install -y  systemd-devel

然后重新执行 configure 即可!