Return-Path: Delivered-To: apmail-new-httpd-archive@apache.org Received: (qmail 82284 invoked by uid 500); 11 Jun 2001 17:25:23 -0000 Mailing-List: contact new-httpd-help@apache.org; run by ezmlm Precedence: bulk Reply-To: new-httpd@apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list new-httpd@apache.org Received: (qmail 82251 invoked from network); 11 Jun 2001 17:25:19 -0000 Errors-To: Message-ID: <014601c0f29b$30faf660$93c0b0d0@roweclan.net> From: "William A. Rowe, Jr." To: , Subject: Fw: Small patch for the vhost_alias module Date: Mon, 11 Jun 2001 12:20:51 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N Forwarding this to the proper list for you... and I'll personally look at it this week as I review directory parsing throughout (particularly for Apache 2.0). Bill ----- Original Message ----- From: "gatorette" Newsgroups: comp.infosystems.www.servers.ms-windows Sent: Monday, June 11, 2001 10:18 AM Subject: Small patch for the vhost_alias module > Running Apache 1.3.19 (going to 1.3.20 soon) on a Win2K Server box, I > wanted to add dynamically configured virtual hosting through the > vhost_alias module. After having compiled the module, I modified my > 'httpd.conf' so that it would load it and I set up a > 'VirtualDocumentRoot "d:/users/%1"'. To my surprise, Apache rejected > my command with a "format string must start with '/' or be 'none'" > error. Obviously the module was meant for *nix systems and not > Windows! > > To solve this (small) bug I modified lightly the source code of the > module so that, under Windows, it also accepts drive letters. I don't > have time and knowledge to test it extensively, and it might not > conform standard rules, but this solution works for me. > > *** In the file "mod_vhost_alias.c", modify the lines : ***** > > if (*map != '/') { > if (strcasecmp(map, "none")) { > return "format string must start with '/' or be 'none'"; > } > *pmap = NULL; > *pmode = VHOST_ALIAS_NONE; > return NULL; > } > > *************************** To : ******************************* > > if (*map != '/') { > #ifdef WIN32 > if( strncasecmp( map+1, ":/", 2 ) ) { > if (strcasecmp(map, "none")) { > return "format string must start with 'drive:/' or '/' or be > 'none'"; > } > *pmap = NULL; > *pmode = VHOST_ALIAS_NONE; > return NULL; > } > #else > if (strcasecmp(map, "none")) { > return "format string must start with '/' or be 'none'"; > } > *pmap = NULL; > *pmode = VHOST_ALIAS_NONE; > return NULL; > #endif > } > > **************************************************************************** > > What it does is extract the second and third letters of the parameter > and check it is ':/' { 'strncasecmp( map+1, ":/", 2 )' }. > > I'm waiting for your comments! > > > ----------- >