From modules-dev-return-444-apmail-httpd-modules-dev-archive=httpd.apache.org@httpd.apache.org Thu Mar 22 15:28:50 2007 Return-Path: Delivered-To: apmail-httpd-modules-dev-archive@locus.apache.org Received: (qmail 24466 invoked from network); 22 Mar 2007 15:28:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Mar 2007 15:28:50 -0000 Received: (qmail 92352 invoked by uid 500); 22 Mar 2007 15:28:55 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 92255 invoked by uid 500); 22 Mar 2007 15:28:54 -0000 Mailing-List: contact modules-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: modules-dev@httpd.apache.org Delivered-To: mailing list modules-dev@httpd.apache.org Received: (qmail 92246 invoked by uid 99); 22 Mar 2007 15:28:54 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Mar 2007 08:28:54 -0700 X-ASF-Spam-Status: No, hits=2.7 required=10.0 tests=RCVD_IN_SBL,SPF_HELO_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [216.138.240.12] (HELO mail.acerenting.com) (216.138.240.12) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Mar 2007 08:28:43 -0700 Received: from HP72472929110 (unknown [216.130.212.102]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by mail.acerenting.com (Postfix) with ESMTP id 99D321580043 for ; Thu, 22 Mar 2007 11:28:55 -0400 (EDT) Message-ID: <076001c76c96$b5a7b670$66d482d8@HP72472929110> Reply-To: "Danie Qian" From: "Danie Qian" To: References: <072201c76c85$06861850$66d482d8@HP72472929110> <20070322134627.4d8b8bf5@grimnir> Subject: Re: load data at server startup - is ap_hook_post_config() the right place? Date: Thu, 22 Mar 2007 11:28:14 -0400 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="gb2312"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3028 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 X-Virus-Checked: Checked by ClamAV on apache.org ----- Original Message ----- From: "Nick Kew" To: Sent: Thursday, March 22, 2007 9:46 AM Subject: Re: load data at server startup - is ap_hook_post_config() the right place? > On Thu, 22 Mar 2007 09:21:39 -0400 > "Danie Qian" wrote: > >> I am new to module development but I want to develop a module so I >> can manage the uri of the thousand of sites more efficiently. What I >> want is to load a mysql table data into the memory of Apache server >> at its startup stage for fast processing of requests later. > > 1. Have you seen mod_vhost_dbi? I need to combine some information from an external configuration file with those from mysql. Can this module do the non-sql part too? > 2. The normal way to access mysql is through mod_dbd. This would be ideal for my situation. However, as I am still new in module development it doesnt look intuitive to me right now after skimming through chapter 11 of your new book. > > Having said that, it's not clear whether either of those > is actually relevant to you. > >> Mysql >> database access information will be set with configuration >> directives. My question is: 1. Is ap_hook_post_config(apr_pool_t *p, >> apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s) the right place >> to load the table? > > Yes, probably. > > 2. If it is, how can the hook functions access the >> data after it is loaded presumably in apr_pool_t *p? > > Store it on your module's server config. the server_rec doesnt have a pool field. which field can I use to store the data? Does every child process have an instance of this structure instead of the parent process? Thanks, Daniel Does