httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <dgau...@arctic.org>
Subject Re: standard virtual hosting.. how good?
Date Thu, 17 Jun 1999 01:55:14 GMT
Why not just remove the stat() altogether?  Seems pointless to me... folks
will get various file not found errors in the error_log anyhow if the
docroot doesn't exist; or get ENOTDIR errors if the file isn't a
directory.

Dean

On Fri, 11 Jun 1999, Jim Jagielski wrote:

> 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 <VirtualHost> 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 <mathijs@xs4all.nl> */ main()??<long x,y??(??)
> > =??<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"
> 


Mime
View raw message