el7升级Apache模块编译

1.背景

接续https://blog.csdn.net/nanhai_happy/article/details/140566070,由于升级升级Apache过程中,发现需要使用的mod_wsgi、mod_systemd和mod_cgi模块缺失,故接着解决继续编译生成。

2. 编译mod_cgi、mod_system

2.1 安装依赖

复制代码
yum install systemd-devel
rpm -ivh httpd-devel-2.4.62-1.aarch64.rpm

2.2 编译

复制代码
cd /root/rpmbuild/BUILD/httpd-2.4.62/modules/generators
apxs -i -a -c mod_cgi.c
cd /root/rpmbuild/BUILD/httpd-2.4.62/modules/arch/unix
apxs -i -a -c mod_systemd.c

3. 编译mod_wsgi

3.1 下载

复制代码
wget https://github.com/GrahamDumpleton/mod_wsgi/archive/refs/tags/5.0.0.zip

3.2 编译安装

复制代码
unzip mod_wsgi-5.0.0.zip
cd mod_wsgi-5.0.0/
./configure
make
make install

4.问题记录

4.1 configure: error: Apache tool 'apxs' or 'apxs2' is required to build mod_wsgi.

编译mod_wsgi模块时候出现如下错误:

复制代码
checking for apxs2... no
checking for apxs... no
configure: error: Apache tool 'apxs' or 'apxs2' is required to build mod_wsgi.

通过安装httpd-devel软件包解决:

复制代码
rpm -ivh httpd-devel-2.4.62-1.aarch64.rpm

4.2 mod_systemd.c:31:31: fatal error: systemd/sd-daemon.h: No such file or directory

在编译mod_systemd.so动态链接库的时候出现如下错误:

复制代码
apxs -i -a -c mod_systemd.c

/usr/lib64/apr/build-1/libtool --silent --mode=compile gcc -std=gnu11 -prefer-pic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches  -DLINUX -D_REENTRANT -D_GNU_SOURCE -pthread -I/usr/include/httpd  -I/usr/include/apr-1   -I/usr/include/apr-1   -c -o mod_systemd.lo mod_systemd.c && touch mod_systemd.slo
mod_systemd.c:31:31: fatal error: systemd/sd-daemon.h: No such file or directory
 #include "systemd/sd-daemon.h"
                               ^
compilation terminated.
apxs:Error: Command failed with rc=65536
.
(khatch-ui)[root@controller1 unix]# ls
config5.m4  Makefile.in  mod_privileges.c  mod_systemd.c  mod_unixd.c  mod_unixd.h
(khatch-ui)[root@controller1 unix]# make
make: *** No targets specified and no makefile found.  Stop.
(khatch-ui)[root@controller1 unix]# apxs -i -a -c mod_systemd.c
/usr/lib64/apr/build-1/libtool --silent --mode=compile gcc -std=gnu11 -prefer-pic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches  -DLINUX -D_REENTRANT -D_GNU_SOURCE -pthread -I/usr/include/httpd  -I/usr/include/apr-1   -I/usr/include/apr-1   -c -o mod_systemd.lo mod_systemd.c && touch mod_systemd.slo
mod_systemd.c:31:31: fatal error: systemd/sd-daemon.h: No such file or directory
 #include "systemd/sd-daemon.h"
                               ^
compilation terminated.
apxs:Error: Command failed with rc=65536
.

由于缺少system开发库导致的,解决方法通过安装systemd开发包解决:

复制代码
yum install systemd-devel
相关推荐
网安INF3 天前
Apache Shiro 1.2.4 反序列化漏洞(CVE-2016-4437)
java·网络安全·apache
大数据追光猿3 天前
【大数据】服务器上部署Apache Paimon
大数据·服务器·docker·架构·apache
斯普信专业组4 天前
基于Kubernetes的Apache Pulsar云原生架构解析与集群部署指南(上)
云原生·kubernetes·apache
C-20024 天前
使用Deployment部署运行Nginx和Apache服务
运维·kubernetes·apache
斯普信专业组4 天前
基于Kubernetes的Apache Pulsar云原生架构解析与集群部署指南(下)
云原生·kubernetes·apache
沉默的松饼4 天前
《开源先锋Apache软件基金会:历史沿革、顶级项目与行业影响》
apache
coding侠客4 天前
使用Jmeter进行核心API压力测试
java·jmeter·apache·压力测试
爬山虎还上班5 天前
phpstudy升级新版apache
apache·phpstudy
轩昂7K5 天前
Apache Doris 使用指南:从入门到生产实践
apache
有个人神神叨叨5 天前
Apache Calcite 详细介绍
apache