You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Jeff Trawick <tr...@ibm.net> on 2000/06/20 04:07:00 UTC

Re: Apache 2.0 does not work with virtual-host

> Date: Tue, 20 Jun 2000 10:38:55 +0900 (KST)
> From: JunSeon Oh <ho...@holywar.net>
> X-Sender: hollywar@alamis.holywar.net
> Content-Type: text/plain; charset=US-ASCII
> X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N
> X-UIDL: 003d9b25286c8e4d7ac5aad444835e30
> 
> I'm testing apache-2.0a4 now.
> 
> We try running apache-2.0 at our service machine.
> But, httpd has gone by some vhost options. see below please
> 
> ------------------------------------------------------------------
> 
> Command ;
> 
> bash-2.03# /usr/local/sbin/apachectl start
> Segmentation fault - core dumped
> /usr/local/sbin/apachectl start: httpd could not be started

Hmmm...  I fixed a virtual host problem like this in 2.0a5-dev, but I 
didn't mention it in the CHANGES file which means I thought the problem
was introduced in 2.0a5-dev...  Looking in CVS now I think this was
broken in 2.0a4...

Would you be willing to apply the patch below (just modify the 10 or
so lines changed by the patch if you aren't comfortable with the patch
command) and let me know whether or not it fixes your problem?

Look in http_main.c first to see if the code around the changed lines
is the same.

If the patch doesn't make the problem go away, run gdb on your core dump

  gdb xyz/src/httpd httpd.core

and run the "bt" command and post the output.

Thanks a bunch!!!!!!!

Jeff

Revision  Changes    Path
1.31      +1 -0      apache-2.0/src/include/http_config.h

Index: http_config.h
===================================================================
RCS file: /home/cvs/apache-2.0/src/include/http_config.h,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- http_config.h     2000/06/06 01:20:01     1.30
+++ http_config.h     2000/06/11 22:06:56     1.31
@@ -385,6 +385,7 @@
 API_EXPORT(void) ap_post_config_hook(ap_pool_t *pconf, ap_pool_t *plog, ap_pool_t *ptemp, server_rec *s);
 API_EXPORT(void) ap_run_rewrite_args(process_rec *process);
 API_EXPORT(void) ap_register_hooks(module *m);
+API_EXPORT(void) ap_fixup_virtual_hosts(ap_pool_t *p, server_rec *main_server);
   
 /* For http_request.c... */
  
  
  
  
1.61      +1 -5      apache-2.0/src/main/http_config.c
  
Index: http_config.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/main/http_config.c,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -r1.60 -r1.61
--- http_config.c     2000/06/06 01:20:02     1.60
+++ http_config.c     2000/06/11 22:06:57     1.61
@@ -1479,7 +1479,7 @@
 }
   
   
-static void fixup_virtual_hosts(ap_pool_t *p, server_rec *main_server)
+API_EXPORT(void) ap_fixup_virtual_hosts(ap_pool_t *p, server_rec *main_server)
 {
     server_rec *virt;
   
@@ -1575,10 +1575,6 @@
   
     process_command_config(s, ap_server_post_read_config, conftree,
                                         p, ptemp);
-
-    fixup_virtual_hosts(p, s);
-    ap_fini_vhost_config(p, s);
-    ap_sort_hooks();
 
     return s;
 }
  
  
  
1.59      +7 -0      apache-2.0/src/main/http_main.c
  
Index: http_main.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/main/http_main.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -r1.58 -r1.59
--- http_main.c       2000/06/10 16:14:56     1.58
+++ http_main.c       2000/06/11 22:06:57     1.59
@@ -62,6 +62,7 @@
 #include "http_main.h" 
 #include "http_log.h" 
 #include "http_config.h"
+#include "http_vhost.h"
 #include "util_uri.h" 
 #include "util_ebcdic.h"
 #include "apr_getopt.h"
@@ -371,6 +372,9 @@
     server_conf = ap_read_config(process, ptemp, confname, &conftree);
     ap_run_pre_config(pconf, plog, ptemp);
     ap_process_config_tree(server_conf, conftree, process->pconf, ptemp); 
+    ap_fixup_virtual_hosts(pconf, server_conf);
+    ap_fini_vhost_config(pconf, server_conf);
+    ap_sort_hooks();
     if (configtestonly) {
      ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, "Syntax OK\n");
      destroy_and_exit_process(process, 0);
@@ -396,6 +400,9 @@
         server_conf = ap_read_config(process, ptemp, confname, &conftree);
      ap_run_pre_config(pconf, plog, ptemp);
         ap_process_config_tree(server_conf, conftree, process->pconf, ptemp); 
+        ap_fixup_virtual_hosts(pconf, server_conf);
+        ap_fini_vhost_config(pconf, server_conf);
+        ap_sort_hooks();
      ap_clear_pool(plog);
      ap_run_open_logs(pconf, plog, ptemp, server_conf);
      ap_post_config_hook(pconf, plog, ptemp, server_conf);

-- 
Jeff Trawick | trawick@ibm.net | PGP public key at web site:
     http://www.geocities.com/SiliconValley/Park/9289/
          Born in Roswell... married an alien...

Re: Apache 2.0 does not work with virtual-host

Posted by JunSeon Oh <ho...@holywar.net>.
Thanks very much for your help. 

I successed compiled apache-20a4 and now we running it with v-host.
This service machines accomplish more than 1000 http request per seconds.
( many kinds of image files are 60% , and the other is CGI )

first , i set a max thread to 128 , and max proc to 8. 
haha.. then server got a crazy by flood of cpu load. :)

current setting is 

max proc = 64
max thread = 25

64 * 25 = 1600

below is current cpu and memory status ;

CPU: AMD Athlon(tm) Processor (704.94-MHz 686-class CPU)

CPU states: 25.4% user,  0.0% nice, 40.4% system,  1.9% interrupt, 32.3% idle
Mem: 132M Active, 94M Inact, 71M Wired, 7684K Cache, 48M Buf, 71M Free
Swap: 512M Total, 20K Used, 512M Free

                        SIZE    RES                 WCPU    CPU
82301 nobody     2   0 10620K  3600K poll     0:00  3.01%  0.78% httpd

how can i tunning it for get the max perfomence.? 


PS : It works cool!!!!! that eats a low memory and a lot of process :)
     Thanks again ~! :)

-------------------------------------------------------------
Software Development Team / Manager / JunSeon Oh
Email : holywar@holynet.co.kr
Internet total solutions - holynet  (http://www.holywar.net)
-------------------------------------------------------------

On Mon, 19 Jun 2000, Jeff Trawick wrote:

trawick> > Date: Tue, 20 Jun 2000 10:38:55 +0900 (KST)
trawick> > From: JunSeon Oh <ho...@holywar.net>
trawick> > X-Sender: hollywar@alamis.holywar.net
trawick> > Content-Type: text/plain; charset=US-ASCII
trawick> > X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N
trawick> > X-UIDL: 003d9b25286c8e4d7ac5aad444835e30
trawick> > 
trawick> > I'm testing apache-2.0a4 now.
trawick> > 
trawick> > We try running apache-2.0 at our service machine.
trawick> > But, httpd has gone by some vhost options. see below please
trawick> > 
trawick> > ------------------------------------------------------------------
trawick> > 
trawick> > Command ;
trawick> > 
trawick> > bash-2.03# /usr/local/sbin/apachectl start
trawick> > Segmentation fault - core dumped
trawick> > /usr/local/sbin/apachectl start: httpd could not be started
trawick> 
trawick> Hmmm...  I fixed a virtual host problem like this in 2.0a5-dev, but I 
trawick> didn't mention it in the CHANGES file which means I thought the problem
trawick> was introduced in 2.0a5-dev...  Looking in CVS now I think this was
trawick> broken in 2.0a4...
trawick> 
trawick> Would you be willing to apply the patch below (just modify the 10 or
trawick> so lines changed by the patch if you aren't comfortable with the patch
trawick> command) and let me know whether or not it fixes your problem?
trawick> 
trawick> Look in http_main.c first to see if the code around the changed lines
trawick> is the same.
trawick> 
trawick> If the patch doesn't make the problem go away, run gdb on your core dump
trawick> 
trawick>   gdb xyz/src/httpd httpd.core
trawick> 
trawick> and run the "bt" command and post the output.
trawick> 
trawick> Thanks a bunch!!!!!!!
trawick> 
trawick> Jeff
trawick> 
trawick> Revision  Changes    Path
trawick> 1.31      +1 -0      apache-2.0/src/include/http_config.h
trawick> 
trawick> Index: http_config.h
trawick> ===================================================================
trawick> RCS file: /home/cvs/apache-2.0/src/include/http_config.h,v
trawick> retrieving revision 1.30
trawick> retrieving revision 1.31
trawick> diff -u -r1.30 -r1.31
trawick> --- http_config.h     2000/06/06 01:20:01     1.30
trawick> +++ http_config.h     2000/06/11 22:06:56     1.31
trawick> @@ -385,6 +385,7 @@
trawick>  API_EXPORT(void) ap_post_config_hook(ap_pool_t *pconf, ap_pool_t *plog, ap_pool_t *ptemp, server_rec *s);
trawick>  API_EXPORT(void) ap_run_rewrite_args(process_rec *process);
trawick>  API_EXPORT(void) ap_register_hooks(module *m);
trawick> +API_EXPORT(void) ap_fixup_virtual_hosts(ap_pool_t *p, server_rec *main_server);
trawick>    
trawick>  /* For http_request.c... */
trawick>   
trawick>   
trawick>   
trawick>   
trawick> 1.61      +1 -5      apache-2.0/src/main/http_config.c
trawick>   
trawick> Index: http_config.c
trawick> ===================================================================
trawick> RCS file: /home/cvs/apache-2.0/src/main/http_config.c,v
trawick> retrieving revision 1.60
trawick> retrieving revision 1.61
trawick> diff -u -r1.60 -r1.61
trawick> --- http_config.c     2000/06/06 01:20:02     1.60
trawick> +++ http_config.c     2000/06/11 22:06:57     1.61
trawick> @@ -1479,7 +1479,7 @@
trawick>  }
trawick>    
trawick>    
trawick> -static void fixup_virtual_hosts(ap_pool_t *p, server_rec *main_server)
trawick> +API_EXPORT(void) ap_fixup_virtual_hosts(ap_pool_t *p, server_rec *main_server)
trawick>  {
trawick>      server_rec *virt;
trawick>    
trawick> @@ -1575,10 +1575,6 @@
trawick>    
trawick>      process_command_config(s, ap_server_post_read_config, conftree,
trawick>                                          p, ptemp);
trawick> -
trawick> -    fixup_virtual_hosts(p, s);
trawick> -    ap_fini_vhost_config(p, s);
trawick> -    ap_sort_hooks();
trawick>  
trawick>      return s;
trawick>  }
trawick>   
trawick>   
trawick>   
trawick> 1.59      +7 -0      apache-2.0/src/main/http_main.c
trawick>   
trawick> Index: http_main.c
trawick> ===================================================================
trawick> RCS file: /home/cvs/apache-2.0/src/main/http_main.c,v
trawick> retrieving revision 1.58
trawick> retrieving revision 1.59
trawick> diff -u -r1.58 -r1.59
trawick> --- http_main.c       2000/06/10 16:14:56     1.58
trawick> +++ http_main.c       2000/06/11 22:06:57     1.59
trawick> @@ -62,6 +62,7 @@
trawick>  #include "http_main.h" 
trawick>  #include "http_log.h" 
trawick>  #include "http_config.h"
trawick> +#include "http_vhost.h"
trawick>  #include "util_uri.h" 
trawick>  #include "util_ebcdic.h"
trawick>  #include "apr_getopt.h"
trawick> @@ -371,6 +372,9 @@
trawick>      server_conf = ap_read_config(process, ptemp, confname, &conftree);
trawick>      ap_run_pre_config(pconf, plog, ptemp);
trawick>      ap_process_config_tree(server_conf, conftree, process->pconf, ptemp); 
trawick> +    ap_fixup_virtual_hosts(pconf, server_conf);
trawick> +    ap_fini_vhost_config(pconf, server_conf);
trawick> +    ap_sort_hooks();
trawick>      if (configtestonly) {
trawick>       ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, "Syntax OK\n");
trawick>       destroy_and_exit_process(process, 0);
trawick> @@ -396,6 +400,9 @@
trawick>          server_conf = ap_read_config(process, ptemp, confname, &conftree);
trawick>       ap_run_pre_config(pconf, plog, ptemp);
trawick>          ap_process_config_tree(server_conf, conftree, process->pconf, ptemp); 
trawick> +        ap_fixup_virtual_hosts(pconf, server_conf);
trawick> +        ap_fini_vhost_config(pconf, server_conf);
trawick> +        ap_sort_hooks();
trawick>       ap_clear_pool(plog);
trawick>       ap_run_open_logs(pconf, plog, ptemp, server_conf);
trawick>       ap_post_config_hook(pconf, plog, ptemp, server_conf);
trawick> 
trawick> -- 
trawick> Jeff Trawick | trawick@ibm.net | PGP public key at web site:
trawick>      http://www.geocities.com/SiliconValley/Park/9289/
trawick>           Born in Roswell... married an alien...
trawick>