On Sun, Dec 08, 2002 at 11:45:22PM -0600, Dan Nelson wrote:
>In the last episode (Dec 08), [EMAIL PROTECTED] said:
>> Hi all
>>
>> How can i make a tail -f <file> and show the results in a web page with
>> out having to reload the page every N seconds
>>
>> i am using PHP in a script like:
>>
>> <?php
>> $error_log = '/var/log/apache/log';
>> passthru ("tail -f $error_log");
>> ?>
>
>The following 3-line CGI works fine:
>
>#! /bin/sh
>printf "Content-type: text/plain\r\n\r\n"
>tail -f /var/log/messages
>
Unfortunatly if you try that your webserver will quickly fail because
the connection never closes. If your customers can create cgi scripts
they can bring down your server too.
How fast depends on httpd.conf MaxSpareServers, and how quickly you hit
reload.
// George
--
GEORGE GEORGALIS, System Admin/Architect cell: 347-451-8229
Security Services, Web, Mail, mailto:[EMAIL PROTECTED]
Multimedia, DB, DNS and Metrics. http://www.galis.org/george
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message