Hello there,

First appology me if my english is bad or if I sent this question to the wrong mailing list, since I have
search a lot with google and was not able to find any good hint about that kind of question.


I am making a module for apache2 only that does Virtual Hosting System within SQL or LDAP backend.
The module is based on heavy modified mod_vdbh and some functionalities from me.


I have one problem is to set internal variable from Apache 2 (DOCUMENT_ROOT) to the correct value (intead of getting
the global one all the time).


I have a module like that (parts of my source code) :

static void register_hooks(apr_pool_t *p)
{
        ap_hook_post_config(vhs_init_handler, NULL, NULL, APR_HOOK_MIDDLE);
        ap_hook_translate_name(vhs_translate_name, NULL, NULL, APR_HOOK_FIRST);
}

AP_DECLARE_DATA module vhs_module = {
    STANDARD20_MODULE_STUFF,
    NULL,                       /* create per-directory config structure */
    NULL,                       /* merge per-directory config structures */
    vhs_create_server_config,   /* create per-server config structure */
    vhs_merge_server_config,    /* merge per-server config structures */
    vhs_commands,               /* command apr_table_t */
    register_hooks              /* register hooks */
};

on

static int vhs_translate_name(request_rec *r)
{
  char *document_root;
 /*
  * Usual works and data handling
  */
 return OK;
}

How can I set the document root variable to value from document_root variable in vhs_translate_name correctly ?

 I can set a third party variable using for example :

 apr_table_set(r->subprocess_env, "VH_DOCUMENT_ROOT", document_root);


But I never been able to change the conf->ap_document_root variable correctly even with taking some source code
from core.c of apache 2.


 Please help me to get the right way to do that...

 Many thanks, and happy new year for all,

/Xavier

--
Xavier Beaudouin - Unix System Administrator & Projects Leader.
President of Kazar Organization : http://www.kazar.net/
Please visit http://caudium.net/, home of Caudium & Camas projects



Reply via email to