Re: possible issue in mod_perl 2.0.4 with respect to STDERR

2009-11-12 Thread Torsten Foertsch
On Thu 12 Nov 2009, Shibi NS wrote: > Configuration error log is in my applications httpd config file is > > > ErrorLog = "'| rotatelogs \log\error_log 1M "' > > But if print something on STDERR from mod_perl program , Say debug > print (print STDERR "DEBUG ";) this is going to \log\error_log > ins

Re: Storing config values in-memory between sessions

2009-10-29 Thread Torsten Foertsch
On Thu 29 Oct 2009, Mahesh Khambadkone wrote: > As it seldom changes, we dont want to use a database for these > 'config values', yet need a way to retain in memory and dirty its' > value from time to time. Have a look at MMapDB which I have just uploaded to CPAN. I wrote this module some time ag

Re: Server hangs after 502 request

2009-10-26 Thread Torsten Foertsch
On Sat 24 Oct 2009, Rolf Schaufelberger wrote: > Starting some weeks ago the server sometimes hangs with an out of   > memory problem. Assuming you are running on linux the following sysctls may help to find the culprit. vm.overcommit_memory=2 vm.overcommit_ratio=90 By default (overcommit_memor

Re: Custom INC per-directory

2009-10-21 Thread Torsten Foertsch
On Wed 21 Oct 2009, Alan Young wrote: > http://perl.apache.org/docs/2.0/user/config/config.html#C_Parent_ Unfortunately the Parent option works only in vhosts. But I believe it could be hacked to work also for directory containers. Of course PerlPostReadRequest, PerlTranslation and PerlMapToStor

Re: Configuring virtual hosts on the fly

2009-10-12 Thread Torsten Foertsch
On Sun 11 Oct 2009, André Warnier wrote: > > I see some hooks in PerlTransHandler and PerlMapToStorageHandler > > that seem like they can almost do what I want, but I don't see how > > to set other virtual host parameters, like ServerAdmin > > http://perl.apache.org/docs/2.0/api/Apache2/ServerRec.h

Re: is it possible get the deflate information in reuest object

2009-10-12 Thread Torsten Foertsch
On Mon 12 Oct 2009, Shibi NS wrote: > LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%) > "%{User-agent}i"' deflate > CustomLog /var/log/httpd/deflate_log deflate > > Can I get the Input/Output and Ratio information in Apache2 Request > object or PerlLogHandler ? in a PerlLogHandler you sho

Re: Threading inside a handler script

2009-10-03 Thread Torsten Foertsch
On Sat 03 Oct 2009, Elizabeth Mattijsen wrote: > > I believe what you're doing should work, but I don't use threads > > for anything.  I'd probably fork and put the results in a database > > table or file. > > If you like the threads API, you might want to take a look at the   > "forks" module on C

Re: user undef

2009-09-30 Thread Torsten Foertsch
On Wed 30 Sep 2009, Bernhard Janetzki wrote: > Hello together, > i'm trying basic authentication via > > ## apache2 config: > > SetHandler perl-script > PerlAuthenHandler DataExchange::AuthHandler > #PerlResponseHandler ModPerl::Registry >

Re: huge httpd processes

2009-09-29 Thread Torsten Foertsch
On Tue 29 Sep 2009, Clinton Gormley wrote: > > I'm wondering if anyone can advise me on how I could go about > > trying to understand where this 90 Mbs is comming from? Some of it > > must be the mod_perl and apache binaries - but how much should they > > be, and apart from the 6mb in shared memory

Re: ModPerl::Registry and Error Documents

2009-09-29 Thread Torsten Foertsch
On Tue 29 Sep 2009, Andreas Mock wrote: > after searching for a while without finding an answer to my question > I hope you can help me, > > We're using mod_perl with ModPerl::Registry to have only a thin > layer between apache and our perl scripts. So far so good. > Now we want to produce error do

Re: Updating cookies in header during request processing

2009-09-18 Thread Torsten Foertsch
On Fri 18 Sep 2009, Igor Chudov wrote: > But how can I change the cookie AFTER I called $cgi->start_html? As long as there is nothing sent out on the wire you can add headers. When the response header is gone you can't. start_html() only generates a string as far as know. So it depends upon whe

Re: Ways to scale a mod_perl site

2009-09-17 Thread Torsten Foertsch
On Wed 16 Sep 2009, Igor Chudov wrote: > >> I have very little static content. Even images are generated. My > >> site generates images of math formulae such as (x-1)/(x+1) on the > >> fly., > > > > I can understand generating them on the fly for flexibility > > reasons, but I'd cache them, and ser

Re: Why people not using mod_perl

2009-09-17 Thread Torsten Foertsch
On Thu 17 Sep 2009, Kiran Kumar wrote: > There is also Padre (http://padre.perlide.org/) , You can write > plugins and customize to your needs, there are already lots of > plugins available >  http://search.cpan.org/search?query=padre%3A%3Aplugin&mode=all I have seen padre first time at the this y

Re: ModPerl::Registry and custom error documents

2009-09-17 Thread Torsten Foertsch
On Thu 17 Sep 2009, Andreas Mock wrote: > How can we dynamically create own error documents without using > the lower level mod_perl/apache api? Is there a simple way? > How can we achieve that? A very simple registry script: #!/usr/bin/perl use strict; my $r=shift; $r->status($r->args); exit;

Re: changing apache process name?

2009-09-02 Thread Torsten Foertsch
On Tue 01 Sep 2009, Sebastiaan Hoogeveen wrote: > Not sure if this would fix your problem, but you can just set $0 from >   within the mod_perl module to whatever you'd like to show up in the > process list, just as with a regular perl script. It probably depends > on the OS you're running whether

Re: changing apache process name?

2009-09-01 Thread Torsten Foertsch
On Tue 01 Sep 2009, mcvella wrote: > I am wondering if anyone knows if there is a way to configure what it > shown as the running apache process name.  I am not sure if this is > technically a mod_perl question.  The problem is that the process > name is partially truncated, so we are unable to det

Re: mod_perl2 interactive startup

2009-08-26 Thread Torsten Foertsch
On Tue 25 Aug 2009, ama...@solutionsforprogress.com wrote: > Unfortunately using restart_count does not address my issue. > > In the http.conf I have the following: > ... > PerlConfigRequire   conf/startup.pl > ... > > My test startup.pl has this: > >      our $INPUT; >      print STDERR "Input:";

Re: getting $r and env to reflect external ports

2009-08-15 Thread Torsten Foertsch
On Sat 15 Aug 2009, Jonathan Swartz wrote: > We've got a bunch of legacy code that uses $ENV{SCRIPT_URI},   > $ENV{SERVER_PORT}, $r->server->port and the like to generate external >   redirects. > > This has worked fine til now, but now we are moving to a system where >   our external port != our i

Re: disable input and output filters for subfolders

2009-08-01 Thread Torsten Foertsch
On Sat 01 Aug 2009, Mike Barborak wrote: > Invalid per-directory PerlOption: InputFilter > > so it seems that while PerlOption is allowed at the directory level, > the InputFilter and OutputFilter options are not. (i actually > couldn't find a relevant section in the docs about that so i am > unsur

Re: disable input and output filters for subfolders

2009-07-30 Thread Torsten Foertsch
On Thu 30 Jul 2009, Torsten Foertsch wrote: Sorry, I hit return while one of my left hand fingers rested on the CTRL key and the MUA interpreted this as "send mail now". So, here comes the rest of what I wanted to say. > On Wed 29 Jul 2009, Mike Barborak wrote: > > is th

Re: disable input and output filters for subfolders

2009-07-30 Thread Torsten Foertsch
On Wed 29 Jul 2009, Mike Barborak wrote: > i have filters working correctly for a directory on my website. there > is a subdirectory that i would like to not be passed through the > filters. can i do this through the apache conf file or do i need to > code this into my filters? > > here is my apach

Re: rewriterule, location, and perlhandler

2009-07-22 Thread Torsten Foertsch
On Wed 22 Jul 2009, Adam Prime wrote: > Eric Lease Morgan wrote: > > On Jul 22, 2009, at 12:05 AM, Adam Prime wrote: > > > > By first changing my Location directive to the following: > > > > > >SetHandler perl-script > >PerlHandler Apache2::Alex::SemanticWeb > > > > > > And then changin

Re: Linux::Smaps on RHEL

2009-07-22 Thread Torsten Foertsch
On Wed 22 Jul 2009, Jonathan Swartz wrote: > I'm running into the problem using Linux::Smaps on RHEL with an > Apache   server on port 80. Namely, that the httpd child doesn't have > permissions to look at the smaps file. > >       Linux::Smaps: Cannot open /proc/20074/smaps: Permission denied >  

Re: trying to add header field using PerlInputFilterHandler to proxy packets

2009-06-30 Thread Torsten Foertsch
On Tue 30 Jun 2009, Brandon Allgood wrote: > PerlInputFilterHandler company::AddHeader >   > and I wrote the following example handler >   > package company::AddHeader; >   > use strict; > use warnings; >   > use Apache2::Filter (); > use Apache2::RequestRec (); > use APR::Table (); >   > use Apach

Re: svn commit: r773881 - in /httpd/httpd/branches/2.2.x: CHANGES STATUS include/http_core.h modules/filters/mod_include.c server/config.c server/core.c

2009-05-22 Thread Torsten Foertsch
On Fri 22 May 2009, Jeff Trawick wrote: > Hmmm, after trying to use what seems like a cool feature, I find that > mod_perl was never taught to use the Apache 2's mod_include plug-in > interface. AFAIK, that is provided by Geoff's CPAN module Apache::IncludeHook or so. Torsten -- Need professio

Re: executing PerlHandler after default_handler?

2009-05-12 Thread Torsten Foertsch
On Wed 13 May 2009, William T wrote: > What I want to do is issue a redirect if the file that was requested > is not on disk, and I don't want the extra stat due to an NFS mount. How about ErrorDocument 404 /modperl/handler/uri? http://httpd.apache.org/docs/2.2/mod/core.html#errordocument Torste

Re: Pass variable

2009-05-05 Thread Torsten Foertsch
On Tue 05 May 2009, Idel Fuschini wrote: > how can I read this variable from php and jsp application ? subprocess_env manipulates environment variables. So, if your application can read them it fetches them from that place. > I did in perl code: > > $r->subprocess_env("XXX" => $value); > > In cg

Re: Pass variable

2009-05-05 Thread Torsten Foertsch
On Tue 05 May 2009, Idel Fuschini wrote: > I am the owner of  "Apache Mobile Filter" project ( > https://sourceforge.net/projects/mobilefilter/). > After my filter detect the UserAgent of a device I want to pass the > capability to other applications (cgi, php or tomcat with mod_jk) in > the same w

Re: Undefined subroutine error

2009-04-15 Thread Torsten Foertsch
On Wed 15 Apr 2009, Roberto C. Sánchez wrote: > > Would it be possible to post your module? Perhaps you forgot > > the "package" declaration? > > --8<-->8-- > > package Example::Image; Ok, then how about checking if your module is really loaded. Apache2::Status provides th

Re: Undefined subroutine error

2009-04-14 Thread Torsten Foertsch
On Tue 14 Apr 2009, Roberto C. Sánchez wrote: > I am currently using the latter call everywhere and it is still > generating the "Undefined subroutine" error. Would it be possible to post your module? Perhaps you forgot the "package" declaration? Torsten -- Need professional mod_perl support?

Re: generic question on input filters

2009-04-09 Thread Torsten Foertsch
On Thu 09 Apr 2009, André Warnier wrote: > I have the impression that I am getting this Apache error : > > [Wed Apr 08 22:46:22 2009] [crit] [Wed Apr 08 22:46:22 2009] file > http_filters.c, line 1324, assertion "!(((&(bb)->list))->next == > (struct apr_bucket *)((char *)((&(bb)->list)) - ((long) (

Re: generic question on input filters

2009-04-09 Thread Torsten Foertsch
On Thu 09 Apr 2009, André Warnier wrote: > Suspicion : I cannot read the content, and print nothing when I am > called.  Instead of accumulating the content and process it all at > once at the end, should I process it chunk by chunk ? yes, as I said in my previous mail, do it chunkwise. > Is it O

Re: generic question on input filters

2009-04-08 Thread Torsten Foertsch
On Wed 08 Apr 2009, André Warnier wrote: > I want to write a mod_perl input filter, which essentially would > replace some characters from form-posted input on the fly, before > letting the request go to the real application. > The requests are POST, with content encoded in one long string, > URL-e

Re: sending all of stderr to a process

2009-04-06 Thread Torsten Foertsch
On Mon 06 Apr 2009, André Warnier wrote: > How does it work with Apache children/threads that may be acting as a > VirtualHost's having their own ErrorLog ? > My experience is that anything logged by mod_perl modules running > "in" a VirtualHost using explicit warn() or $r->log_error() or > $r->log

Re: sending all of stderr to a process

2009-04-06 Thread Torsten Foertsch
On Sun 05 Apr 2009, E R wrote: > My concern is about what happens in this scenario: > > 1. Set everything up (named pipe, logger process, etc.) > 2. Now suppose the logger process dies (it crashes or I need to > restart it) 3. Any writes through existing connections to the named > pipe will just fa

Re: sending all of stderr to a process

2009-04-05 Thread Torsten Foertsch
On Sat 04 Apr 2009, E R wrote: > One operational issue with this is that if the logger process dies, > existing httpd processes will get a SIGPIPE signal on subsequent > writes. Restarting the logger process does not restore the lost > connections. > > > On Fri, Apr 3, 2009

Re: sending all of stderr to a process

2009-04-03 Thread Torsten Foertsch
On Fri 03 Apr 2009, E R wrote: > I want to send all error output to a process for specialized logging. > I know that you can use CustomLog with a pipe. However, will that > capture output from things like 'print STDERR ...' or if an XS module > directly writes to stderr? I need that output to also

Re: Help needed for mod_perl 1.31-rc6 and Apache::Bootstrap

2009-03-30 Thread Torsten Foertsch
On Sun 29 Mar 2009, Fred Moyer wrote: > Need one more for a release $ make test cp lib/Apache/Bootstrap.pm blib/lib/Apache/Bootstrap.pm PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/00-load.t ... 1/11 # Testing Apache::Boots

Re: who's putting that tag in the output...?

2009-03-23 Thread Torsten Foertsch
On Mon 23 Mar 2009, Iosif Fettich wrote: > Using the (obvious...!) REDIRECT_URL as you suggested works! :) An ErrorDocument is an internal redirect. These REDIRECT_... environment variables are copied from the previous ($r->prev) request's $r->subprocess_env just by copying everything and prepen

to the mailing list admin

2009-03-23 Thread Torsten Foertsch
Hi, each of my last mailings to the list was answered by the following failure notice: - The following message to was undeliverable. The reason for the problem: 5.1.0 - Unknown address error 550-'5.7.1 ... Access denied' --

Re: who's putting that tag in the output...?

2009-03-23 Thread Torsten Foertsch
On Mon 23 Mar 2009, Iosif Fettich wrote: > Or is the [P]roxy flag not working as it should or as I expect it to > ? It seems to work fine for the subrequest (status=200) ...? This is exactly the problem. The 404 is normally generated in the response phase from the default response handler. The su

Re: who's putting that tag in the output...?

2009-03-23 Thread Torsten Foertsch
On Mon 23 Mar 2009, Iosif Fettich wrote: > So it seems to be very, very easy. Still, when using the above > receipt like >      RewriteEngine on >      RewriteCond   %{REQUEST_URI}   !-U >      RewriteRule   ^\/(.+)          http://OLDDOMAIN.COM/$1 [QSA,P] The engine tries to resolve the request u

Re: generated report (was Re: mp2 hangs when running make test)

2009-03-21 Thread Torsten Foertsch
On Sat 21 Mar 2009, Oliver Block wrote: > *** mod_perl version 2.04 And how about the current development version? I use a self compiled apache 2.2.11 plus http://svn.apache.org/repos/asf/perl/modperl/branches/threading/ with Suse 11.1. I think you are at 11.0? If you like I can send you t

Re: mp2 hangs when running make test

2009-03-20 Thread Torsten Foertsch
On Fri 20 Mar 2009, Oliver Block wrote: > [warning] the client side drops 'root' permissions and becomes > 'nobody' not sure, but I'd retry the complete build/test (beginning from extracting the TAR) without superuser privileges. Torsten -- Need professional mod_perl support? Just hire me: tor

Re: Capturing STDERR for use in log handler

2009-03-18 Thread Torsten Foertsch
On Tue 17 Mar 2009, Tom Spencer wrote: > So far so good, it adds the information I've got to the database > quite nicely.  But the one more thing I really need is all the STDERR > that was generated while processing the request.  Recipe 6.10 > provides a method for outputting STDERR to a different

BerkeleyDB solution

2009-03-10 Thread Torsten Foertsch
Hi, this is not a problem but a solution. I know some of you use the BerkeleyDB module to store data. Recently I have tried to use UTF8 keys and failed. When reading back keys I sometimes got character strings sometimes octet strings. I had used the following 2 filters to ensure the data in th

Re: PerlConfigRequire and die

2009-02-28 Thread Torsten Foertsch
On Thu 26 Feb 2009, Clinton Gormley wrote: > > Why don't you do that in a block? > > How is this different from doing it in the startup.pl file?   Yes, I see, the 2nd run of the code doesn't have STDERR either. So, you can open a startup logfile in perl and override CORE::GLOBAL::warn/die or i

Re: PerlConfigRequire and die

2009-02-26 Thread Torsten Foertsch
On Thu 26 Feb 2009, Clinton Gormley wrote: > > > Is there any way I can: > > >  - cause the error to be reported properly > > >  - force apache not to start > > > >  eval {load_application(); 1} || do { warn $@; die }; > > Unfortunately, no.  That still just dies with the obscure error > message. I

Re: What can a child_init do?

2009-02-19 Thread Torsten Foertsch
On Thu 19 Feb 2009, cr...@animalhead.com wrote: > Is there anything a mod_perl2 child_init phase can do to call > attention to a problem? > > I moved a block of code from a post_config handler to a new > child_init handler, without thinking much about the niceties of the > move.  The code contained

Re: Alias and PerlOutputFilterHandler in virtual host configuration

2009-02-15 Thread Torsten Foertsch
On Sun 15 Feb 2009, Roger Munk wrote: > On Sun, Feb 15, 2009 at 5:12 PM, André Warnier wrote: > > see http://perl.apache.org/docs/2.0/api/APR/Table.html#C_get_ > > (you only get the first one this way) > > my @cookies = $f->r->headers_out->get("Set-Cookie"); > > would get you an array with both. >

Re: Alias and PerlOutputFilterHandler in virtual host configuration

2009-02-15 Thread Torsten Foertsch
On Sun 15 Feb 2009, Roger Munk wrote: > I have the following directives in my sites-available/default > configuration: > >        DocumentRoot /var/www/ >        Alias /portal/ /var/www/drupal6/ >        PerlRequire "/etc/apache2/ModPerl/TE/ST.pm" >         >             SetHandler modperl >      

Re: Checking a webserver

2009-01-28 Thread Torsten Foertsch
On Wed 28 Jan 2009, André Warnier wrote: > I am looking for a debugging tool that would be able to repeatedly > issue HTTP requests to one or more URLs, and log any errors. >  Preferably in Perl, and it must run on a Windows workstation. Don't know about windows and its not perl but I use ab (come

Re: PerlSetVar behaviour within directive

2009-01-23 Thread Torsten Foertsch
On Fri 23 Jan 2009, Pat Downey wrote: >   >     PerlSetVar CrowdAllowedGroups reader,writer >     Require valid-user >   >   >     PerlSetVar CrowdAllowedGroups writer >     Require valid-user >   > > > What I'd like is for members of the reader or writer groups to have > GET access and only m

Re: Multiple mod_perl 2.0 installations on one Linux machine

2009-01-19 Thread Torsten Foertsch
On Mon 19 Jan 2009, Adam Prime wrote: > > I thought you could build more than one and load the one you want > > at runtime.  Isn't that what Red Hat does? > > If redhat's shipping more than one mpm, they've patched httpd. Probably not httpd. At least Suse has not. Instead they configure and build

Re: Initializing Sleepycat::DbXml (Berkeley, Oracle) objects in startup.pl

2009-01-19 Thread Torsten Foertsch
On Mon 19 Jan 2009, Michael Ludwig wrote: > > In fact, it is worse than fork()ing off unix processes because the > > interpreter data is completely copied while a new interpreter is > > created. On the other hand a forked process copies only those pages > > that are written to. > > Thanks. If I'm u

Re: Initializing Sleepycat::DbXml (Berkeley, Oracle) objects in startup.pl

2009-01-19 Thread Torsten Foertsch
On Sun 18 Jan 2009, Michael Ludwig wrote: >  From perldoc perlthrtut: "In this model each thread runs in its own > Perl interpreter, and any data sharing between threads must be > explicit." This does not sound to me as if there is a significant > advantage over spawning child processes, at least n

Re: generic enquiry about rendering zipped content

2009-01-16 Thread Torsten Foertsch
On Fri 16 Jan 2009, André Warnier wrote: > What exact form would a HTTP response need to have, for the browser > to correctly interpret that the response it is getting is a document > (for example an OpenOffice document or an email in eml format), but > which has been zipped for transmission ? > >

Re: Separate Error log for each virtual host

2009-01-16 Thread Torsten Foertsch
On Fri 16 Jan 2009, fREW Schmidt wrote: > I would like to configure apache such that the errors for a specific > virtual host get logged in their own file.  I tried something like > this: > > >    ErrorLog "C:/location/of/acd/logs/error.log" >     >       use lib 'C:/location/of/acd'; >       $ENV

Re: [mp2] a way to map a uri to a physical path

2009-01-14 Thread Torsten Foertsch
On Thu 15 Jan 2009, Foo JH wrote: > Is there a generic method so that given any uri as a parameter, the > library can do the math and return the physical path? If you look for the filename for $r->uri, that means the uri of the current request then $r->filename holds that after the map-to-storage

Re: Setting LD_LIBRARY_PATH for a forked process

2009-01-09 Thread Torsten Foertsch
On Fri 09 Jan 2009, Raymond Wan wrote: > It is possible I'm doing something wrong, but so far, this isn't > working.  And if I replace the $cmd with a Perl script and try to > print out $ENV{LD_LIBRARY_PATH}, there is nothing.   I think you need this one: http://search.cpan.org/~stas/Env-C-0.08/C.

Re: Flushing output and preserving headers

2009-01-03 Thread Torsten Foertsch
On Sat 03 Jan 2009, Kate Yoak wrote: > $r->headers_out->set('Content-Type' => "image/gif"); use $r->content_type(...) Torsten -- Need professional mod_perl support? Just hire me: torsten.foert...@gmx.net

Re: HTTP Response Headers fixup

2009-01-02 Thread Torsten Foertsch
On Thu 01 Jan 2009, André Warnier wrote: > It works perfectly, even without having the filter remove itself > (which I did not know how to do). http://perl.apache.org/docs/2.0/api/Apache2/Filter.html#C_remove_ Torsten -- Need professional mod_perl support? Just hire me: torsten.foert...@gmx.net

Re: HTTP Response Headers fixup

2009-01-01 Thread Torsten Foertsch
On Thu 01 Jan 2009, André Warnier wrote: > Unfortunately the Content-Type header is a different beast. Inside > Apache it is not only a response header, but a more complex data > type. You can set a different Content-Type header with mod_headers, > but since the internal structure remains unchanged

Re: sub-requests, lookup_uri and that kind of stuff

2008-12-21 Thread Torsten Foertsch
On Mon 22 Dec 2008, André Warnier wrote: > I could do this the hard way by using LWP to just issue a new HTTP > request to localhost and get the content, before I go on with my > current request. > > But I figure there must be an easier and more efficient way, no ? > > Looking at the explanations f

Re: Keep-Alive, Apache processes and $r->connection

2008-12-21 Thread Torsten Foertsch
On Sun 21 Dec 2008, André Warnier wrote: > Am I right, or horribly wrong, to assume that in case of a > "keep-alive" client connection, the multiple requests sent over that > connection will be processed by the same Apache "process" (child or > thread) ? > > I am assuming the above, from the fact t

Re: Problem - Missing input data

2008-12-17 Thread Torsten Foertsch
On Wed 17 Dec 2008, mod_perl User wrote: > I am facing problem in mod_perl2.0 while opening an handler > Code as follows,         my $r = Apache2::Request->new(shift, > POST_MAX => 10 * 1024 * 1024);        my $status = $r->parse(); > Getting $status as 'Missing Input Data' I am not an expert in

Re: content_type in SSI- or directly-called mp2 scripts

2008-12-17 Thread Torsten Foertsch
On Wed 17 Dec 2008, cr...@animalhead.com wrote: > My mod_perl2 scripts mostly fall into 2 categories: > > 1) scripts that are called by URL location, and generate complete   > content-pages > 2) scripts that are called by SSI "include virtual" sequences   > in .html files, and generate part of a pa

Re: Question about Apache2::ServerUtil and PerlCleanupHandler

2008-12-05 Thread Torsten Foertsch
branch* I found the following message > >   Now correctly invokes PerlCleanupHandlers, even if they are the > only handler type configured for that request [Torsten Foertsch] > > this comes from r594609 but it was not merged for 2.0.4. This maybe > happens also for $r handlers,

Re: mod_perl survey results

2008-11-10 Thread Torsten Foertsch
On Mon 10 Nov 2008, Steven Siebert wrote: > More memory but potentially faster, correct?  Since we don't have to > spawn as many processes to accommodate a load? Perl is a real memory hog. Byte-compiled code can become quite big. Multiply that with the number of perl interpreters running and you'

Re: mod_perl survey results

2008-11-10 Thread Torsten Foertsch
On Mon 10 Nov 2008, André Warnier wrote: > Ok guys, I'm nowhere as good a programmer as many people on this > list, but a) I do have patience with beginners, b) I'm convinced and > c) maybe I can do something in terms of documentation, if only to fix > missing links. And d) I'd love to see my name

Re: mod_perl survey results

2008-11-10 Thread Torsten Foertsch
On Mon 10 Nov 2008, Steven Siebert wrote: > Let me know how to get involved How well is your C? There is a segfault waiting to be hunted down. It's one of the nicer. It happens each time the test suite runs with worker MPM. If interested I can give you further information. The threading branch

Re: Substituting URLs in PerlOutputFilterHandler

2008-11-10 Thread Torsten Foertsch
On Mon 10 Nov 2008, Puneet Lakhina wrote: > essentially im trying to modify > tags in the outgoing HTML pages. > Now I am trying to do this using PerlOutputFilterHandler. I have the > following questions: > a) Is this the right filter to use for an application like this? yes > b) As per my under

Re: Fwd: MPM-safe mp2 Singleton Pattern?

2008-11-07 Thread Torsten Foertsch
On Fri 07 Nov 2008, Steven Siebert wrote: > Is there any way to have a MPM-safe (specifically thread-safe) > singleton pattern? Modperl manages an interpreter pool if it runs under a threaded MPM. That means the first modperl-related action in the request cycle pulls an interpreter from the pool

Re: Mod Perl 2.0 HTTP Handlers

2008-11-02 Thread Torsten Foertsch
On Sun 02 Nov 2008, Puneet Lakhina wrote: > One more question, is it possible for me to ensure that my module/or > essenially mod_perl's processing of the URI translation happens > before mod_rewrite or any other similar modules, and essentially > mod_rewrite's rules work on the URI modified by me.

Re: Mod Perl 2.0 HTTP Handlers

2008-11-02 Thread Torsten Foertsch
On Sun 02 Nov 2008, Torsten Foertsch wrote: > On Sun 02 Nov 2008, Puneet Lakhina wrote: > > > Input headers are found in $r->headers_in and are set even before > > > PerlPostReadRequest. So, have a close look at your code. If that > > > doesn't help try to c

Re: Mod Perl 2.0 HTTP Handlers

2008-11-02 Thread Torsten Foertsch
On Sun 02 Nov 2008, Puneet Lakhina wrote: > > Input headers are found in $r->headers_in and are set even before > > PerlPostReadRequest. So, have a close look at your code. If that > > doesn't help try to create a test case as simple as you can and > > post it to the list. > > Not as per this: > ht

Re: Mod Perl 2.0 HTTP Handlers

2008-11-02 Thread Torsten Foertsch
On Sun 02 Nov 2008, Puneet Lakhina wrote: > Initially I thought PerlTransHandler would be the right thing to use. It is. > But as it turns out, the headers arent populated until that phase. Input headers are found in $r->headers_in and are set even before PerlPostReadRequest. So, have a close l

Re: $r->filename, can I do this here ?

2008-10-17 Thread Torsten Foertsch
On Fri 17 Oct 2008, André Warnier wrote: > Any way I can kind of "force" Apache to update it's > information after I call $r->filename, or does it already do that > anyway ? See the example in http://perl.apache.org/docs/2.0/api/Apache2/RequestRec.html#C_filename_ Torsten -- Need professional mo

Re: $r->filename, can I do this here ?

2008-10-17 Thread Torsten Foertsch
On Fri 17 Oct 2008, André Warnier wrote: > In a PerlFixupHandler, I want to use $r->filename to reset the target > of a PUT request, so as to "trick" the following Apache PUT content > handler into writing the PUT-ted file somewhere else than what the > original URL said. Yes you are allowed to do

Re: sethandlers question

2008-10-15 Thread Torsten Foertsch
On Tue 14 Oct 2008, Torsten Foertsch wrote: > On Tue 14 Oct 2008, André Warnier wrote: > > When I try this, I get an Apache error with the following logfile > > message : [Tue Oct 14 16:10:40 2008] [error] [client > > 84.158.163.207] $r->add_config() has failed: SetHandler

Re: SetHandlers question, Phase II

2008-10-15 Thread Torsten Foertsch
On Wed 15 Oct 2008, André Warnier wrote: > > I think you're wanting: > > > >      $r->set_handlers(PerlFixupHandler => sub > > {$_[0]->handler('modperl')}); > > Yes.  That works. Better to return something sane from the handler: sub {$_[0]->handler('modperl');0} # 0==Apache2::Const::OK Also co

Re: sethandlers question

2008-10-14 Thread Torsten Foertsch
On Tue 14 Oct 2008, André Warnier wrote: > At this moment, I cannot see clearly how the ErrorDocument solution > would allow me to send back a login page created dynamically, as I > need to do.  I will look it up, but as a definitive solution for the > time being I would prefer the $r->internal_red

Re: sethandlers question

2008-10-14 Thread Torsten Foertsch
On Tue 14 Oct 2008, André Warnier wrote: > I doubly appreciate not only because my immediate problem is solved, > but also because I learned a lot in the process. Try the $r->add_config again with the right override flag (OR_FILEINFO) and you'll see it will also work. > It seems to me that this

Re: sethandlers question

2008-10-14 Thread Torsten Foertsch
On Tue 14 Oct 2008, André Warnier wrote: > When I try this, I get an Apache error with the following logfile > message : [Tue Oct 14 16:10:40 2008] [error] [client 84.158.163.207] > $r->add_config() has failed: SetHandler not allowed here at > /usr/local/lib/apache2/perllib/AUTH/StarLogCookie.pm li

Re: sethandlers question

2008-10-14 Thread Torsten Foertsch
On Tue 14 Oct 2008, André Warnier wrote: > reminder of my config : > >> > >>     SetHandler jakarta-servlet ... > >> > > And, in summary, what I was trying to do is : > if the PerlAuthenHandler finds that the request is not authenticated, > then it tries to change the response handler for this re

Re: Apache2::Request in PerlInitHandler and PerlAuthenHandler

2008-10-14 Thread Torsten Foertsch
On Tue 14 Oct 2008, Shibi NS wrote: > And the ARULink::MetalinkAuth::handler is > > sub handler > { > my ($req) = @_; > > my $status; > my $username; > my $userid; > my $email; > > # > # Create a Session object. > # > my $req_params = $req->args; > my $cgi

Re: sethandlers question

2008-10-13 Thread Torsten Foertsch
On Mon 13 Oct 2008, André Warnier wrote: > As explained the other thread (requests and subrequests), I thought > it was more elegant and mod_perl-ish, instead of doing a re-direct to > a login page if the user needed authentifying, to having the login > page returned by a content handler. The apac

Re: sethandlers question

2008-10-13 Thread Torsten Foertsch
On Sun 12 Oct 2008, André Warnier wrote: > > >    SetHandler jakarta-servlet >    SetEnvIf REQUEST_URI "\.(htm|web|css|gif|jpg|js|html?)$" no-jk > >    PerlXXXHandler My::Module->some_method > >    ... > > > > ("jakarta-servlet" above means mod_jk --> Tomcat) > (and PerlXXXHandler being any kind

Re: requests and sub-requests

2008-10-12 Thread Torsten Foertsch
On Sun 12 Oct 2008, André Warnier wrote: > I have a little question related to the above, but not very urgent : > why the check on the configuration change ? what can change between a > request and a sub-request (or internal redirect) ? Suppose this: Require group foo Require group bar If d

Re: requests and sub-requests

2008-10-12 Thread Torsten Foertsch
On Sun 12 Oct 2008, André Warnier wrote: > In an attempt at being clever, I put the following code in the > handler : > >      unless ($r->is_initial_req) { >          if (defined $r->prev) { >              # we are in a subrequest.  Just copy user from main > request. $r->user( $r->prev->user ); >

Re: questions on Apache2::Connection

2008-10-11 Thread Torsten Foertsch
On Sat 11 Oct 2008, André Warnier wrote: > Do I understand this correctly that if in a Perl Handler i get > my $c = $r->connection(); > then $c is the object that represents the persistent TCP/IP > connection between the browser and the server, in case there is > "keep-alive" going on ? > > Now let

Re: "Free to wrong pool" error in Apache logs under high load

2008-10-10 Thread Torsten Foertsch
On Fri 10 Oct 2008, Scott Tomilson wrote: > I am running a build of mod_perl I got via perl.apache.org, yes (or I > think probably linked to uwinnipeg?).  No other modules than the > standard ones, plus the standard ActivePerl download from > ActiveState.  We actually tried the same solution on Sol

Re: Internal redirect inside an input filter

2008-10-09 Thread Torsten Foertsch
On Thu 09 Oct 2008, Dan DeSmet wrote: > I took your advice and tried switching it over to a TransHandler. >  Now, the beginning of the handler where I manipulate the cookies > looks like this: > > sub handler { >     my $r = shift; >     my $cookieString = $r->headers_in->get('Cookie'); >     ... >

Re: Internal redirect inside an input filter

2008-10-09 Thread Torsten Foertsch
On Thu 09 Oct 2008, Dan DeSmet wrote: > I'm attempting to write an input filter that performs an internal > redirect based on the contents of the cookies sent in the request > headers. Why an input filter? What you want is better done in a PerlTransHandler or a PerlFixupHandler. Torsten -- Need

Re: "Free to wrong pool" error in Apache logs under high load

2008-10-09 Thread Torsten Foertsch
On Thu 09 Oct 2008, André Warnier wrote: > > The PerlResponseHandler works fine for most requests, however if I > > blast a whole bunch of HTTP requests on multiple threads, etc to > > Apache, the Web server stops handling responses.  Connections > > eventually time out with no response.  Apache er

Re: [MP2]: strange behavior with Apache2::SubRequest::run

2008-09-19 Thread Torsten Foertsch
On Fri 19 Sep 2008, titetluc titetluc wrote: > > Does your mod_perl one return Apache2::Const::REDIRECT at the end? > > No, the module returns Apache2::Const::MOVED_TEMPORARILY, setting the > Location header by using $r->err_headers_out $ perl -MApache2::Const=REDIRECT,HTTP_MOVED_TEMPORARILY -le '

Re: How to pass the post data to a script

2008-09-17 Thread Torsten Foertsch
On Wed 17 Sep 2008, grsvarma019 wrote: > If the requested script of an application needs POST data, that data > is not being sent to the requested script ,but instead it is being > captured by apache request object of the mod_perl. > > How can i pass this data to the requested script? First, see i

Re: How to extract the protocol part of URL from an apache request

2008-09-17 Thread Torsten Foertsch
On Wed 17 Sep 2008, John ORourke wrote: > I had the same problem but the machine serving the request had a > reverse proxy in front of it.  I used the following to inject a > header on the proxy: > >         SetEnv SCHEME http >         RewriteCond %{HTTPS} on >         RewriteRule ^(.*) $1 [E=SCHE

Re: How to extract the protocol part of URL from an apache request

2008-09-17 Thread Torsten Foertsch
On Wed 17 Sep 2008, grsvarma019 wrote: > But , i couldn't find how to extract the protocol(http or https ) There are Apache2::ModSSL and Apache::SSLLookup on CPAN in case you need that information in a request phase prior to the ResponseHandler. Mod_ssl can be configured to export SSL informatio

Re: using MOD_PERL with script causes looping

2008-09-11 Thread Torsten Foertsch
On Wed 10 Sep 2008, csross wrote: > On a solaris 8 server with Apache 2.6 and perl 5.8.8, we have an > html/javascript file that uses HTTP Post to a perl script.  The perl > script sends data back via HTTP get to a redirected HTML file. The > HTML file strips off data from the command line of the U

  1   2   3   4   >