📄 mod.so
字号:
m4_comment([$Id: mod.so,v 10.6 2007/07/07 14:45:24 bostic Exp $])m4_ref_title(m4_db Extensions, Using m4_db with Apache, [Apache, mod], tcl/faq, ext/perl)m4_p([dnlA mod_db4 Apache module is included in the m4_db distribution, providinga safe framework for running m4_db applications in an Apache 1.3environment. Apache natively provides no interface for communicationbetween threads or processes, so the mod_db4 module exists to providethis communication.])m4_p([dnlIn general, it is dangerous to run m4_db in a multiprocess systemwithout some facility to coordinate database recovery between processessharing the database environment after application or system failure.Failure to run recovery after failure can include process hangs and aninability to access the database environment. The mod_db4 Apache moduleoversees the proper management of m4_db database environment resources.Developers building applications using m4_db as the storage managerwithin an Apache module should employ this technique for proper resourcemanagement.])m4_p([dnlSpecifically, mod_db4 provides the following facilities:])m4_nlistbeginm4_nlist([dnlNew constructors for m4_ref(DbEnv) and m4_ref(Db) handles, which installreplacement open/close methods.])m4_nlist([dnlTransparent caching of open m4_ref(DbEnv) and m4_ref(Db) handles.])m4_nlist([dnlReference counting on all structures, allowing the module to detect theinitial opening of any managed database and automatically perform recovery.])m4_nlist([dnlAutomatic detection of unexpected failures (segfaults, or a moduleactually calling exit() and avoiding shut down phases), and automatictermination of all child processes with open database resources toattempt consistency.])m4_nlistendm4_p([dnlmod_db4 is designed to be used as an alternative interface to m4_db. Tohave another Apache module (for example, mod_foo) use mod_db4, do notlink mod_foo against the m4_db library. In your mod_foo makefile, youshould:])m4_indent([#include "mod_db4_export.h"])m4_p([dnland add your Apache include directory to your CPPFLAGS.])m4_p([dnlIn mod_foo, to create a mod_db4 managed m4_ref(DbEnv) handle, use thefollowing:])m4_indent([dnlint mod_db4_db_env_create(DB_ENV **dbenvp, u_int32_t flags);])m4_p([dnlwhich takes identical arguments to m4_ref(dbenv_create).])m4_p([dnlTo create a mod_db4 managed m4_ref(Db) handle, use the following:])m4_indent([dnlint mod_db4_db_create(DB **dbp, DB_ENV *dbenv, u_int32_t flags);])m4_p([dnlwhich takes identical arguments to m4_ref(dbh_create).])m4_p([dnlOtherwise the API is completely consistent with the standard m4_dbAPI.])m4_p([dnlThe mod_db4 module requires the m4_db library be compiled with C++extensions and the MM library. (The MM library provides an abstractionlayer which allows related processes to share data easily. On systemswhere shared memory or other inter-process communication mechanisms arenot available, the MM library emulates them using temporary files. MMis used in several operating systems to provide shared memory pools toApache modules.)])m4_p([dnlTo build this apache module, perform the following steps:])m4_indent([dnl% ./configure --with-apxs=__LB__path to the apxs utility__RB__ \ --with-db4=__LB__[]m4_db library installation directory__RB__ \ --with-mm=__LB__libmm installation directory__RB__% make% make install])m4_p([dnlPost-installation, modules can use this extension via the functionsdocumented in $APACHE_INCLUDEDIR/mod_db4_export.h.])m4_page_footer
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -