httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Akins <>
Subject Re: [feature request] defaultports directive for improved loadbalancing/NAT support
Date Fri, 03 Sep 2004 14:25:02 GMT
On Fri, 2004-09-03 at 10:14, V. T. Mueller, Continum wrote:
> Hello all,
> For security and loadbalancing reasons we have certain apaches running 
> behind a loadbalancer that does NAT. For better host security, the
> user is not root and has httpd listen >1023. This setup is broken by
> mod_dir behaviour when "fixing" omitted trailing slashes. Example:

We do something similar.  I wrote a quick little module that does
something like:

/*default in create_server_config
#define NOCONFIG -1

static int port(request_rec *r)
    port_config *conf;

    if((conf = ap_get_module_config(r->server->module_config,
&port_module)) !=\ NULL) {
        if(conf->port != NOCONFIG) {
            /*looking at server/core.c, ap_get_server_port this looks to
be the best place
             * UseCanonicalName MUST be off, or this is ignored*/
            r->parsed_uri.port = conf->port;

    return DECLINED;

registered like:

ap_hook_translate_name(port, NULL, NULL, APR_HOOK_FIRST);

Brian Akins
Lead Systems Engineer
CNN Internet Operations

View raw message