Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 2544 invoked from network); 25 Feb 2004 16:56:18 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 25 Feb 2004 16:56:18 -0000 Received: (qmail 42332 invoked by uid 500); 25 Feb 2004 16:55:29 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 42290 invoked by uid 500); 25 Feb 2004 16:55:29 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 42230 invoked from network); 25 Feb 2004 16:55:28 -0000 Received: from unknown (HELO minotaur.apache.org) (209.237.227.194) by daedalus.apache.org with SMTP; 25 Feb 2004 16:55:28 -0000 Received: (qmail 1975 invoked from network); 25 Feb 2004 16:55:34 -0000 Received: from localhost.hyperreal.org (HELO PC0133) (127.0.0.1) by localhost.hyperreal.org with SMTP; 25 Feb 2004 16:55:34 -0000 Message-ID: <403CD372.7030609@apache.org> Date: Wed, 25 Feb 2004 17:55:14 +0100 From: Henri Gomez User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: dev@httpd.apache.org Subject: Re: Apache 2 module hook priorities, was: Help required on Apache from scratch... References: <403CBE8B.20003@wstoddard.com> <403CC1F0.4030500@apache.org> <20040225162842.GD3295@gkar.earthdome.org> In-Reply-To: <20040225162842.GD3295@gkar.earthdome.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 25/02/2004), Outbound message X-Antivirus-Status: Clean X-Spam-Rating: localhost.hyperreal.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Glenn Nielsen wrote: > On Wed, Feb 25, 2004 at 04:40:32PM +0100, Henri Gomez wrote: > >>Bill Stoddard wrote: >> >> >>>Benedict DSilva wrote: >>> >>> >>>>Hi all, >>>>Just wanted to know about how does the Apache HTTP Server start, and >>>>all that it does with the modules (Initialization, Configuration etc). >>> >>> >>>Explaining how Apache HTTPD works to the degree of detail you are >>>looking for is a rather tall request to answer in an email. My >>>suggestion is to pick up a copy of Ryan Bloom's Complete Reference to >>>Apache 2.0 then read the code. >> >>Did there is a book for modules writers ? >> >>I'm working on jk2 connector (mod_jk2) and looking for some >>nasty problem (mostly conflict between jk2 and others modules). >> >>Help welcomed ... > > > Henri, > > Getting the priority set correctly for hooks in JK2 is sticky. > You might take a look at what I did setting hook priority in > mod_jk 1.2 so that it would work correctly with mod_dir. My > cvs commit messages might be helpful from > jakarta-tomcat-connectors/jk/native/apache-2.0/mod_jk.c . > > Here is the page the docs how hook priority works: > > http://httpd.apache.org/docs-2.0/developer/hooks.html > > It all comes down to carefully reviewing the hook priority of other > modules and how those modules interact with JK2. Then setting the > hook priorities in JK2. Well I read jk 1.2.x and 2.0.x and see no differences : jk : static void jk_register_hooks(apr_pool_t *p) { ap_hook_handler(jk_handler,NULL,NULL,APR_HOOK_MIDDLE); ap_hook_post_config(jk_post_config,NULL,NULL,APR_HOOK_MIDDLE); ap_hook_child_init(jk_child_init,NULL,NULL,APR_HOOK_MIDDLE); ap_hook_translate_name(jk_translate,NULL,NULL,APR_HOOK_MIDDLE); #if (MODULE_MAGIC_NUMBER_MAJOR > 20010808) ap_hook_map_to_storage(jk_map_to_storage,NULL,NULL,APR_HOOK_MIDDLE); #endif } jk2 : static void jk2_register_hooks(apr_pool_t *p) { ap_hook_handler(jk2_handler, NULL, NULL, APR_HOOK_MIDDLE); ap_hook_post_config(jk2_post_config,NULL,NULL,APR_HOOK_MIDDLE); /* Force the mpm to run before us and set the scoreboard image */ ap_hook_child_init(jk2_child_init,NULL,NULL,APR_HOOK_LAST); ap_hook_translate_name(jk2_translate,NULL,NULL,APR_HOOK_FIRST); /* use APR_HOOK_MIDDLE instead ? */ ap_hook_map_to_storage(jk2_map_to_storage, NULL, NULL, APR_HOOK_MIDDLE); } The registering is very similar to me ... I see in CVS that sometime in the past there was in jk : static void jk_register_hooks(apr_pool_t *p) { { ap_hook_handler(jk_handler, NULL, NULL, APR_HOOK_MIDDLE); /* Make sure mod_alias runs before mod_jk to make sure that Alias's are mapped before mod_jk tries to process the request */ static const char * const aszPre[] = { "mod_alias.c", NULL }; /* Make sure mod_dir runs after mod_jk so that a DirectoryIndex index.jsp works */ static const char * const aszPost[] = { "mod_dir.c", NULL }; ap_hook_handler(jk_handler,aszPre,aszPost,APR_HOOK_MIDDLE); ap_hook_post_config(jk_post_config,NULL,NULL,APR_HOOK_MIDDLE); ap_hook_post_config(jk_post_config,NULL,NULL,APR_HOOK_MIDDLE); ap_hook_child_init(jk_child_init,NULL,NULL,APR_HOOK_MIDDLE); ap_hook_child_init(jk_child_init,NULL,NULL,APR_HOOK_MIDDLE); ap_hook_translate_name(jk_translate,NULL,NULL,APR_HOOK_FIRST); ap_hook_translate_name(jk_translate,aszPre,aszPost,APR_HOOK_MIDDLE); #if (MODULE_MAGIC_NUMBER_MAJOR > 20010808) #if (MODULE_MAGIC_NUMBER_MAJOR > 20010808) ap_hook_map_to_storage(jk_map_to_storage, NULL, NULL, APR_HOOK_MIDDLE); ap_hook_map_to_storage(jk_map_to_storage,aszPre,aszPost,APR_HOOK_MIDDLE); #endif #endif } } Need advices here ...