Re: Singleton Persistence

2014-02-03 Thread John ORourke
I do it by treating the request as something transient - in other words assuming that interpreter state is maintained between requests, and resetting or recreating all the objects I use to process the request in my fixup handler. I make use of the persistence by having a singleton that maintains

Pre-processing the request body

2010-04-21 Thread John ORourke
Hi folks, I have a mod-perl app on the receiving end of a POST from a credit card company, and they are sending the data as application/x-www-form-urlencoded but they aren't URL-encoding UTF-8 characters. When I give that malformed data to Apache2::Request it refuses to see any POST variables

Re: dealing with empty field names in query

2009-02-07 Thread John ORourke
André Warnier wrote: application/x-www-form-urlencoded is the default, and it means that you are passing the form data appended at the end of the URL, preceded by a ? sign, as one long string of the form name1=value1name2=value2... etc.. usually known as the query string. That is easy to do,

Re: dealing with empty field names in query

2009-02-06 Thread John ORourke
André Warnier wrote: In those name/value pairs, according to HTML 4 at least, the names must begin with a letter [A-Za-z]. The empty string does not do so. Garbage in, garbage out. +1 + : Above the OP is talking about a request body. Are we sure that this is really a request body, and

Re: general performance issues

2008-11-10 Thread John ORourke
André Warnier wrote: If it's too off-topic nevertheless, just send me packing, I won't insist. I might be alone in this but I think apache memory use is something all heavy mod_perl users have to get to grips with, so I mentally s/java|tomcat/mod_perl/g'd and read your very long email

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

2008-09-17 Thread John ORourke
Torsten Foertsch wrote: 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. I had the

Re: return value for response handler

2008-06-12 Thread John ORourke
Geoffrey Young wrote: I wanted to redirect the user's browser, and in my response handler I was setting $r-status(302) but returning Apache2::Const::OK instead of the correct Apache2::Const::DONE. return Apache2::Const::REDIRECT Unfortunately I can't easily do that here - I have plug-in

return value for response handler

2008-06-10 Thread John ORourke
Hi folks, I had a bug with an interesting side effect which I want to understand. I wanted to redirect the user's browser, and in my response handler I was setting $r-status(302) but returning Apache2::Const::OK instead of the correct Apache2::Const::DONE. This caused Apache to perform an

Re: is there a maximum output character length ?

2008-05-21 Thread John ORourke
william wrote: Let's say if I have $ruleStr = aa eee; open(PARSER,$self-{parser}.pm); print PARSER $ruleStr; It will write a few characters only, not complete. Is there a thread problem or something ? You need to explicitly close the file - under CGI, your

Re: is there a maximum output character length ?

2008-05-21 Thread John ORourke
william wrote: On Thu, May 22, 2008 at 4:30 AM, John ORourke [EMAIL PROTECTED] wrote: william wrote: It will write a few characters only, not complete. Is there a thread problem or something ? You need to explicitly close the file - under CGI, your program exits at the end

Re: [OT] is there a maximum output character length ?

2008-05-21 Thread John ORourke
Well thanks! Under regular CGI, every time your browser requests a page, Apache has to find your script, load Perl, compile your script and any modules you use, run it, and exit Perl. Under mod_perl, all the loading and compiling is done when Apache starts, not on every request - it's doing

server port number in requests

2008-04-23 Thread John ORourke
Hi folks, I can't seem to find a way to retrieve the inbound port number during requests. I have a server listening on multiple ports, and need to know which one the request came in on. Here's the setup: apache config: Listen 127.0.0.1:81 Listen 127.0.0.1:82 NameVirtualHost *:*

Re: server port number in requests

2008-04-23 Thread John ORourke
Many, many thanks for the input everyone - naturally it turned out to be a case of RTFM but here's a summary of the simplest ways to do it. I've no idea how I missed these in the docs, though I am at the bang-head-on-wall stage of development. (I'm going on the assumption that the proxy may

body truncated on extra reads

2008-04-22 Thread John ORourke
Hi folks, I'm curious - can anyone explain what actually happens internally if you try to read more from $r-read() than specified in the Content-Length header? I noticed when trying subsequent calls to read after all bytes had been read that it truncates the buffer, which I guess is

reading yet preserving request body

2008-04-21 Thread John ORourke
Hi folks, I have an MVC-style system which passes the request object to various modules until one of the 'accepts' it. I'm using Apache2::Request to parse incoming form parameters which is fine. The problem is that some of these modules want to read XML or Multipart MIME from the request

Re: Apache configuration question - restrict folder access to local machine only

2008-04-11 Thread John ORourke
Expertly brought back on topic there, Torsten... if I ask about the price of beans and how it relates to global warming can you give me a mod_perl related answer? :) John Torsten Foertsch wrote: On Fri 11 Apr 2008, John Zhang wrote: We have a situation that we would like to restrict the

Re: utf8 urls

2008-03-19 Thread John ORourke
Eli Shemer wrote: For some reason the following test doesn’t print anything out to the screen Do I need to change something in the apache configuration, or mod_perl’s ? /articles_read.pl?id=חוזרת ## get http parameters $r = shift; $apr = Apache2::Request-new($r); print

Re: Many handlers in the same module

2008-03-19 Thread John ORourke
André Warnier wrote: In a similat setup, I successfuly use my ($self, $r) = @_; Colin Wetherbee wrote: PerlAccessHandler JetSet::Handler-AccessHandler PerlResponseHandler JetSet::Handler-ResponseHandler The only down-side is that (AFAICR) it is creating a new object for each request - my

[a little OT] mod_proxy 502 errors in dual apache setup

2008-03-05 Thread John ORourke
Hi folks, Slightly OT but hopefully someone on here has had similar experience. I've got a site with fairly heavy traffic and a light/heavy apache setup. Occasionally the back-end servers seem to get swamped and suddenly every request from the front end starts getting a 502 proxy timeout

Re: apache process size

2008-02-22 Thread John ORourke
Roberto C. Sánchez wrote: On Fri, Feb 22, 2008 at 09:52:30AM +, John ORourke wrote: Mine start at around 60MB, jump to 80MB when my app is initialised, and can peak at 120MB during their lifetime. For reference I tried making the tiniest possible one with everything stripped out

Re: Amazon

2008-02-22 Thread John ORourke
Jie Gao wrote: and quirks of virtualisation, performance is actually weird (a new way of describing performance). I tend to achieve an average 0.6 wierds, although in the summer it can reach 0.72 wierds. John

Re: Auth - Auhtz module session?

2008-01-29 Thread John ORourke
Ward Loockx wrote: I've written a ldap auth-authz module in mod_perl but when I give in wrong username/pass I need to close my browser in order to get the login screen again. When I try to refresh without closing I'm getting the following message wich is obvious Authorization Required

Re: Apache::DProf giving empty tmon.out files

2008-01-21 Thread John ORourke
Alx G wrote: I'm running Apache 2.2.3, the conf has the following in it: -- ... LoadModule perl_module modules/mod_perl.so # Perl profiler # #Perl #require Apache::DB; #Apache::DB-init; #/Perl PerlModule Apache::DProf ... -- I tried with and without the commented stuff - as was

Re: Apache::DProf giving empty tmon.out files

2008-01-21 Thread John ORourke
Alx G wrote: Thanks for the tips John, however as I mentioned in my previous post, I did in fact try it with the DB-init call and it made no difference. Also, the tmon.out files *are* being created by the apache process so that's not an issue either. I misunderstood, sorry. If you're

Re: Refreshing stored data at administrator's signal

2008-01-13 Thread John ORourke
Colin Wetherbee wrote: At the moment (and not in a production environment), every time the drop-down list is generated for a web page, the script queries the database to retrieve the entire list of aircraft. I would prefer to retrieve the list of aircraft when each Perl interpreter starts and

Re: restrict virtual hosts programs

2008-01-12 Thread John ORourke
Jeff Pang wrote: vhA's programs are running under /path/a/cgi-bin, but actually, the programs of vhA can access vhB's directory (ie,they can open and write some files in /path/b/). vice versa, the programs of vhB can access vhA's directory. It's not really a mod_perl thing but you need to

Re: Cookie questions

2007-12-24 Thread John ORourke
Raymond Wan wrote: I was wondering if it was possible to delete cookies. I read that using Javascript, cookies can be deleted by setting it to a time in the past. I'm not sure how to do it in Mason, though. I think I know how to get a cookie and also to set a new one and send it out. But,

mp2/perl bug in substr( lc( $utf8_url ) )

2007-12-05 Thread John ORourke
Hi folks, I appear to have found a bug, possibly in perl's utf8 handling but I need to create a test to make sure. I have a workaround which is surprisingly simple, hopefully someone can explain it! I'm not using the 'mp2bug' template because I have 2 different architectures, 1 which

dynamic config

2007-12-03 Thread John ORourke
Hi folks, I'm sure this has cropped up in the past but I can't see anything obvious in the archives (regex search on the archives would be great!) I have some apps where users want to add extra domains and I'd like to do it on the fly if possible - in other words, modify the ServerAlias

caching reverse proxy config+init scripts

2007-11-07 Thread John ORourke
Hi folks, I'm about to write a generic set of init scripts and config files to make setting up dual apache servers (one light proxy/cache/ssl, one heavy mod_perl) easy. Am I reinventing the wheel? If not I'll post a link here when I'm done. cheers John

mod_perl, worker mpm and memory use optimisation

2007-11-05 Thread John ORourke
Hi folks, I have a nice stable app that's been steadily maturing over 2 years, written in mod_perl from scratch. I've learned lots and currently have a dual-httpd reverse proxy/cache approach which works really well even on 'normal' size boxes - 2GB RAM, 3GHz single CPU, 32 or 64 bit. I

Re: ANNOUNCE: XS-based minifiers for JS/CSS

2007-10-21 Thread John ORourke
If you'll pardon the devil's advocate bit... Caching isn't really the issue - you can use mod_cache, or make your own using CSS::Minifier. I think Bjorn was questioning the Apache2::Filter::Minifier:: approach. Here's a different take on Apache2::Filter::Minifier. I run a small web dev

mystery subrequest being generated after fixup

2007-10-21 Thread John ORourke
Hi folks, Is it possible to get apache to log which modules are being called at request stage? If it is possible that should pinpoint my problem - if it's not possible, read on... I appear to have a subrequest being generated in some cases between my fixup handler and response handler.

Re: RFC: mod_perl PHP integration

2007-10-14 Thread John ORourke
Perrin Harkins wrote: On 10/13/07, John ORourke [EMAIL PROTECTED] wrote: My simple CMS has become a bit of a behemoth, and I want to complete its transformation into Optimus Prime by allowing my developers to write plug-in modules in PHP, Java etc. The PHP and PHP::Include modules

RFC: mod_perl PHP integration

2007-10-13 Thread John ORourke
Hi folks, My simple CMS has become a bit of a behemoth, and I want to complete its transformation into Optimus Prime by allowing my developers to write plug-in modules in PHP, Java etc. I read this: http://www.regdeveloper.co.uk/2007/10/12/java_application_server_zend/ (summary: php and

Re: Fw: mod_perl success stories on ZDNet (KMM6461378I96L0KM) :ppk1

2007-10-08 Thread John ORourke
Carl Johnstone wrote: Looks like somebody has managed to subscribe one of the PayPal support email addresses to the list... No - a zombie somewhere sent an email with 'from' address [EMAIL PROTECTED], 'to' address [EMAIL PROTECTED], a subject line from the modperl list and with the message

mod_proxy with light and heavy httpd - questions

2007-09-24 Thread John ORourke
Hi folks, I'm just implementing the usual light/heavy httpd setup with mod_proxy and mod_cache and have a couple of queries. The setup is simple - port 80 is my light httpd, serving static and nearly static content, using mod_cache and mod_proxy to send some requests to the heavy mod_perl engine

Re: mod_proxy with light and heavy httpd - questions

2007-09-24 Thread John ORourke
Perrin Harkins wrote: On 9/24/07, John ORourke [EMAIL PROTECTED] wrote: ProxyPreserveHost directive which preserves the HTTP Host header when passing the request on - am I right in thinking the docs need to be corrected, and this is no longer an issue? It's no longer an issue

Re: Restarting Apache2.2 from PERL

2007-08-29 Thread John ORourke
Matthieu FEREYRE wrote: kill -USR1 apache_pid do that extremly well but apache doesn't have the rights to launch it from perl ! Try writing a script which does it - eg. #!/bin/sh /etc/init.d/apache restart put that somewhere and make it setuid root, then in your perl code call

Re: Performance Questions

2007-07-08 Thread John ORourke
Marc M. Adkins wrote: Well, I _am_ using XSLT for my template expansion. That kind of makes XML important. Thanks for the responses, and that's about what I figured I would try. Just wondering if anyone would answer no it won't work because... Let us know how it goes - using XSLT that way

Re: Performance Questions

2007-07-07 Thread John ORourke
Marc M. Adkins wrote: The other side of this is that the response handler generates XML and the output filter handler consumes it. I was thinking that I should be able to hang the XML object (not the text representation thereof) on the request object and avoid the overhead of printing the XML

Re: apache and php

2007-07-03 Thread John ORourke
Jonathan Vanasco wrote: i think the only way around it was to recompile everything from scratch. generally speaking though... don't run mod_php and mod_perl on the same server. you're just going to bloat apache and tie up resources. I'm running both on Fedora Core 5 and 6, but I had to

Re: PerlAuthenHandler PerlAuthzHandler in mod_perl 2.0

2007-06-28 Thread John ORourke
Hi Martijn, http://perl.apache.org/docs/2.0/user/handlers/http.html is your friend... Authen is only called if there is a 'require' and AuthType/AuthName directive, Authz is only called if Authen is successful. cheers John Martijn wrote: Hello. I'm doing some testing/debugging on a newly

Re: PerlAuthenHandler PerlAuthzHandler in mod_perl 2.0

2007-06-28 Thread John ORourke
Geoffrey Young wrote: and AuthType/AuthName directive, but that is not :) you might run into trouble if you don't define those directives, but their absence won't prevent the auth phases from running. Interesting and useful! In that case we need a doc patch - see

Re: Where is Perl compilation output when using modperl ?

2007-06-28 Thread John ORourke
Jens Helweg wrote: I thought perl -c mymodule.pm is no option when developing modperl handler modules because these will only run/build in the apache modperl environment and not on command line ? Not sure about your windows environment but a command-line perl -c works just fine for me on

Re: [OT]website structure

2007-06-25 Thread John ORourke
[EMAIL PROTECTED] wrote: Do you know where has the sources for popular web structure for a high traffic site?Such as HA,load balance,cache,db pool,etc. Assuming you're using MySQL, there are some superb seminars available at http://www.mysql.com/news-and-events/on-demand-webinars/ - however

Re: opinions of mod_perl users on MIME email sending

2007-06-22 Thread John ORourke
Jonathan Vanasco wrote: On Jun 22, 2007, at 4:13 AM, Clinton Gormley wrote: Disadvantage: - you can wait for up to a minute before the mail gets processed. Although, with Schedule::Cron, you can schedule jobs every second The database idea has some good uses - I run 120 shop sites and of

Re: opinions of mod_perl users on MIME email sending

2007-06-21 Thread John ORourke
stuck on DNS lookups for address verification. cheers John Frank Wiles wrote: On Mon, 18 Jun 2007 16:51:18 +0100 John ORourke [EMAIL PROTECTED] wrote: Hi folks, I'm wondering what modules people use for sending email? At the moment I'm using MIME::Lite but I'm doing several things myself

Re: apache version check

2007-06-19 Thread John ORourke
Jonathan Vanasco wrote: On Jun 18, 2007, at 5:05 PM, John ORourke wrote: $version = ( $ENV{MOD_PERL_API_VERSION}==2 )?2:1; that won't work, because that requires mod_perl to be loaded. the original poster said: How do I check what version of Apache is installed from command line

opinions of mod_perl users on MIME email sending

2007-06-18 Thread John ORourke
Hi folks, I'm wondering what modules people use for sending email? At the moment I'm using MIME::Lite but I'm doing several things myself which a bigger module might do for me: - header encoding - I can't find any modules which will Q- or B-encode headers that have the UTF-8 flag set -

Re: apache version check

2007-06-18 Thread John ORourke
_spitFIRE wrote: John ORourke wrote: use Apache2::ServerUtil; IMHO, doesn't this itself mean that you have Apache 2.x.x installed? Ah, you didn't say you were detecting v1 or v2 - I thought you just wanted to know the .x.x bit! If you're just after a '1' or a '2' try

APR::Request::Param subclassing

2007-06-08 Thread John ORourke
Hi, I know this isn't the apreq list but I don't suppose anyone has an example of subclassing APR::Request::Param? I'm trying this: package My::Handler; sub handler { ... my $query=Apache2::Request-new(); my $params=$query-param(); $params-param_class('My::Param::UTF8'); ...

mod_perl, html forms and unicode/utf-8

2007-06-05 Thread John ORourke
Hi folks, I've been dragged kicking and screaming into the 21st century and am making my mod_perl application fully utf-8 aware and transparent. It's all going OK but I want to know if anyone has a better solution to receiving form data containing non-ASCII chars. Output is fine - I can

Re: mod_perl, html forms and unicode/utf-8

2007-06-05 Thread John ORourke
Thanks Gents, I've got a certain level of abstraction as per Jonathan's approach, which I can just add the libapreq method. The note about DBD::MySQL is interesting, I was wondering about that! cheers John Clinton Gormley wrote: Hi John I've been using libapreq, which has a charset

Re: Module proposal: CGI::Cookie::Protected

2007-05-24 Thread John ORourke
Check out a similar module I wrote last year for mod_perl: http://www.versatilia.com/downloads/Apache2/Cookie/Validated.pm It's designed to store simple hashes. I still haven't got around to putting it on CPAN but have been using it happily for 18 months and it has a couple of features you

merging multiple tmon.out files

2007-05-11 Thread John ORourke
Hi folks, Recently I needed to track down some slow page-load times on a production server, so I took the performance hit and stuck Devel::DProf on it for a few hours, but then had to get an overall picture. So I wrote a little script to merge multiple tmon.out files - help yourselves:

Apache::DProf missing some subroutines

2007-05-11 Thread John ORourke
Hi folks, Any idea why Apache::DProf would be failing to list some subroutines that are definitely being called, in the tmon.out file? I grepped all sub references from tmon.out and it's listing my method handlers, it's listing some of my constructors, and its listing some object methods,

Re: Apache::DProf missing some subroutines

2007-05-11 Thread John ORourke
Geoffrey Young wrote: Jeff wrote: Not sure if its relevant, but from general Perl usage, Devel::Profiler often fails to properly recognise function names if its USE statement ends up being executed before your classes have been USEd. yes, because Devel::Profiler scans for then during

Re: Apache::DProf missing some subroutines

2007-05-11 Thread John ORourke
Perrin Harkins wrote: On 5/11/07, John ORourke [EMAIL PROTECTED] wrote: Any idea why Apache::DProf would be failing to list some subroutines that are definitely being called, in the tmon.out file? Yes. You're probably loading some of your code before initializing the debugger. Put something

Apache::DProf - can tmon.out files be merged?

2007-05-07 Thread John ORourke
Hi folks, I just discovered Frank's article on debugging mod_perl... man have I been coding in the dark ages! I need to run it on a production server and can't keep the no. of children at 1, so does anyone know if the tmon.out files from all the apache children can be merged somehow? It

Re: regex quickie

2007-04-26 Thread John ORourke
Come on people, someone's gotta do this for a laugh... {do_.lc(($r-uri()=~/(\w+)\.com\//i))}(); sub AUTOLOAD { return undef; } sub do_google { } sub do_yahoo { } Yeah so I'm bored and ready for home... John

Apache2::ServerUtil set_handlers/push_handlers query

2007-03-18 Thread John ORourke
Hi folks, I might be having a blind moment, this is probably in the docs but please pity the stressed coder... q1) can I put multiple handlers in a call, like: push_handlers( PerlAccessHandler=\access, PerlAuthenHandler=\authen ) ? q2) when set_handler is called, it's only setting the

Re: [OT] SOAP::Lite help

2007-03-13 Thread John ORourke
Not really mod_perl but possibly of interest - here's my version, untested: #!/usr/bin/perl use SOAP::Lite +trace; use Data::Dumper; $soapobj=SOAP::Lite-service('https://myserver.myhost.com/services/EndUser?wsdl'); $soapresult=$soapobj-getUser('wombat104'); if($soapresult-fault){ print

Re: Generating login forms from authen handler?

2007-03-08 Thread John ORourke
Hadmut Danisch wrote: how would I generate a web page (i.e. a login form) from a authen handler in the case that the user is not authenticated yet ? Can the authen handler generate HTML code and pass it back to the client as an immediate reply? The authen handler can simply return the

Re: Generating login forms from authen handler?

2007-03-08 Thread John ORourke
I am currently doing something similiar, I just modify the URL to that of the script to be called. But I need to generate the HTML code from *within* the authen handler (needs dynamic generation etc.). Ah I see - probably best not to output stuff at that stage as it could confuse the

Re: 'current server directory' ?

2007-02-20 Thread John ORourke
Jonathan Vanasco wrote: I'm trying to figure out a way to store them in a semi-standard manner. The only thing i can think of right now, is writing a 'server root' variable for the dir in which I am installing my mp app, and reading it based on that. Not sure if this'll help but for

Re: 'current server directory' ?

2007-02-20 Thread John ORourke
I just realised you're talking per-real-server not per-virtual-server, in which case you could make a custom directive or a PerlSetVar outside of a VirtualServer. The custom config directives take a bit of time to figure out but I'm happy to send source code off list. cheers John Jonathan

Re: 'current server directory' ?

2007-02-20 Thread John ORourke
No problem Lin - I'll post a URL soon! Lin wrote: Hi John, The custom config directives take a bit of time to figure out but I'm happy to send source code off list. Why not in-list? I'm interested and there might be others. Cheers, Lin

Re: apache MaxClients and locking up

2007-02-09 Thread John ORourke
Thanks for all the advice guys - due to pressure from the customer I'm going to concentrate on optimising the app and then look into the server optimisations. It's suffering from inner-platform-effect at the moment (http://thedailywtf.com/forums/69415/ShowPost.aspx ) so the DB is doing way

apache MaxClients and locking up

2007-02-08 Thread John ORourke
Hi folks, Not sure if this is mod_perl related but the logic goes I've never had this issue on a non-mod_perl server... I've got a busy server with quite a few problems, but one in particular is very odd. Occasionally the DB gets a bit bogged down and starts taking a while to respond

database caching in persistent handlers

2007-01-15 Thread John ORourke
Hi folks, please humour me with this slightly OT RFC... So I've re-invented the wheel (or MVC framework) and need to make it efficient. A high-traffic site is using the system and is causing me some grief... Some questions have come up re efficient caching: - MySQL caches compiled

Re: database caching in persistent handlers

2007-01-15 Thread John ORourke
Perrin Harkins wrote: On Mon, 2007-01-15 at 13:02 -0600, Frank Wiles wrote: Not being a MySQL guy this could be fixed now, but last I heard MySQL tossed it's cache anytime the table was updated. Not very efficient IMHO. Yes, modifying data in a table invalidates the cache

Re: The case of the disappearing plus sign

2006-12-18 Thread John ORourke
I wouldn't really call this a modperl question but regardless... Chris Schults wrote: It appears that the + is getting stripped out at some point as the script is returning results for water pollution instead of water+pollution. Is it possible that Apache is the culprit or should we be looking

Re: Apache2::Cookie/APR::Request::Cookie

2006-12-09 Thread John ORourke
cfaust-dougot wrote: I've tried both Apache2::Cookie and APR::Request::Cookie (from the posts I read I got the impression it was better to use ARP::Request::Cookie then Apache2::Cookie). Definitely. You also need to read the man pages, but I've saved you the trouble...

Re: Apache2::Cookie/APR::Request::Cookie

2006-12-09 Thread John ORourke
Ummm... this should be obvious but are you redirecting to a different hostname? In your code you're not explicitly setting the cookie domain or path, so the browser will only send the cookie to pages with the same hostname. That would explain why you don't see it on the redirect... Note

Re: Apache2::Cookie/APR::Request::Cookie

2006-12-09 Thread John ORourke
cfaust-dougot wrote: I'm always passing a relitive path to Location so I didn't think it would matter.. Sure enough once I simply added 'Path = '/', to all my cookie create statements, SUCCESS!!! Yay! Has to be said I only thought of the hostname because I do the path out of habit! By the

Re: method handlers

2006-10-27 Thread John ORourke
Jordan McLain wrote: just noticed... in the actual code 'handler' is prototyped with ($$) sub handler { my ($class, $r) = @_; my $self = ... # something hashref-ish I will end up writing another new() for use when not called directly from apache. Is this bad style, since the method

MapToStorageHandler and custom config

2006-10-27 Thread John ORourke
Hi folks, I've implemented some custom config directives, works fine. However, when my MapToStorage handler asks for the per_dir_config hash, it seems to be getting the server config - all other handlers get the per-dir no problem. Any ideas? cheers John

getting current phase / PerlOptions in Location

2006-10-25 Thread John ORourke
Hi folks, I can't find anything in the docs (not really sure what to look for) - I want to retrieve the current phase from within a handler. Basically I'm trying to implement a per-directory PerlOptions type directive, so I can turn phase handlers on and off per-directory not just

Re: getting current phase / PerlOptions in Location

2006-10-25 Thread John ORourke
Thanks Adam, not sure why but I didn't look under ModPerl::Util:: Adam Prime x443 wrote: That should be ModPerl::Util::current_callback for 2.0.

Re: design patters with mod_perl

2006-09-13 Thread John ORourke
Greger, Greger wrote: Is there anything in particular that one should take into account regarding modperl and design patterns vs trad CGI-scripting? As for now, I return XML from the package methods, and use XSLT for the transformation to XHTML. This works very well, seems flexible, but are

[OT?] UK mod_perl contractor/moonlighter possibly needed

2006-08-21 Thread John ORourke
Hi folks, hope this isn't too OT.. just dipping my toes in the water here. This may not happen (depends on funding) but I'd really like to know if there are any UK based mod_perl coders who are either contractors or fancy a bit of out-of-hours work, so I have a case to present to my business

Re: dynamic loading

2006-08-21 Thread John ORourke
Arshavir Grigorian wrote: I am wondering if anyone has experience with a framework for dynamically loading certain modules into an application and executing certain code based on whether a certain module is loaded (available or not). By dynamically, I do not mean loading run-time, only being

Re: PerlResponseHandler ignored

2006-08-04 Thread John ORourke
Cristi Barladeanu wrote: Hello, I come back with more details. This is my complete conf in Apache's sites-enabled: I can't see the problem but I would say you should probably have the SetHandler outside the Location bit - currently it doesn't look like your PerlTransHandler will

Re: [OT] Database Authentication

2006-08-03 Thread John ORourke
Not exactly a mod_perl question but I'm sure it's something we've all thought about before... Vladimir S. Tikhonjuk wrote: I want to make a Database Authentication for my site. I have a PostgreSQL Database. I made a connect_on_init by user 'web_user' to the database. The question is:

Re: X-Forwarded-For

2006-08-03 Thread John ORourke
Jonathan Vanasco wrote: my mp2 needs to get the ip of the remote address on some installations, mp2 is on port 80 on other installations, mp2 is on 80xx and the ip is in X-Forwarded-For You could re-write the remote IP at an early stage - add a PerlFixupHandler or PerlTransHandler which

Re: handlers

2006-08-01 Thread John ORourke
Frank Maas wrote: On Tue, Aug 01, 2006 at 07:33:51AM +0100, John ORourke wrote: You could even do something really clever and make it map URI onto module - eg. so /debitor/contract/create calls Debitor::Contract-create(), but that wouldn't be very secure! Why would that be not very

Re: handlers

2006-08-01 Thread John ORourke
Vladimir S. Tikhonjuk wrote: John ORourke пишет: Vladimir S. Tikhonjuk wrote: O.K. Thanks for answer :) I want to write rather big project. How I have to construct it: I mean, should I make a lot of handlers, like, /debitor, /debitor/documents, /debitor/documents/contracts

Re: handlers [OT]

2006-08-01 Thread John ORourke
Michael Peters wrote: John ORourke wrote: You could even do something really clever and make it map URI onto module - eg. so /debitor/contract/create calls Debitor::Contract-create(), but that wouldn't be very secure! You could use something like Apache::Dispatch to achieve

out of date dependency in libapreq2?

2006-06-24 Thread John ORourke
Wrong list, I know, but I figure mod_perl people will have come accross this more than anyone. Is there any reason the CPAN Apache2::Request has a dependency on mod_perl (as opposed to mod_perl2) ? Doing a clean mp2 install I have to ensure all its other dependencies are met, then install

Re: (Database-)Object initialization during server-startup

2006-06-23 Thread John ORourke
Perrin Harkins wrote: Create a new instance of the mod_perl handler module during startup and refer to that for the handlers (code below). This module would then cache DB connections and provide a method for 'create or fetch current DB connection'. DBI-connect_cached will do all of this

Apache2::Log Filename(line) behaviour

2006-06-16 Thread John ORourke
Hi folks, Is there a way to log a debug-level message without Apache2::Log writing the filename and line number of the caller? Could I override something in Apache2::Log? This behaviour is documented in man Apache2::Log. I'm using Log4perl, so every debug-level message comes out with

logging recommendations

2006-05-30 Thread John ORourke
Hi folks, I've written a largeish (80 modules, 20k lines) mod_perl CMS and currently the logging is a mess. I've looked at a few on CPAN, noteably Log::Common, but I really want something which: - allows a single, global debugging level - does not require each module to have access to

Re: logging recommendations

2006-05-30 Thread John ORourke
Thanks to everyone who replied. Log::Log4perl seems perfect and easy enough to use, especially for handling logging within a class hierarchy and centralised control, without having a bunch of references to pass around. I'm making an Apache2:: wrapper for it so I can easily config it from

Re: sharing data within a handler (but not across)

2006-05-27 Thread John ORourke
Jonathan Vanasco wrote: i specifically wanted to keep apache related stuff out of the model when designing it, but i was in the situation where i needed to access it for a quick hack ( i chose the longer elegant solution that negated touching it ) and said hm... i wonder how could i do

Re: $c-remote_ip

2006-05-22 Thread John ORourke
Jonathan wrote: testing on my local mac network @home, its giving me addresses like such: fe81::2333:25ee:ffb2:b244 It's certainly an IPv6 address - 128 bits, and :: means 'the longest set of zeroes you can fit in'. Maybe your macs are using IPv6 natively. Why is it causing a

Re: apache url mapping question

2006-05-17 Thread John ORourke
Hi Jonathan, two examples which I think are right, comments please folks! Jonathan Vanasco wrote: i need to get the following urls mapped onto a handler in httpd.conf / /index /index.* Option 1: Location ~ ^/(index(\..*)?)?$ SetHandler perl-script

Re: can PerlTransHandler deal with this?

2006-05-11 Thread John ORourke
Fayland Lam wrote: let me describe my situation. we have something like http://o1.example.com/1.jpg and we have a table like: 1.jpg | o1 and now we want the people visit this by http://o.example.com/1.jpg yes, o1,o2,o3 are different servers. I'd like to config the o.example.com like

performance/use of push_handlers over static config

2006-04-02 Thread John ORourke
Hi folks, I'm looking to improve a pretty large mod_perl app I have, which currently uses statically configured method handlers like so: httpd.conf: PerlModule My::Module (creates an instance of itself as $My::Module::Persistent ) PerlAccessHandler

Re: A question for the newbies

2006-02-16 Thread John ORourke
Well I'm more of an old-bie, but I've heard quite a few people recently (first hand) acknowledging that PHP (specifically) isn't really a 'serious' contender for enterprise web apps. (no flames please, I have no opinions!) I've also noticed my favourite news site* defining 'LAMP' as Linux,

  1   2   >