RE: stdout from scripts goes to apache logs

2024-05-13 Thread David Cook via modperl
I can't speak to your exact situation, but for what it's worth... In Plack environments, I use IPC::Open3. In mod_perl environments, I use Apache2::SubProcess. If you have a Apache2::RequestRec object, you can then do something like this: ($child_in, $child_out, $child_err) = $r->spawn_proc_pro

Re: stdout from scripts goes to apache logs

2024-05-13 Thread Steven Haigh via modperl
On 14/5/24 14:18, Ed Sabol wrote: On May 13, 2024, at 11:00 PM, Steven Haigh via modperl wrote: If I was to guess, it seems like an interaction with open3 and modperl. https://perldoc.perl.org/IPC::Open3 Yes, this is a known problem with IPC::Open3 that is commonly seen with mod_perl. It's

Re: stdout from scripts goes to apache logs

2024-05-13 Thread Ed Sabol
On May 13, 2024, at 11:00 PM, Steven Haigh via modperl wrote: > If I was to guess, it seems like an interaction with open3 and modperl. > > https://perldoc.perl.org/IPC::Open3 Yes, this is a known problem with IPC::Open3 that is commonly seen with mod_perl. It's been a Perl bug since 2009, and

Re: stdout from scripts goes to apache logs

2024-05-13 Thread Steven Haigh via modperl
The apache config for modperl is as follows: ## Load mod_perl LoadModule perl_module /usr/lib/apache2/modules/mod_perl.so PerlModule Apache2::Reload PerlInitHandler Apache2::Reload PerlOptions +Parent PerlSwitches -Mlib=/var/www/includes DirectoryIndex index.pl index.html #AddHa

Re: stdout from scripts goes to apache logs

2024-05-13 Thread Joseph He
Steven, how do you put your script under the mod-perl environment? What is your httpd.conf file? Thx. On Mon, May 13, 2024 at 10:00 PM Steven Haigh via modperl < modperl@perl.apache.org> wrote: > I wonder if perhaps I haven't been clear in the problem. > > In the provided code example: > m

Re: stdout from scripts goes to apache logs

2024-05-13 Thread Steven Haigh via modperl
I wonder if perhaps I haven't been clear in the problem. In the provided code example: my $cmd = "/bin/stdbuf"; my @args = qw@ -o1 -e1 /usr/bin/speedtest-cli@; print '';<-- appears in the HTML output. my $pid = open3(0, \*READER, 0, $cmd, @args); while ( my $output =

Re: stdout from scripts goes to apache logs

2024-05-13 Thread Joseph He
Steven, you need to use those mod-perl libraries to handle the web request and to generate the response. https://perl.apache.org/docs/2.0/user/intro/start_fast.html Scroll down to the bottom, you can see how to output the content. Cheers, Joseph On Mon, May 13, 2024 at 9:35 PM Steven Haigh via

Re: stdout from scripts goes to apache logs

2024-05-13 Thread Steven Haigh via modperl
That being said, is there a way to output to the web page in this scenario? On 14/5/24 12:15, Joseph He wrote: CGI script runs on its own process. mod-perl basically wraps CGI script into apache process, that is why its output is automatically going to Apache log. On Mon, May 13, 2024 at 1:53

Re: stdout from scripts goes to apache logs

2024-05-13 Thread Joseph He
CGI script runs on its own process. mod-perl basically wraps CGI script into apache process, that is why its output is automatically going to Apache log. On Mon, May 13, 2024 at 1:53 AM Steven Haigh via modperl < modperl@perl.apache.org> wrote: > Hi all, > > I'm playing around with mod_perl on ap

Re: Re: stdout from scripts goes to apache logs

2024-05-13 Thread Vincent Veyron
Hi Steven, I don't work with registry scripts, so can't help with that, but I thought I'd mention a change I noticed in the way Apache2 handles STDERR output : it stopped obeying the ErrorLog configuration directives that I use for the few web sites I maintain. It now sends error messages to th

unsubscribe

2024-05-13 Thread Will, John via modperl
unsubscribe [KBR] John Will KBR | HST Mission Information Systems Team (MIST) Goddard Space Flight Center, B3/S38H Office: 301.286.4527 | Mobile: 240.374.9647

Re: stdout from scripts goes to apache logs

2024-05-13 Thread Steven Haigh via modperl
Hi Ian, You're right - I did actually copy just one of the iterations I've tried of apache config. The parts of httpd.conf that I've added are: ## Load mod_perl LoadModule perl_module /usr/lib/apache2/modules/mod_perl.so PerlModule Apache2::Reload PerlInitHandler Apache2::Reload PerlOptions +

Re: stdout from scripts goes to apache logs

2024-05-13 Thread Ian B
Not an expert here, so someone I'm sure will correct me if wrong! Normally I'd expect an actual PerlHandler or similar included, eg PerlHandler ModPerl::Registry or PerlHandler SomeLib::SomePAckage type thing... (this would be as well as the Set/AddHandler line) Kind regards, On Mon, May 13,