AIX缺少符号ap_cleanup_scoreboard和Apache进程的ap_accept_lock_mech . 但是,符号确实存在

我遇到一个问题,即apache无法找到从apache进程中加载的库(mod_wsgi)引用的某些符号 .

当我启动apache进程时,我收到此错误 .

root [zibal]% . / usr / local / apache2 / bin / apachectl restart httpd:/usr/local/apache2/conf/httpd.conf第53行的语法错误:无法加载/ usr / local / apache2 / modules / mod_wsgi .so到服务器:

rtld:0712-001符号ap_cleanup_scoreboard是从模块/usr/local/apache2/modules/mod_wsgi.so()引用的,但未找到符号的运行时定义 .

rtld:0712-001符号ap_accept_lock_mech是从模块/usr/local/apache2/modules/mod_wsgi.so()引用的,但未找到符号的运行时定义

我在apache可执行文件上粘贴了nm命令的输出,这些符号似乎存在 .

root [zibal]%nm ./usr/local/apache2/bin/httpd | grep ap_accept_lock_mech

ap_accept_lock_mech D 536880332

ap_accept_lock_mech d 536900392 4

ap_accept_lock_mech:G879 - 0

root [zibal]%nm ./usr/local/apache2/bin/httpd | grep ap_cleanup_scoreboard

.ap_cleanup_scoreboard T 268613428 212

ap_cleanup_scoreboard D 536890068

ap_cleanup_scoreboard d 536890068 12

ap_cleanup_scoreboard d 536899972 4

ap_cleanup_scoreboard:F385 - 2976

请指导 .

回答(1)

2 years ago

这就是我能够解决这个问题的方法(我必须应用两个解决方案,如下所示) .

解决方案1(感谢Graham Dumpleton)

不要在Apache代码中更改任何内容 .

进入mod_wsgi.c源代码并更改:

/ * 清理Apache记分板以确保任何共享内存段或内存映射文件不可用于守护进程中的代码 . * /

ap_cleanup_scoreboard(0);

#if 0
       /*
        * Cleanup the Apache scoreboard to ensure that any
        * shared memory segments or memory mapped files not
        * available to code in daemon processes.
        */

       ap_cleanup_scoreboard(0);
#endif

然后寻找:

#if !defined(AP_ACCEPT_MUTEX_TYPE)
   sconfig->lock_mechanism = ap_accept_lock_mech;
#else
   sconfig->lock_mechanism = APR_LOCK_DEFAULT;
#endif

并将其更改为:

#define AP_ACCEPT_MUTEX_TYPE 1
#if !defined(AP_ACCEPT_MUTEX_TYPE)
   sconfig->lock_mechanism = ap_accept_lock_mech;
#else
   sconfig->lock_mechanism = APR_LOCK_DEFAULT;
#endif

然后构建mod_wsgi

解决方案2(感谢Apache的Jeff Trawick)

解压缩目录中的源tar球..... cd到该目录

找到文件include / mpm_common.h

Change
        extern apr_lockmech_e ap_accept_lock_mech;
to
        AP_DECLARE_DATA extern apr_lockmech_e ap_accept_lock_mech;

找到文件include / scoreboard.h

Change
        apr_status_t ap_cleanup_scoreboard(void *d);
to
        AP_DECLARE(apr_status_t) ap_cleanup_scoreboard(void *d);

然后发出以下命令

./configure
make

完成此步骤后,将在服务器目录中创建一个httpd.exp文件,并在当前目录中创建一个httpd文件

删除httpd

编辑server / httpd.exp并为ap_accept_lock_mech添加一行

make
    make install (as root)

然后从Source Tarball构建mod_wsgi 3.3

我希望这可以帮助其他人面对同样的问题 .