1、操作环境
(1)实验环境
- 本机系统:Window 10 专业版
- 虚拟机版本:Vmware12
(2)系统环境
- 虚拟机中的操作系统版本:CentOS Linux release 7.4.1708 (Core) -x86_64
- 虚拟机中的操作系统内核版本:Linux 3.10.0-693.el7.x86_64
(3)软件环境
- tomcat-connectors-1.2.48-src
2、问题描述
# 进入 native 目录下进行编译和安装 mod_jk
/usr/local/tomcat-connectors-1.2.48-src/native/configure --with-apxs=/usr/bin/apxs && make && make install
- 执行上条命令出现如下报错
line 81: aclocal-1.15: command not found
WARNING: 'aclocal-1.15' is missing on your system.
You should only need it if you modified 'acinclude.m4' or
'configure.ac' or m4 files included by 'configure.ac'.
The 'aclocal' program is part of the GNU Automake package:
<http://www.gnu.org/software/automake>
It also requires GNU Autoconf, GNU m4 and Perl in order to run:
<http://www.gnu.org/software/autoconf>
<http://www.gnu.org/software/m4/>
<http://www.perl.org/>
make: *** [Makefile:579: aclocal.m4] Error 127
-e error code=2!
3、原因分析
- 报错释义:
第81行:aclocal-1.15:未找到命令
警告:系统上缺少“aclocal-1.15”。
只有在修改了“acinclude.m4”或“configure.ac”或“configure/ac”中包含的m4文件才需要它。
“aclocal”程序是GNU Automake包的一部分:
<http://www.gnu.org/software/automake>它还需要GNU Autoconf、GNU m4和Perl才能运行:<http://www.gnu.org/software/autoconf> <http://www.gnu.org/software/m4/> <http://www.perl.org/>
make:***[Makefile:579:aclocal.m4]错误127
-e错误代码=2!
- 分析:缺少 aclocal 或者 aclocal 版本过低
4、解决方案
- 安装 aclocal 比较新的版本后再重新编译安装 mod_jk 即可
# 首先获取来源
wget https://ftp.gnu.org/gnu/automake/automake-1.15.tar.gz
# 解压文件
tar -xzvf automake-1.15.tar.gz
# 构建并安装
cd automake-1.15
./configure --prefix=/opt/aclocal-1.15
make
sudo mkdir -p /opt
sudo make install
# 添加环境变量
export PATH=/opt/aclocal-1.15/bin:$PATH
aclocal --version
# 重新进入 native 目录下进行编译和安装 mod_jk
/usr/local/tomcat-connectors-1.2.48-src/native/configure --with-apxs=/usr/bin/apxs && make && make install