Return-Path: Delivered-To: new-httpd-archive@hyperreal.org Received: (qmail 25433 invoked by uid 6000); 11 Jun 1999 13:08:17 -0000 Received: (qmail 25427 invoked from network); 11 Jun 1999 13:08:16 -0000 Received: from devsys.jagunet.com (206.156.208.6) by taz.hyperreal.org with SMTP; 11 Jun 1999 13:08:16 -0000 Received: (from jim@localhost) by devsys.jaguNET.com (8.9.3/jag-2.6) id JAA07203 for new-httpd@apache.org; Fri, 11 Jun 1999 09:08:12 -0400 (EDT) From: Jim Jagielski Message-Id: <199906111308.JAA07203@devsys.jaguNET.com> Subject: Re: standard virtual hosting.. how good? To: new-httpd@apache.org Date: Fri, 11 Jun 1999 09:08:12 -0400 (EDT) In-Reply-To: <19990611145033.B25977@xs4all.nl> from "Mathijs Maassen" at Jun 11, 99 02:50:33 pm X-Mailer: ELM [version 2.4 PL25] Content-Type: text Sender: new-httpd-owner@apache.org Precedence: bulk Reply-To: new-httpd@apache.org This is good... I'm +1 for this being in 1.3.7/1.4.0 Mathijs Maassen wrote: > > > --FCuugMFkClbJLl1L > Content-Type: text/plain; charset=us-ascii > > On Fri, Jun 11, 1999 at 01:06:10PM +0100, Tony Finch wrote: > > We have some machines with about 1000 configuration > > sections and one of the problems it the time it takes to parse the > > configuration file (but that's an old version of Apache & newer ones > > We had the same problem. Apache does a stat() on the DocumentRoot of all > vhosts. And that slows things down a bit if you have lots of vhosts. The > attached patch adds a DocumentrootCheck config option, which enables you to > turn this behaviour off. The startuptime on one of our webservers, with 4000 > vhosts, dropped from 3 minutes minutes to 2 seconds. > > Mathijs > > -- > /* Mathijs Maassen */ main()?? =??<0xEE4A4AA,0x8A4A4AA,0xE84E4EE,0x284A4AE,0xE84AEEA??>,z=5;for( > ;z--;)for(x=1;x<<=1;)putchar(x*2?y??(z??)&x?'??=':' ':'??/n');??> > > --FCuugMFkClbJLl1L > Content-Type: text/plain; charset=us-ascii > Content-Disposition: attachment; filename="apache_1.3.6-documentrootcheck.diff" > > diff -C3 -r apache_1.3.6.orig/src/include/http_conf_globals.h apache_1.3.6/src/include/http_conf_globals.h > *** apache_1.3.6.orig/src/include/http_conf_globals.h Fri Jan 1 20:04:39 1999 > --- apache_1.3.6/src/include/http_conf_globals.h Tue Jun 1 19:02:40 1999 > *************** > *** 67,72 **** > --- 67,73 ---- > */ > > extern int ap_standalone; > + extern int ap_no_documentroot_check; > extern uid_t ap_user_id; > extern char *ap_user_name; > extern gid_t ap_group_id; > diff -C3 -r apache_1.3.6.orig/src/main/http_core.c apache_1.3.6/src/main/http_core.c > *** apache_1.3.6.orig/src/main/http_core.c Sat Mar 20 00:54:08 1999 > --- apache_1.3.6/src/main/http_core.c Wed Jun 2 13:41:42 1999 > *************** > *** 1004,1010 **** > } > > arg = ap_os_canonical_filename(cmd->pool, arg); > ! if (!ap_is_directory(arg)) { > if (cmd->server->is_virtual) { > fprintf(stderr, "Warning: DocumentRoot [%s] does not exist\n", > arg); > --- 1004,1010 ---- > } > > arg = ap_os_canonical_filename(cmd->pool, arg); > ! if (!ap_no_documentroot_check && !ap_is_directory(arg)) { > if (cmd->server->is_virtual) { > fprintf(stderr, "Warning: DocumentRoot [%s] does not exist\n", > arg); > *************** > *** 1018,1023 **** > --- 1018,1035 ---- > return NULL; > } > > + static const char *set_document_root_check(cmd_parms *cmd, void *dummy, int arg) > + { > + const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY); > + > + if (err != NULL) { > + return err; > + } > + > + ap_no_documentroot_check = arg == 0; > + return NULL; > + } > + > API_EXPORT(void) ap_custom_response(request_rec *r, int status, char *string) > { > core_dir_config *conf = > *************** > *** 2728,2733 **** > --- 2740,2747 ---- > "Name(s) of per-directory config files (default: .htaccess)" }, > { "DocumentRoot", set_document_root, NULL, RSRC_CONF, TAKE1, > "Root directory of the document tree" }, > + { "DocumentRootCheck", set_document_root_check, NULL, RSRC_CONF, FLAG, > + "En-/Disable documentroot checking" }, > { "ErrorDocument", set_error_document, NULL, OR_FILEINFO, RAW_ARGS, > "Change responses for HTTP errors" }, > { "AllowOverride", set_override, NULL, ACCESS_CONF, RAW_ARGS, > diff -C3 -r apache_1.3.6.orig/src/main/http_main.c apache_1.3.6/src/main/http_main.c > *** apache_1.3.6.orig/src/main/http_main.c Thu Mar 18 00:05:43 1999 > --- apache_1.3.6/src/main/http_main.c Tue Jun 1 19:00:33 1999 > *************** > *** 226,231 **** > --- 226,232 ---- > */ > > int ap_standalone; > + int ap_no_documentroot_check; > uid_t ap_user_id; > char *ap_user_name; > gid_t ap_group_id; > > --FCuugMFkClbJLl1L-- > -- =========================================================================== Jim Jagielski ||| jim@jaguNET.com ||| http://www.jaguNET.com/ "That's no ordinary rabbit... that's the most foul, cruel and bad-tempered rodent you ever laid eyes on"