日期:2014-05-17  浏览次数:20824 次

使用apxs工具给apache添加模块(无需重新编译安装apache)

转自:http://www.cublog.cn/u3/105800/showart_2099945.html

?

?

下面是使用apxs工具给apache添加模块

?

如添加的模块:

LoadModule cgi_module?????? libexec/mod_cgi.so

LoadModule cgid_module???? libexec/mod_cgid.so

?

添加方法:

如要额外安装cgi,先找到mod_cgi.c及mod_cgid.c。一般在apache安装包目录下/httpd-2.2.11/modules/generators。

?

[root@local ~]#cd /software/httpd-2.2.11/modules/generators

[root@local generators]# /usr/local/apache/bin/apxs -i -a -c mod_cgi.c

?

/usr/local/apr/build-1/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/apr/include/apr-1?? -I/usr/local/apr-

?

util/include/apr-1?? -c -o mod_cgi.lo mod_cgi.c && touch mod_cgi.slo

/usr/local/apr/build-1/libtool --silent --mode=link gcc -o mod_cgi.la? -rpath /usr/local/apache/modules -module -

?

avoid-version??? mod_cgi.lo

/usr/local/apache/build/instdso.sh SH_LIBTOOL='/usr/local/apr/build-1/libtool' mod_cgi.la /usr/local/apache/modules

/usr/local/apr/build-1/libtool --mode=install cp mod_cgi.la /usr/local/apache/modules/

cp .libs/mod_cgi.so /usr/local/apache/modules/mod_cgi.so

cp .libs/mod_cgi.lai /usr/local/apache/modules/mod_cgi.la

cp .libs/mod_cgi.a /usr/local/apache/modules/mod_cgi.a

chmod 644 /usr/local/apache/modules/mod_cgi.a

ranlib /usr/local/apache/modules/mod_cgi.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

?? - ad