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 instead of

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 ago

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

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

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 should be

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

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 CPAN.  It

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: Location /auth SetHandler perl-script PerlAuthenHandler DataExchange::AuthHandler #PerlResponseHandler ModPerl::Registry

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

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 when

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: 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%3Apluginmode=all I have seen padre first time at the this year

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 serve them

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

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:;      $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 internal

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 unsure.)

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 apache

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 there magic to remove filters

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    or  

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: Location /sandbox/semantic-web/ SetHandler perl-script PerlHandler Apache2::Alex::SemanticWeb /Location

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 Apache2::Const

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

Re: executing PerlHandler after default_handler?

2009-05-13 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 Torsten

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 web

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 cgi I see

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? Just

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 OK

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) (((char *)

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,

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 fail,

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-info()

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 at 12:38 PM, Torsten Foertsch

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 go

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::Bootstrap

Re: who's putting that pre 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 uri

Re: who's putting that pre 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

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 sbirl+excha...@concept.temple.edu was undeliverable. The reason for the problem: 5.1.0 - Unknown address error 550-'5.7.1

Re: who's putting that pre 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

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

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:

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

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 Perl block? How is this different from doing it in the startup.pl file?   Yes, I see, the 2nd run of the Perl code doesn't have STDERR either. So, you can open a startup logfile in perl and override CORE::GLOBAL::warn/die

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. It seems that

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 a

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         Location /portal/             SetHandler modperl

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 a...@ice-sa.com 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: 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 (comes

Re: PerlSetVar behaviour within Limit directive

2009-01-23 Thread Torsten Foertsch
On Fri 23 Jan 2009, Pat Downey wrote:   Limit GET     PerlSetVar CrowdAllowedGroups reader,writer     Require valid-user   /Limit   LimitExcept GET     PerlSetVar CrowdAllowedGroups writer     Require valid-user   /LimitExcept /LocationMatch What I'd like is for members of the reader or

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 not on

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

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 a

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: VirtualHost *:8080    ErrorLog C:/location/of/acd/logs/error.log    Perl       use lib 'C:/location/of/acd';

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 ? What

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: 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 it

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 that there

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 for

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 page In

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: Question about Apache2::ServerUtil and PerlCleanupHandler

2008-12-05 Thread Torsten Foertsch
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, but on my setup $r has always at least a PerlResponseHandler so I'm not sure. Apache request configuration is performed in 2 steps. The first occurs

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: 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: 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

Re: Substituting URLs in PerlOutputFilterHandler

2008-11-10 Thread Torsten Foertsch
On Mon 10 Nov 2008, Puneet Lakhina wrote: essentially im trying to modify a href= 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

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, 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 create a test case as simple as you can and post

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

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: $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 that.

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

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 not allowed here at /usr/local

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 consider

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-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 line

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

Re: sethandlers question

2008-10-14 Thread Torsten Foertsch
On Tue 14 Oct 2008, André Warnier wrote: reminder of my config : LocationMatch /servlet.xyz$     SetHandler jakarta-servlet ... /Location 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

Re: sethandlers question

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

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

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: 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: Location /mainreq Require group foo /Location

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 lets say

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

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: [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 'print

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

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

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 if

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 URL

Re: mod_perl 2 and IPC::Open3

2008-09-05 Thread Torsten Foertsch
On Thu 04 Sep 2008, Tina Müller wrote:      $pid = open3($wtr, $rdr, $err,          '/usr/bin/source-highlight', '-s', 'perl', '-css', '--no-doc'); print $wtr $content;      close $wtr;      warn __PACKAGE__.':'.__LINE__.: before read loop\n;      while ($rdr) {          # this is

Re: question on downloading CGI

2008-09-05 Thread Torsten Foertsch
On Fri 05 Sep 2008, [EMAIL PROTECTED] wrote: I want to generate a data file which should be downloaded by clients. Rather than generate this file and put it in a web dir and tell clients to download it, is there any way to generate the content dynamicly and put it to cients? I mean I don't

Re: Prototype mismatch: sub main::strftime

2008-08-26 Thread Torsten Foertsch
On Tue 26 Aug 2008, Darragh Gammell wrote: Subroutine main::strftime redefined at /usr/share/perl/5.8/Exporter.pm line 66.  at /home/secure/public_html/tagtag/send.cgi line 10 Prototype mismatch: sub main::strftime: none vs ($\@;$) at /usr/share/perl/5.8/Exporter.pm line 66.  at

Re: mp2, IPC::Run3 Environment Variables giving variable not set error

2008-08-16 Thread Torsten Foertsch
On Sat 16 Aug 2008, Berg, Eric wrote: Now, the environment is a process global resource. So, if those values are changed all threads are affected. This is surely no what you want. When you say that the environment is a global process, global to what?  Each forked process has its own

Re: mp2, IPC::Run3 Environment Variables giving variable not set error

2008-08-15 Thread Torsten Foertsch
On Fri 15 Aug 2008, Berg, Eric wrote: This issue of the environment variables' not being passed to forked processes is turning into a fairly substantial problem for me.   We have a number of places in our code -- both the modules that are tightly controlled and fairly easy to manage, as well

Re: mod_perl 2.0 fails on make

2008-08-15 Thread Torsten Foertsch
On Fri 15 Aug 2008, Fred Moyer wrote: When I run 'make'. It goes pretty fair but it ends with this. modperl_exports.c:1169: error: `modperl_thx_interp_get' undeclared here (not in a function) modperl_exports.c:1173: error: `modperl_thx_interp_set' undeclared here (not in a function)

  1   2   3   4   >