Re: [Speedycgi-users] Apache log/STDERR problems
Brought to you by:
samh
|
From: Sam H. <sa...@da...> - 2003-11-16 07:26:49
|
The frontend is turning off O_APPEND on both stdout and stderr. I should
have a more thorough fix on the cvs server soon, but a quick fix is the
following patch:
Index: src/speedy_main.c
===================================================================
RCS file: /cvsroot/speedycgi/2.x/src/speedy_main.c,v
retrieving revision 1.23
diff -c -r1.23 speedy_main.c
*** src/speedy_main.c 7 Oct 2003 04:03:48 -0000 1.23
--- src/speedy_main.c 16 Nov 2003 07:23:15 -0000
***************
*** 73,79 ****
#endif
speedy_renew(fdinfo, fdinfo_size, fdinfo_t);
}
! fdinfo[fd].flags = flags;
fdinfo[fd].state = FD_UNKNOWN;
fd_change(fd, state);
}
--- 73,79 ----
#endif
speedy_renew(fdinfo, fdinfo_size, fdinfo_t);
}
! fdinfo[fd].flags = fcntl(fd, F_GETFL);
fdinfo[fd].state = FD_UNKNOWN;
fd_change(fd, state);
}
> This is a multi-part message in MIME format.
> --------------000606070009020103080100
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit
>
> I have tested using normal perl, and that works as expected. I've
> attached a transcript of the steps you've requested.
>
> Thanks,
> Grant
>
> Sam Horrocks wrote:
> >
> > Have you tried switching back to normal perl and doing the same test?
> >
> > Can you send me a typescript that shows the problem? Cat the error
> > log before starting apache, cat your test script and httpd.conf, start
> > apache, do a few requests with "ab" to your test script, then cat the
> > error log again. I'll try to reproduce it.
>
> --------------000606070009020103080100
> Content-Type: text/plain;
> name="typescript"
> Content-Transfer-Encoding: 7bit
> Content-Disposition: inline;
> filename="typescript"
>
> [grant@localhost apache]$ cat conf/httpd.conf
>
> ServerType standalone
>
> LogLevel debug
>
> ServerRoot "/home/grant/apache"
>
> PidFile /home/grant/apache/var/apache.pid
>
> SetEnv PATH /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
>
> CoreDumpDirectory /tmp
>
> ClearModuleList
>
> AddModule mod_env.c
> AddModule mod_log_config.c
> AddModule mod_cgi.c
> AddModule mod_alias.c
> AddModule mod_access.c
> AddModule mod_so.c
>
> HostnameLookups off
>
> Port 8080
>
> ServerName localhost
>
> LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
> LogFormat "%h %l %u %t \"%r\" %>s %b" common
> LogFormat "%{Referer}i -> %U" referer
> LogFormat "%{User-agent}i" agent
>
> CustomLog /home/grant/apache/log/access_log combined
> ErrorLog /home/grant/apache/log/error_log
>
> Listen 127.0.0.1:8080
>
> <Directory />
> Options None
> AllowOverride None
> Order allow,deny
> Deny from all
> </Directory>
>
> DocumentRoot /home/grant/apache/htdocs
> ScriptAlias /cgi-bin/ /home/grant/apache/cgi-bin/
>
> <Directory "/home/grant/apache/htdocs">
> Order allow,deny
> Allow from all
> </Directory>
>
> <Directory "/home/grant/apache/cgi-bin">
> Options ExecCGI
> Order allow,deny
> Allow from all
> </Directory>
>
> Listen 127.0.0.1:8090
> <VirtualHost 127.0.0.1:8090>
> DocumentRoot /home/grant/apache/htdocs
> ErrorLog /home/grant/apache/log/vhost.error_log
> </VirtualHost>
>
> [grant@localhost apache]$ cat cgi-bin/speedy.cgi
> #!/usr/local/bin/speedy
>
> warn(localtime() . ": This should go to the error log");
> print STDERR localtime() . ": This also should go to the error log\n";
>
> print <<EOF
> Content-Type: text/plain
>
> Testing
>
> EOF
> [grant@localhost apache]$ cat log/vhost.error_log
> [Mon Nov 10 22:00:22 2003] [error] [client 127.0.0.1] File does not exist: /home/grant/apache/htdocs/1
> [Mon Nov 10 22:00:23 2003] [error] [client 127.0.0.1] File does not exist: /home/grant/apache/htdocs/2
> [Mon Nov 10 22:00:26 2003] [error] [client 127.0.0.1] File does not exist: /home/grant/apache/htdocs/3
> [Mon Nov 10 22:00:28 2003] [error] [client 127.0.0.1] File does not exist: /home/grant/apache/htdocs/4
> [Mon Nov 10 22:00:31 2003] [error] [client 127.0.0.1] File does not exist: /home/grant/apache/htdocs/5
> [Mon Nov 10 22:00:33 2003] [error] [client 127.0.0.1] File does not exist: /home/grant/apache/htdocs/6
> [Mon Nov 10 22:00:35 2003] [error] [client 127.0.0.1] File does not exist: /home/grant/apache/htdocs/7
> [Mon Nov 10 22:00:37 2003] [error] [client 127.0.0.1] File does not exist: /home/grant/apache/htdocs/8
> [Mon Nov 10 22:00:39 2003] [error] [client 127.0.0.1] File does not exist: /home/grant/apache/htdocs/9
> [Mon Nov 10 22:00:41 2003] [error] [client 127.0.0.1] File does not exist: /home/grant/apache/htdocs/10
> [grant@localhost apache]$ /usr/local/apache/sbin/httpd -f /home/grant/apache/conf/httpd.conf
> [grant@localhost apache]$ lynx --dump http://127.0.0.1:8090/cgi-bin/speedy.cgi
> Testing
>
>
> [grant@localhost apache]$ cat log/vhost.error_log
> Mon Nov 10 22:03:47 2003: This should go to the error log at /home/grant/apache/cgi-bin/speedy.cgi line 3.
> Mon Nov 10 22:03:47 2003: This also should go to the error log
> exist: /home/grant/apache/htdocs/2
> [Mon Nov 10 22:00:26 2003] [error] [client 127.0.0.1] File does not exist: /home/grant/apache/htdocs/3
> [Mon Nov 10 22:00:28 2003] [error] [client 127.0.0.1] File does not exist: /home/grant/apache/htdocs/4
> [Mon Nov 10 22:00:31 2003] [error] [client 127.0.0.1] File does not exist: /home/grant/apache/htdocs/5
> [Mon Nov 10 22:00:33 2003] [error] [client 127.0.0.1] File does not exist: /home/grant/apache/htdocs/6
> [Mon Nov 10 22:00:35 2003] [error] [client 127.0.0.1] File does not exist: /home/grant/apache/htdocs/7
> [Mon Nov 10 22:00:37 2003] [error] [client 127.0.0.1] File does not exist: /home/grant/apache/htdocs/8
> [Mon Nov 10 22:00:39 2003] [error] [client 127.0.0.1] File does not exist: /home/grant/apache/htdocs/9
> [Mon Nov 10 22:00:41 2003] [error] [client 127.0.0.1] File does not exist: /home/grant/apache/htdocs/10
> [grant@localhost apache]$
>
> --------------000606070009020103080100--
>
|