apxs是一个为Apache HTTP服务器编译和安装扩展模块的工具,用于编译一个或多个源程序或目标代码文件为动态共享对象,使之可以用由mod_so提供的LoadModule指令在运行时加载到Apache服务器中。
输入命令查看是否有httpd-devel这个包,如果没有需要安装
[root@izbp18dv3a3metugyd02qxz syhuo.dashboard]# yum -y install httpd* [root@izbp18dv3a3metugyd02qxz syhuo.dashboard]# yum list installed | grep -i 'httpd' httpd.x86_64 2.4.6-93.el7.centos @base httpd-devel.x86_64 2.4.6-93.el7.centos @base httpd-tools.x86_64 2.4.6-93.el7.centos @base
若apache是选择源码编译安装编译安装加上 --with-apr=/usr/local/apr、--with-apr-util=/usr/local/apr-util,先安装apr,再安装apr-util,apr-util依赖apr
[root@localhost httpd-2.4.41]# cat /root/download/apache2/httpd-2.4.41/config.nice #! /bin/sh # # Created by configure "./configure" \ "--prefix=/etc/httpd" \ "--enable-so" \ "--enable-ssl" \ "--enable-cgi" \ "--enable-rewrite" \ "--with-zlib" \ "--with-pcre" \ "--with-apr=/usr/local/apr" \ "--with-apr-util=/usr/local/apr-util" \ "--enable-modeles=most" \ "--enable-mpms-shared=all" \ "--with-mpm=event" \ "$@"
以apxs方式安装apache模块,无需再次编译安装apache,以ssl_module为例,需要先安装openssl
cd /root/download/apache2/httpd-2.4.41/modules/ssl
/bin/apxs -a -i -c -L/usr/lib/openssl/engines/lib -c *.c -lcrypto -lssl -ldl