httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "junbin liu" <tia...@gmail.com>
Subject want to get per_dir_config_rec.
Date Wed, 28 May 2008 04:33:19 GMT
 Hello folks,
  When start apache, In the process phase of post_config
((ap_hook_post_config(post_config...))

how to get my module's per_dir_config_rec of <Location> under each
<VirtualHost>

★ My httpd.conf definition as below:
--------------------------------------
  ......
<Location "/root01">
 DEFXX  XX
</Location>
<Location "/root02">
 DEFXX  XX
</Location>

<VirtualHost 192.168.1.1:80 <http://192.168.1.1/>>
 <Location "test02">
  DEFXX  XX
 </Location>
 <Location "test03">
  DEFXX  XX
 </Location>
</VirtualHost>
<VirtualHost 192.168.1.1:443>
 <Location "test02">
  DEFXX  XX
 </Location>
 <Location "test03">
  DEFXX  XX
 </Location>
</VirtualHost>

<VirtualHost 192.168.1.2:80 <http://192.168.1.2/>>
 <Location "test04">
  DEFXX  XX
 </Location>
 <Location "test05">
  DEFXX  XX
 </Location>
</VirtualHost>
<VirtualHost 192.168.1.2:443>
 <Location "test04">
  DEFXX  XX
 </Location>
 <Location "test05">
  DEFXX  XX
 </Location>
</VirtualHost>
......
 --------------------------------------

  ★ my Function of post_conf as below:
--------------------------------------
static int post_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t
*ptemp, server_rec *s) {
 server_rec *news = NULL;
 auth_clip_server_config_rec *newsconf = NULL;
 news = s;
 while(news) {
  core_server_config *coresconf = NULL;
  auth_clip_dir_config_rec *newdconf = NULL;

  LOG("server_name =", news->server_hostname);
  coresconf = (core_server_config
*)ap_get_module_config(news->module_config, &core_module);
  ap_conf_vector_t **dirs = (ap_conf_vector_t **)coresconf->sec_url->elts;

  int i;
  for (i = 0; i < coresconf->sec_dir->nelts; i++) {
    newdconf = (auth_clip_dir_config_rec *)ap_get_module_config(dirs[i],
&auth_clip_module);
    if(newdconf) {
        LOG("per dir conf=", newdconf->dir);
    }
  }
  news = news->next;
 }
}
--------------------------------------

★ and the output for function are:
--------------------------------------
 server_name = default servername
per dir conf= root1
per dir conf= root2
 server_name = 192.168.1.1:80's servername
per dir conf= root1
per dir conf= root2
 server_name = 192.168.1.1:443's servername
per dir conf= root1
per dir conf= root2
 server_name = 192.168.1.2:80's servername
per dir conf= root1
per dir conf= root2
 server_name = 192.168.1.2:443's servername
per dir conf= root1
per dir conf= root2
--------------------------------------

★ but the output i want to get are:
--------------------------------------
server_name = default servername
      per dir conf= root1
per dir conf= root2
  server_name = 192.168.1.1:80's servername
per dir conf= test02
per dir conf= test03
   server_name = 192.168.1.1:443's servername
 per dir conf= test02
per dir conf= test03
   server_name = 192.168.1.2:80's servername
 per dir conf= test04
per dir conf= test05
   server_name = 192.168.1.2:443's servername
  per dir conf= test04
per dir conf= test05
--------------------------------------

★ How to get my desired output?

――――――――――――――――――END――――――――――――――――――――――――――

Thank you for take your time to read this email. Have a nice day

Tiaroy

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message