Re: Best practices for returning 404/file-not-found pages inside and outside of mod_perl

2008-04-15 Thread Perrin Harkins
On Tue, Apr 15, 2008 at 3:19 PM, Mark Stosberg <[EMAIL PROTECTED]> wrote: > It seems that using CGI, it is too late return a true 404 once the script > is processing the request. I thought mod_cgi would handle this, actually. It parses your header output. Apache::Registry has trouble emulating

Re: modperl and syslog, strange behavior

2008-04-15 Thread Perrin Harkins
On Tue, Apr 15, 2008 at 5:03 PM, John Gateley <[EMAIL PROTECTED]> wrote: > if($UseLog) { > Sys::Syslog::setlogsock('unix'); > openlog("$WebScriptName", 'pid', 'daemon'); > syslog('info', "$WebScriptName starting"); > } > ... > syslog('info', "Message"); # Actually buried in a subroutine >

Re: Accessing CSS,JS and other files

2008-04-15 Thread Michael Peters
Dileep Eduri wrote: > When I searched thru' forums, came to know abt the section, which I > can use. But still after studying the documentation, I could not write a > proper section. You don't need to use a section. > PerlModule ModPerl::Registry > >SetHandler perl-script >PerlHandle

Re: reinitializing Perl's notion of $$ in mod_perl

2008-04-15 Thread Mark Blackman
On 15 Apr 2008, at 13:51, Mark Blackman wrote: While I did find Torsten Förtsch's very useful Perl::AfterFork module, surely the mod_perl code must be doing something like this itself, no? I'd be grateful to understand mod_perl's response to Perl's pid caching is, given that forking *will* h

modperl and syslog, strange behavior

2008-04-15 Thread John Gateley
Hi Y'all, I'm new to mod_perl, please forgive me if this is already well known info. I have several different web scripts like: if($UseLog) { Sys::Syslog::setlogsock('unix'); openlog("$WebScriptName", 'pid', 'daemon'); syslog('info', "$WebScriptName starting"); } ... syslog('info', "Messag

Re: reinitializing Perl's notion of $$ in mod_perl

2008-04-15 Thread Mark Blackman
On 15 Apr 2008, at 17:27, Torsten Foertsch wrote: On Tue 15 Apr 2008, Mark Blackman wrote: int main(int argc, char *argv){ fork(); printf("my pid is %d\n",getpid()); } Please use the fork-syscall here not the C function. Right, the C library will almost certainly use the fork() call h

Re: Best practices for returning 404/file-not-found pages inside and outside of mod_perl

2008-04-15 Thread David Nicol
On Tue, Apr 15, 2008 at 2:19 PM, Mark Stosberg <[EMAIL PROTECTED]> wrote: > > return a true 404 Since MP already replaces the C function, it shouldn't be too tricky to abstract 404 and other error codes with by letting exit take arguments -- then you could do what you want with C< 404)>> for ins

Re: reinitializing Perl's notion of $$ in mod_perl

2008-04-15 Thread David Nicol
On Tue, Apr 15, 2008 at 8:28 AM, Mark Blackman <[EMAIL PROTECTED]> wrote: > modperl_perl_init_ids() which itself eventually does a > > sv_setiv(GvSV(gv_fetchpv("$", TRUE, SVt_PV)), ids->pid); > > where ids->pid should contain the result of a recent getpid. > > *However* I note that in the main

Best practices for returning 404/file-not-found pages inside and outside of mod_perl

2008-04-15 Thread Mark Stosberg
It seems that using CGI, it is too late return a true 404 once the script is processing the request. It's possible to still send output that returns "page not found" text, but the HTTP status code will be 200. More recently, I learned that with mod_perl, I learned that I can get the system to

Accessing CSS,JS and other files

2008-04-15 Thread Dileep Eduri
Hi everyone... I tried searching the forums, but got few clues..yet I don't have my doubts clarified. Hence posting. I am running Apache/2.2.6 (Unix) with mod_perl/2.0.3 Perl/v5.8.8 Recently I have started developing pages using mod_perl and when I tried to link the CSS file or Javascript file,

Re: reinitializing Perl's notion of $$ in mod_perl

2008-04-15 Thread Mark Blackman
On 15 Apr 2008, at 17:27, Torsten Foertsch wrote: On Tue 15 Apr 2008, Mark Blackman wrote: int main(int argc, char *argv){ fork(); printf("my pid is %d\n",getpid()); } Please use the fork-syscall here not the C function. i'm trying to test the C-library behaviour though? in my case,

Re: reinitializing Perl's notion of $$ in mod_perl

2008-04-15 Thread Torsten Foertsch
On Tue 15 Apr 2008, Mark Blackman wrote: > int main(int argc, char *argv){ >    fork(); >   printf("my pid is %d\n",getpid()); > } Please use the fork-syscall here not the C function. Torsten -- Need professional mod_perl support? Just ask me: [EMAIL PROTECTED]

Re: reinitializing Perl's notion of $$ in mod_perl

2008-04-15 Thread Perrin Harkins
On Tue, Apr 15, 2008 at 11:00 AM, Torsten Foertsch <[EMAIL PROTECTED]> wrote: > There was/is a problem in mp1 that it did/does not reinitialize $$ and > getppid(). Under what circumstances? I use $$ all the time and have never seen any sort of caching behavior from it. I use Linux. - Perrin

Re: reinitializing Perl's notion of $$ in mod_perl

2008-04-15 Thread Mark Blackman
On 15 Apr 2008, at 16:24, Mark Blackman wrote: On 15 Apr 2008, at 16:00, Torsten Foertsch wrote: On Tue 15 Apr 2008, Mark Blackman wrote: While I did find Torsten Förtsch's very useful Perl::AfterFork module, surely the mod_perl code must be doing something like this itself, no? I'd be grate

Re: reinitializing Perl's notion of $$ in mod_perl

2008-04-15 Thread Mark Blackman
On 15 Apr 2008, at 16:00, Torsten Foertsch wrote: On Tue 15 Apr 2008, Mark Blackman wrote: While I did find Torsten Förtsch's very useful Perl::AfterFork module, surely the mod_perl code must be doing something like this itself, no? I'd be grateful to understand mod_perl's response to Perl's p

Re: reinitializing Perl's notion of $$ in mod_perl

2008-04-15 Thread Torsten Foertsch
On Tue 15 Apr 2008, Mark Blackman wrote: > While I did find Torsten Förtsch's very useful Perl::AfterFork   > module, surely the > mod_perl code must be doing something like this itself, no? > > I'd be grateful to understand mod_perl's response to Perl's > pid caching is, given that forking *will*

Re: reinitializing Perl's notion of $$ in mod_perl

2008-04-15 Thread Mark Blackman
On 15 Apr 2008, at 14:15, Perrin Harkins wrote: On Tue, Apr 15, 2008 at 9:05 AM, Mark Blackman <[EMAIL PROTECTED]> wrote: My assumption is that perl caches the PID on startup and only reinitializes on perl fork(), thus in the embedded case a fork() outside the perl API doesn't reinitialize

Re: reinitializing Perl's notion of $$ in mod_perl

2008-04-15 Thread Perrin Harkins
On Tue, Apr 15, 2008 at 9:05 AM, Mark Blackman <[EMAIL PROTECTED]> wrote: > My assumption is that perl caches the PID on startup and > only reinitializes on perl fork(), thus in the embedded case > a fork() outside the perl API doesn't reinitialize $$ at least > for some cases. It must be a m

Re: reinitializing Perl's notion of $$ in mod_perl

2008-04-15 Thread Mark Blackman
On 15 Apr 2008, at 13:59, Perrin Harkins wrote: On Tue, Apr 15, 2008 at 8:51 AM, Mark Blackman <[EMAIL PROTECTED]> wrote: While I did find Torsten Förtsch's very useful Perl::AfterFork module, surely the mod_perl code must be doing something like this itself, no? I've been using fork, mod

Re: reinitializing Perl's notion of $$ in mod_perl

2008-04-15 Thread Perrin Harkins
On Tue, Apr 15, 2008 at 8:51 AM, Mark Blackman <[EMAIL PROTECTED]> wrote: > While I did find Torsten Förtsch's very useful Perl::AfterFork module, > surely the > mod_perl code must be doing something like this itself, no? I've been using fork, mod_perl, and $$ for years without a single problem.

reinitializing Perl's notion of $$ in mod_perl

2008-04-15 Thread Mark Blackman
While I did find Torsten Förtsch's very useful Perl::AfterFork module, surely the mod_perl code must be doing something like this itself, no? I'd be grateful to understand mod_perl's response to Perl's pid caching is, given that forking *will* happen in the mod_perl environment. - Mark

Re: [RELEASE CANDIDATE] mod_perl-2.0.4 RC1

2008-04-15 Thread Geoffrey Young
Philippe M. Chiasson wrote: The mod_perl 2.0.4 release candidate 1 "Works with Perl 5.10" is ready. It can be downloaded here: http://www.apache.org/~gozer/mp2/mod_perl-2.0.4-rc1.tar.gz tests fine on my system. +1 --Geoff