启动apache时提示如下:

[root@localhost httpd-2.2.4]# /usr/local/apache/bin/apachectl start
Syntax error on line 95 of /usr/local/apache/conf/extra/httpd-vhosts.conf:
Invalid command 'Header', perhaps misspelled or defined by a module not included in the server configuration

编译时没有加载相关模块:

./configure \
--prefix=${INSTALLPATH_APACHE} \
--enable-mods-shared=max \
--enable-module=most \
--with-mpm=prefork \
--enable-deflate \
--enable-ext-filter \
--enable-file-cache \
--enable-suexec \
--enable-deflate \
--enable-cache \
--enable-disk-cache \
--enable-mem-cache \
--enable-file-cache \
--enable-suexec \
--enable-ext-filter \
--enable-rewrite \
--enable-proxy \
--enable-proxy-connect \
--enable-proxy-http \
--enable-proxy-balancer

编译时添加:--enable-headers

手工添加:

[root@localhost metadata]# /usr/local/apache/bin/apxs -i -a -c mod_headers.c
/usr/local/apache/build/libtool --silent --mode=compile gcc -prefer-pic   -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -g -O2 -pthread -I/usr/local/apache/include  -I/usr/local/apache/include   -I/usr/local/apache/include   -c -o mod_headers.lo mod_headers.c && touch mod_headers.slo
/usr/local/apache/build/libtool --silent --mode=link gcc -o mod_headers.la  -rpath /usr/local/apache/modules -module -avoid-version    mod_headers.lo
/usr/local/apache/build/instdso.sh SH_LIBTOOL='/usr/local/apache/build/libtool' mod_headers.la /usr/local/apache/modules
/usr/local/apache/build/libtool --mode=install cp mod_headers.la /usr/local/apache/modules/
cp .libs/mod_headers.so /usr/local/apache/modules/mod_headers.so
cp .libs/mod_headers.lai /usr/local/apache/modules/mod_headers.la
cp .libs/mod_headers.a /usr/local/apache/modules/mod_headers.a
ranlib /usr/local/apache/modules/mod_headers.a
chmod 644 /usr/local/apache/modules/mod_headers.a
PATH="$PATH:/sbin" ldconfig -n /usr/local/apache/modules
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/apache/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
chmod 755 /usr/local/apache/modules/mod_headers.so
[activating module `headers' in /usr/local/apache/conf/httpd.conf]
[root@localhost metadata]# /usr/local/apache/bin/apachectl start

此文章由 flyinweb 于 2010-10-11 17:36:41 编辑

本日志由 flyinweb 于 2009-10-30 17:59:44 发表,目前已经被浏览 4740 次,评论 0 次;

作者添加了以下标签: Headerenable-headersApache modulesapxs

引用通告:http://www.517sou.net/Article/307/Trackback.ashx

评论订阅:http://www.517sou.net/Article/307/Feeds.ashx

评论列表

    暂时没有评论
(必填)
(必填,不会被公开)