启动使用mod_jk配置的apache httpd-2.4.4时出错


2

我想配置mod_jkhttpd-2.4.4并启动Apache时,得到下面的错误。

httpd: Syntax error on line 500 of /usr/local/apache/conf/httpd.conf:
Syntax error on line 2 of /usr/local/apache/conf/other/httpd-mine.conf:
    Cannot load /usr/libexec/apache2/mod_jk.so into server:
        dlopen(/usr/libexec/apache2/mod_jk.so, 10):
    Symbol not found:
        _ap_log_error\n  Referenced from: /usr/libexec/apache2/mod_jk.so
        Expected in: flat namespace\n in /usr/libexec/apache2/mod_jk.so

我怎样才能解决这个问题?

我在OS X 10.8.4(12E55)

我从源代码编译httpd并且mod_jk构建都很顺利。

这是我如何建立和conf信息:

# compile instructions for httpd
# apr, apr-util in srclib/
httpd-2.4.4$ ./configure --prefix=/usr/local/apache --with-included-apr --with-  pcre=/usr/local
httpd-2.4.4$ make
httpd-2.4.4$ sudo make install

# compile instructions for mod_jk
tomcat-connectors-1.2.37-src$ cd native
native$ ./configure CFLAGS='-arch x86_64' APXSLDFLAGS='-arch x86_64' --with-apxs=/usr/sbin/apxs
native$ make
native$ sudo make install

#Content of /usr/local/apache/conf/other/httpd-mine.conf 
NameVirtualHost *:80
LoadModule jk_module /usr/libexec/apache2/mod_jk.so

Answers:


1

发现了问题。我apxs在配置mod_jk构建时指向了错误的版本(httpd-2.2)。

native$ ./configure CFLAGS='-arch x86_64' APXSLDFLAGS='-arch x86_64' --with-apxs=/usr/sbin/apxs

mod_jk使用正确的apxs文件进行编译后,httpd启动没有任何问题。

native$ ./configure CFLAGS='-arch x86_64' APXSLDFLAGS='-arch x86_64' --with-apxs=/usr/local/apache/bin/apxs
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.