linux 下配置resin3.1.* +apache 2.2 出错的解决办法
配置 resin3.1.4时,死活编译不过去。如下:
esayr@ifone:/usr/local/resin$ make
(cd modules/c/src; make)
make[1]: Entering directory `/usr/local/resin/modules/c/src'
for dir in common apache2 resin_os; do (cd $dir; make); done
make[2]: Entering directory `/usr/local/resin/modules/c/src/common'
gcc -c -I/usr/local/ssl/include -march=prescott -O2 -pipe -fomit-frame-pointer -DPOLL -DEPOLL -D_POSIX_PTHREAD_SEMANTICS -DHAS_SOCK_TIMEOUT -DHAS_JVMTI -DHAS_JVMDI stream.c
gcc -c -I/usr/local/ssl/include -march=prescott -O2 -pipe -fomit-frame-pointer -DPOLL -DEPOLL -D_POSIX_PTHREAD_SEMANTICS -DHAS_SOCK_TIMEOUT -DHAS_JVMTI -DHAS_JVMDI config.c
gcc -c -I/usr/local/ssl/include -march=prescott -O2 -pipe -fomit-frame-pointer -DPOLL -DEPOLL -D_POSIX_PTHREAD_SEMANTICS -DHAS_SOCK_TIMEOUT -DHAS_JVMTI -DHAS_JVMDI memory.c
/usr/bin/ld -r -o common.o stream.o config.o memory.o
/usr/local/resin/libtool --silent --mode=compile gcc -o stream.lo -c -I/usr/local/ssl/include -march=prescott -O2 -pipe -fomit-frame-pointer -DPOLL -DEPOLL -D_POSIX_PTHREAD_SEMANTICS -DHAS_SOCK_TIMEOUT -DHAS_JVMTI -DHAS_JVMDI stream.c
/usr/local/resin/libtool --silent --mode=compile gcc -o config.lo -c -I/usr/local/ssl/include -march=prescott -O2 -pipe -fomit-frame-pointer -DPOLL -DEPOLL -D_POSIX_PTHREAD_SEMANTICS -DHAS_SOCK_TIMEOUT -DHAS_JVMTI -DHAS_JVMDI config.c
/usr/local/resin/libtool --silent --mode=compile gcc -o memory.lo -c -I/usr/local/ssl/include -march=prescott -O2 -pipe -fomit-frame-pointer -DPOLL -DEPOLL -D_POSIX_PTHREAD_SEMANTICS -DHAS_SOCK_TIMEOUT -DHAS_JVMTI -DHAS_JVMDI memory.c
make[2]: Leaving directory `/usr/local/resin/modules/c/src/common'
make[2]: Entering directory `/usr/local/resin/modules/c/src/apache2'
EGREP="grep -E" /usr/local/resin/libtool --silent --mode=compile gcc -o mod_caucho.lo -c -I/usr/local/apache/include -I/usr/local/apr/include/apr-1 -DRESIN_HOME=\"/usr/local/resin\" -I../common -march=prescott -O2 -pipe -fomit-frame-pointer -DPOLL -DEPOLL -D_POSIX_PTHREAD_SEMANTICS -DHAS_SOCK_TIMEOUT -DHAS_JVMTI -DHAS_JVMDI -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -pthread mod_caucho.c
In file included from mod_caucho.c:35:
/usr/local/apache/include/ap_config.h:26:23: error: apr_hooks.h: No such file or directory
/usr/local/apache/include/ap_config.h:27:32: error: apr_optional_hooks.h: No such file or directory
In file included from mod_caucho.c:37:
/usr/local/apache/include/httpd.h:54:25: error: apr_buckets.h: No such file or directory
/usr/local/apache/include/httpd.h:745:21: error: apr_uri.h: No such file or directory
In file included from mod_caucho.c:37:
/usr/local/apache/include/httpd.h:947: error: expected specifier-qualifier-list before 'apr_uri_t'
/usr/local/apache/include/httpd.h:1107: error: expected specifier-qualifier-list before 'APR_RING_ENTRY'
/usr/local/apache/include/httpd.h:1224: error: expected specifier-qualifier-list before 'apr_bucket_brigade'
/usr/local/apache/include/httpd.h:1232: error: expected specifier-qualifier-list before 'apr_bucket_brigade'
In file included from mod_caucho.c:38:
/usr/local/apache/include/http_config.h:975: error: expected ')' before 'int'
In file included from /usr/local/apache/include/http_core.h:30,
from mod_caucho.c:39:
/usr/local/apache/include/apr_hash.h:78: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
/usr/local/apache/include/apr_hash.h:86: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
/usr/local/apache/include/apr_hash.h:96: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
/usr/local/apache/include/apr_hash.h:107: error: expected ')' before '*' token
/usr/local/apache/include/apr_hash.h:117: error: expected ')' before '*' token
/usr/local/apache/include/apr_hash.h:148: error: expected declaration specifiers or '...' before 'apr_hash_t'
/usr/local/apache/include/apr_hash.h:175: error: expected ')' before '*' token
/usr/local/apache/include/apr_hash.h:186: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
/usr/local/apache/include/apr_hash.h:204: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
/usr/local/apache/include/apr_hash.h:218: error: expected ';', ',' or ')' before '*' token
In file included from mod_caucho.c:39:
/usr/local/apache/include/http_core.h:31:26: error: apr_optional.h: No such file or directory
In file included from /usr/local/apache/include/http_core.h:32,
from mod_caucho.c:39:
/usr/local/apache/include/util_filter.h:137: error: expected declaration specifiers or '...' before 'apr_bucket_brigade'
/usr/local/apache/include/util_filter.h:139: error: expected declaration specifiers or '...' before 'apr_bucket_brigade'
/usr/local/apache/include/util_filter.h:141: error: expected declaration specifiers or '...' before 'apr_read_type_e'
/usr/local/apache/include/util_filter.h:296: error: expected declaration specifiers or '...' before 'apr_bucket_brigade'
/usr/local/apache/include/util_filter.h:298: error: expected declaration specifiers or '...' before 'apr_read_type_e'
/usr/local/apache/include/util_filter.h:310: error: expected declaration specifiers or '...' before 'apr_bucket_brigade'
/usr/local/apache/include/util_filter.h:492: error: expected declaration specifiers or '...' before 'apr_bucket_brigade'
/usr/local/apache/include/util_filter.h:493: error: expected declaration specifiers or '...' before 'apr_bucket_brigade'
/usr/local/apache/include/util_filter.h:503: error: expected ')' before '*' token
/usr/local/apache/include/util_filter.h:511: error: expected declaration specifiers or '...' before 'apr_bucket_brigade'
/usr/local/apache/include/util_filter.h:548: error: expected declaration specifiers or '...' before 'apr_bucket_brigade'
/usr/local/apache/include/util_filter.h:559: error: expected declaration specifiers or '...' before 'apr_bucket_brigade'
/usr/local/apache/include/util_filter.h:562: error: format string argument not a string type
In file included from mod_caucho.c:39:
/usr/local/apache/include/http_core.h:633: error: expected specifier-qualifier-list before 'apr_hash_t'
/usr/local/apache/include/http_core.h:662: error: expected ')' before 'int'
/usr/local/apache/include/http_core.h:680: error: expected declaration specifiers or '...' before 'ap_ident_lookup'
/usr/local/apache/include/http_core.h:681: error: expected declaration specifiers or '...' before '(' token
/usr/local/apache/include/http_core.h:681: warning: data definition has no type or storage class
In file included from mod_caucho.c:40:
/usr/local/apache/include/http_protocol.h:45: error: expected ')' before 'void'
/usr/local/apache/include/http_protocol.h:77: error: expected declaration specifiers or '...' before 'apr_bucket_brigade'
/usr/local/apache/include/http_protocol.h:537: error: expected declaration specifiers or '...' before 'apr_bucket_brigade'
/usr/local/apache/include/http_protocol.h:569: error: expected ')' before 'int'
/usr/local/apache/include/http_protocol.h:608: error: expected specifier-qualifier-list before 'apr_bucket_refcount'
/usr/local/apache/include/http_protocol.h:616: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'ap_bucket_type_error'
/usr/local/apache/include/http_protocol.h:633: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
/usr/local/apache/include/http_protocol.h:644: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
/usr/local/apache/include/http_protocol.h:648: error: expected declaration specifiers or '...' before 'apr_bucket_brigade'
/usr/local/apache/include/http_protocol.h:649: error: expected declaration specifiers or '...' before 'apr_bucket_brigade'
/usr/local/apache/include/http_protocol.h:651: error: expected declaration specifiers or '...' before 'apr_bucket_brigade'
/usr/local/apache/include/http_protocol.h:652: error: expected declaration specifiers or '...' before 'apr_bucket_brigade'
In file included from mod_caucho.c:41:
/usr/local/apache/include/http_connection.h:94: error: expected ')' before 'conn_rec'
/usr/local/apache/include/http_connection.h:135: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
/usr/local/apache/include/http_connection.h:143: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
mod_caucho.c: In function 'cse_get_module_config':
mod_caucho.c:247: error: 'request_rec' has no member named 'per_dir_config'
mod_caucho.c:248: error: 'request_rec' has no member named 'per_dir_config'
mod_caucho.c: In function 'caucho_register_hooks':
mod_caucho.c:1330: error: 'APR_HOOK_MIDDLE' undeclared (first use in this function)
mod_caucho.c:1330: error: (Each undeclared identifier is reported only once
mod_caucho.c:1330: error: for each function it appears in.)
mod_caucho.c:1332: error: 'APR_HOOK_FIRST' undeclared (first use in this function)
make[2]: *** [mod_caucho.lo] Error 1
make[2]: Leaving directory `/usr/local/resin/modules/c/src/apache2'
make[2]: Entering directory `/usr/local/resin/modules/c/src/resin_os'
gcc -march=prescott -O2 -pipe -fomit-frame-pointer -DPOLL -DEPOLL -D_POSIX_PTHREAD_SEMANTICS -DHAS_SOCK_TIMEOUT -DHAS_JVMTI -DHAS_JVMDI -D_FILE_OFFSET_BITS=64 -DRESIN_HOME=\"/usr/local/resin\" -I/usr/local/ssl/include -I/usr/local/jdk1.5.0_14/include -I/usr/local/jdk1.5.0_14/include/linux -I../common -DCPU=\"i386\" -DOS= -c -o jni_os.o jni_os.c
/usr/bin/ld -shared -L/usr/local/ssl/lib -o libresin_os.so jni_os.o jni_jvmti.o jni_jvmdi.o -lpthread -lc
make[2]: Leaving directory `/usr/local/resin/modules/c/src/resin_os'
make[1]: Leaving directory `/usr/local/resin/modules/c/src'
一找,原来是少了一些头文件,记得以前编译APACHE2.2.6的时候,是把 apr和apr-util编译在/usr/local下的,于是复制他们的include下的.h文件到apache安装目录的include下
esayr@ifone:/usr/local/resin$ sudo cp /usr/local/apr-util/include/apr-1/*.h /usr/local/apache/include/
再试:
esayr@ifone:/usr/local/resin$ make
(cd modules/c/src; make)
make[1]: Entering directory `/usr/local/resin/modules/c/src'
for dir in common apache2 resin_os; do (cd $dir; make); done
make[2]: Entering directory `/usr/local/resin/modules/c/src/common'
/usr/bin/ld -r -o common.o stream.o config.o memory.o
make[2]: Leaving directory `/usr/local/resin/modules/c/src/common'
make[2]: Entering directory `/usr/local/resin/modules/c/src/apache2'
EGREP="grep -E" /usr/local/resin/libtool --silent --mode=compile gcc -o mod_caucho.lo -c -I/usr/local/apache/include -I/usr/local/apr/include/apr-1 -DRESIN_HOME=\"/usr/local/resin\" -I../common -march=prescott -O2 -pipe -fomit-frame-pointer -DPOLL -DEPOLL -D_POSIX_PTHREAD_SEMANTICS -DHAS_SOCK_TIMEOUT -DHAS_JVMTI -DHAS_JVMDI -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -pthread mod_caucho.c
EGREP="grep -E" /usr/local/resin/libtool --silent --mode=link gcc -module -o mod_caucho.la -avoid-version -rpath /usr/local/apache/modules mod_caucho.lo ../common/stream.lo ../common/config.lo ../common/memory.lo
make[2]: Leaving directory `/usr/local/resin/modules/c/src/apache2'
make[2]: Entering directory `/usr/local/resin/modules/c/src/resin_os'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/usr/local/resin/modules/c/src/resin_os'
make[1]: Leaving directory `/usr/local/resin/modules/c/src'
esayr@ifone:/usr/local/resin$ sudo make install
(cd modules/c/src; make install)
make[1]: Entering directory `/usr/local/resin/modules/c/src'
for dir in common apache2 resin_os; do (cd $dir; make install); done
make[2]: Entering directory `/usr/local/resin/modules/c/src/common'
make[2]: Nothing to be done for `install'.
make[2]: Leaving directory `/usr/local/resin/modules/c/src/common'
make[2]: Entering directory `/usr/local/resin/modules/c/src/apache2'
EGREP="grep -E" /usr/local/resin/libtool --silent --mode=install /bin/cp mod_caucho.la /usr/local/apache/modules
rm -f /usr/local/apache/modules/mod_caucho.la
rm -f /usr/local/apache/modules/mod_caucho.a
sh install.sh -conf /usr/local/apache/conf/httpd.conf -libexec /usr/local/apache/modules \
-resin_home /usr/local/resin
make[2]: Leaving directory `/usr/local/resin/modules/c/src/apache2'
make[2]: Entering directory `/usr/local/resin/modules/c/src/resin_os'
mkdir /usr/local/resin/libexec
cp libresin_os.so /usr/local/resin/libexec
make[2]: Leaving directory `/usr/local/resin/modules/c/src/resin_os'
make[1]: Leaving directory `/usr/local/resin/modules/c/src'
if test /usr/local/resin != `pwd`; then \
mkdir -p /usr/local/resin/lib; \
mkdir -p /usr/local/resin/libexec; \
cp -r libexec/* /usr/local/resin/libexec; \
cp lib/*.jar /usr/local/resin/lib; \
mkdir -p /usr/local/resin/bin; \
cp bin/* /usr/local/resin/bin; \
mkdir -p /usr/local/resin/webapps; \
cp -r webapps/* /usr/local/resin/webapps; \
mkdir -p /usr/local/resin/conf; \
cp conf/resin.conf /usr/local/resin/conf/resin.conf.orig; \
cp conf/app-default.xml /usr/local/resin/conf/app-default.xml.orig; \
if test ! -r /usr/local/resin/conf/resin.conf; then \
cp conf/resin.conf /usr/local/resin/conf/resin.conf; \
cp conf/app-default.xml /usr/local/resin/conf/app-default.xml; \
fi; \
fi
esayr@ifone:/usr/local/resin$
搞定! 特此。