PerlOptions +Parent

2010-02-01 Thread Carl Johnstone
Suggestion for a wishlist feature. I've got around 20 different sites, each of which is configured as it's own VirtualHost. Now from time to time I run a different newer version of our app on some of the VirtualHosts, whilst leaving others running the original code base. Following some discuss

Re: mod-perl child process

2009-11-23 Thread Carl Johnstone
Kulasekaran, Raja wrote: > The below method used to kill the child process after the successful > execution of web request. > > $r->child_terminate(); > > Can anyone suggest me where and how do I call this method in the > httpd.conf file. You don't, you put it in your application code. However yo

Re: Which is best compression for Apache 2.2.9/Mod_perl 2.0.4

2009-07-30 Thread Carl Johnstone
Perrin Harkins wrote: > On Sat, Jul 25, 2009 at 4:41 AM, Shibi NS wrote: >> Which is best compression for Apache 2.2.9/Mod_perl 2.0.4 >> application - mod_gzip or mod_deflate ? . Have any idea of recent >> comparisons. > > mod_deflate replaced mod_gzip for apache 2. And both use the same compressi

Re: Profiling live mod_perl backends

2009-03-30 Thread Carl Johnstone
Cosimo Streppone wrote: However, some bad problems start to be evident only with really high req/s rate. Another possibility is that once you hit full load you're just pushing the server over the edge for what it can manage load-wise. Use your normal OS monitoring tools and ensure that you've

Re: decline and fall of modperl?

2009-03-25 Thread Carl Johnstone
Perrin Harkins wrote: > TicketMaster is Perl. Ticketmaster switched their UK operation from MS technologies to mod_perl a couple of years back too. (Brought it inline with the US side.) There's a couple of biggies that haven't been mentioned... BBC YouPorn (although I don't think they use mod_p

Re: Deployment strategies...

2009-03-13 Thread Carl Johnstone
Perrin Harkins wrote: On Fri, Feb 27, 2009 at 3:06 PM, Mark Hedges wrote: What about PerlOptions +Parent? http://perl.apache.org/docs/2.0/user/config/config.html#C_Parent_ That's the thing I was referring to that I haven't tried. Can anyone confirm that this works? I can now. Afte

Re: Deployment strategies...

2009-02-27 Thread Carl Johnstone
Perrin Harkins wrote: > different FastCGI backend because it would waste memory, so either way > you'll want to group things together as much as possible. Yeah, that confirms my thinking. > I've heard people say that DBIx::Class has a slow startup, > so if you use that you might look there first.

Re: Deployment strategies...

2009-02-27 Thread Carl Johnstone
Perrin Harkins wrote: > You can't run two modules with the same name in the same perl > interpreter, so you either need to change the namespaces for > different versions or run separate servers. Yeah it's a pity that the perchild mpm never moved out of experimental. In theory something like loadi

Deployment strategies...

2009-02-26 Thread Carl Johnstone
Get a fairly typical mod-perl setup. We have two load-balanced servers acting as front-end. They run threaded apache configured for lots of connections and KeepAlive on. They serve up as much stuff statically as possible, everything else is sent through mod_proxy_balancer to a number of backend

Re: Reducing memory usage using fewer cgi programs

2008-10-29 Thread Carl Johnstone
I am not that far, yet. I am doing all my development work under Windows and only for production I will use Linux (or Solaris if it needs bigger iron). Something to bear in mind then is that apache on Windows is (usually) multi-threaded rather than multi-process. So a lot of the discussion in t

Re: Reducing memory usage using fewer cgi programs

2008-10-29 Thread Carl Johnstone
I won't try to speak for Michael, but technically that memory does not become available for reuse by Perl, even if they are lexical variables and they go out of scope, unless you explicitly undef the variables. Perl keeps the memory for them allocated as a performance optimization. That was the

Re: Reducing memory usage using fewer cgi programs

2008-10-24 Thread Carl Johnstone
I was referring to script initialization (responding to that first request) and not the httpd daemon startup. Really, the only "startup" that should be slower is when the whole httpd service is restarted (such as at server startup) since it would have to preload all modules for all standby da

Re: Reducing memory usage using fewer cgi programs

2008-10-20 Thread Carl Johnstone
I also use a PerlRequire startup.pl to preload most modules (CGI, DBI), but I thought that was only for quicker startup times and not for sharing memory. Is that correct? Preloading helps with speed (you don't get the the initial loading hit for a module the first time it's used in a specific

Re: secure media files without http_referer

2008-07-07 Thread Carl Johnstone
On Wed, Jul 2, 2008 at 3:18 PM, tmpusr889 <[EMAIL PROTECTED]> wrote: A cookie would certainly work, but I was trying to find something simpler. I don't know much about URL tokens. How would something like that work? Redirect them to a URL with ?auth=x in it. Check the token with an access or

RHEL5 & mod_perl

2008-03-11 Thread Carl Johnstone
Hi, Anybody got any experiences of mod_perl on RHEL5? The rpms in RHN suggest versions of: mod-perl 2.0.2 apache 2.2.3 perl 5.8.8 which are reasonable enough (and it's not the pre-release mp2 problem that RHEL4 had!) However in the past there have been plenty of posts suggesting that Redhat

Re: loading Apache2::ServerRec

2008-01-14 Thread Carl Johnstone
Using the debian-stable-provided version of mod_perl, I've got an app that's working fine however the way it was configured meant we were causing an early load of perl during the configuration phase of apache. Just curious -- why are you trying to avoid loading perl during this phase? Faster

loading Apache2::ServerRec

2008-01-10 Thread Carl Johnstone
Using the debian-stable-provided version of mod_perl, I've got an app that's working fine however the way it was configured meant we were causing an early load of perl during the configuration phase of apache. I fixed the apache config so that mod_perl was loaded post-config then started getting

Re: mod_auth_tkt [was: 32 & 64 bit memory differences]

2007-11-06 Thread Carl Johnstone
Michael Peters wrote: mod_auth_tkt. You can set the authorization ticket with mod_perl and then just let mod_auth_tkt handle it on the non-mod_perl apache. It's extremely light weight and really fast. Got this on my "to implement soon" list - any tips/caveats? Carl

Re: 32 & 64 bit memory differences

2007-11-06 Thread Carl Johnstone
Gary Sewell wrote: I am interested in the reverse proxy idea. We currently also run a static image/js/css server and a static php server that runs the static pages we are able to crate which is very few, 99% of our pages are dynamic and change every second. Due to the bulk of our code (100Mb @ 32

Re: mod_perl, worker mpm and memory use optimisation

2007-11-05 Thread Carl Johnstone
I now want to bring down the process size and/or increased shared memory, and I wondered if anyone knows if it's possible to write perl in a way that maximises shared memory - eg. can I somehow ensure my data structures are all together and not sharing memory pages with compiled code? General

Re: dev environment

2007-11-05 Thread Carl Johnstone
On 11/5/07, Jeff Armstrong <[EMAIL PROTECTED]> wrote: Or even make yourself a virtual PC using MS Virtual PC and install a Linux / Apache / Modperl / Samba / MySQL / SVN etc into it (e.g. Debian is easy, or whatever you need for your prod). Sorry replied elsewhere - missed the change in subje

Re: 32 & 64 bit memory differences

2007-11-05 Thread Carl Johnstone
I'd recommend using apache for windows with mod_proxy because it's more mature. Another vote for apache as a proxy, using mod_proxy_balancer in apache 2.2 to proxy to multiple mod_perl backends. I wouldn't recommend doing dev on windows for a linux environment. Dual boot your machine with Ub

Re: mod_perl MVC framework.

2007-10-30 Thread Carl Johnstone
TAL does have a downside- as do all the other templating languages - they've all alllowed feature creep to turn them into micro-languages or processing languages. I wouldn't necessarily say that's a bad thing - sometimes the view does have to be more complicated, and if your templating langua

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

2007-10-08 Thread Carl Johnstone
Looks like somebody has managed to subscribe one of the PayPal support email addresses to the list... Carl - Original Message - From: "PayPal Customer Service 1" <[EMAIL PROTECTED]> To: "Carl Johnstone" <[EMAIL PROTECTED]> Sent: Saturday, Octo

Re: mod_perl success stories on ZDNet

2007-10-01 Thread Carl Johnstone
My Google alert sent this to me today: http://whitepapers.zdnet.com/abstract.aspx?docid=257555 Is it me, or does that just link through to here: http://www.oreillynet.com/digitalmedia/blog/2002/05/perl_success_story_termiumplus.html which doesn't require registration? Carl

Re: X_FORWARDED_FOR original IP

2007-08-03 Thread Carl Johnstone
No.Here both PHP and CGI scripts can get the X_FORWARDED_FOR ip,but modperl can't.Is the %ENV hash not useful under modperl? mod_perl is not CGI. With mod_perl your perl interpreter is part of the apache process itself. So making apache set up the environment is a waste of time, you can just a

reverse proxy/logging problem

2007-08-02 Thread Carl Johnstone
Hi, I've got a two-apache reverse proxy setup, split over two hosts. The problem I've got is that I'd like to put the user_id in the access logs so that our log analysis software can make use of it. Setting apache->user correctly logs the user at the back-end however the IP addresses are wro

Re: apache mailing list

2007-06-01 Thread Carl Johnstone
I am trying to enable the apache module mod_speling on apache 1.3.27 I enable it find but it doesn't seem to support the CheckCaseOnly Apache directive. Dunno about a list, but your problem is that directive was only added in Apache 2.2 The docs for apache 1.3 are here: http://httpd.apach

Re: Global question

2007-05-07 Thread Carl Johnstone
You can use shared memory between apache processes. Check: *Apache::SharedMem* *Tie::ShareLite* *Cache::SharedMemoryCache*

Re: httpd.conf problem

2007-05-02 Thread Carl Johnstone
Tyler Bird wrote: but I am also trying to allow .htaccess in sub directories AllowOverride All This is the mod_perl rather than apache mailing list :-) But are you getting confused between and for a start? It should be - checking the 2.2 docs you can only use the directive within

Re: Logging With Mod Perl 2.0

2007-04-26 Thread Carl Johnstone
Tyler Bird wrote: But I was wondering isn't there anything I can do to mod_perl that will allow a plain warn to send it to my virtualhosts log and not my servers log. without using the $r->warn() syntax warn("hey") really goes t the virtual hosts log and I don't have to put $r->warn()

Re: Are RHEL 3.0 & mod_perl 2.0.x compatible?

2007-04-25 Thread Carl Johnstone
Jonathan Vanasco wrote: second: your issue seems to be that you're trying to run everything via rpms , which is causing your dependency issue. try compiling from source. if you use cpan to install modperl, it'll download all of the perl dependancies for you. You *may* be able to fin

Re: version checking

2007-04-25 Thread Carl Johnstone
RHEL5 is out and from memory it has a proper version of MP2 (somebody like to confirm whether you can just upgrade from 4 to 5?) To answer my own question - yes you can upgrade: http://www.redhat.com/rhel/moving/ although I don't know what the process is. RHEL5 comes with mod_perl 2.0.2, perl

Re: version checking

2007-04-25 Thread Carl Johnstone
I tried to the package manager to install mod_perl and it offers me mod_perl-1.99-16.4 I thought that Apache 2 required MP2. Am I mistaken? I am not sure what the best route to take is, even my httpd server version is a bit old. Do I throw out the httpd server and start from scratch, possibly con

Re: Growing Up

2007-04-25 Thread Carl Johnstone
There is a consideration, regarding using a proxy or a different server, that has not been brought up: If there is mod_perl based access control for the static files, then it's basically impossible not to go through a mod_perl server to serve them. If you're access control is in mod_perl, you ha

[job] mod_perl/Catalyst in Manchester, England

2007-04-05 Thread Carl Johnstone
Hi, I work for the Guardian Media Group in their regional division based in Manchester, England. We run the websites for the groups various regional interests - mainly newspapers, but we also have a local TV station Channel M. Our flagship title is the Manchester Evening News. We're currently lo

[mp2] apachectl configtest

2007-02-14 Thread Carl Johnstone
Hi, I'm moving to mod_perl2 and looking at the new startup where perl can be loaded either pre-config or postconfig. I've been trying both options. If I start perl pre-config, I'm getting output from the perl stuff to the screen as well as the error log. It's also fairly slow and runs even if

Re: Database transaction across multiple web requests

2006-03-31 Thread Carl Johnstone
Perrin Harkins wrote: I typically use a combination, retrieving all of the IDs in order in one shot and saving that in a cache, and then grabbing the details of the 10 records needed for the current page as I go. This is described somewhat here: http://perl.apache.org/docs/tutorials/apps/scale

Re: No image creation in mod_perl

2006-03-28 Thread Carl Johnstone
In (eg) the worker MPM, each process contains its own perl interpreter, so if each process handles one image once in its lifetime, there is a lot of memory that has been grabbed by perl which is not available to create more perl processes. ... is what makes sense to me but may be utterly meaningl

Re: syntax vs. style

2006-03-28 Thread Carl Johnstone
But having said that, I find Apache2::Reload very handy for easy and quick development. Me too! Although I find that occasionally I have to restart apache on the development box before it'll work correctly. Hence I wouldn't run it on a production server. Carl

Re: syntax vs. style

2006-03-27 Thread Carl Johnstone
Instead of using MP2 syntax, etc, we're still using: print "Content-type: $type\n\n"; print "blah"; and in sending redirects, we use stuff like: print "Location: $url\n\n"; Is this a problem or is it just bad style? What reasons are there to continue our port to use the correct r

Re: No image creation in mod_perl (was RE: Apache2/MP2 Segfaults ...)

2006-03-27 Thread Carl Johnstone
Can you fork off a separate process to do this (that will die once it is completed)? The only place where forking is useful is where you want something to continue processing after sending the response back to the client. You can achieve the same effective result by calling $r->child_terminate(

Re: [mp1] redirect in ErrorDocument

2006-03-23 Thread Carl Johnstone
> > Yet enabling "PerlSendHeader On" and doing: > > > > print "Location: $newurl\n\n"; > > > > works fine. > > What are the complete headers that sends? I'm guessing it sends a 200 > status and it only works because your browser is broken and follows the > redirect anyway. No, it does convert t

[mp1] redirect in ErrorDocument

2006-03-17 Thread Carl Johnstone
In an Apache::Registry ErrorDocument (e.g. ErrorDocument 404 /my404.pl ) This doesn't work: $r->header_out('Location', $newurl); $r->status(302); return OK; Apache returns an error saying that my 404 handler returned a 302 error. Does the same if I use err_header_out Yet enabling "Perl

Re: is there a way to force UTF-8 encoding

2006-03-04 Thread Carl Johnstone
> In fact I'm not actually getting *any* headers back: Checking your server ident you're running modperl 1. Sure you're calling $r->send_http_headers() ? Carl

Re: is there a way to force UTF-8 encoding

2006-03-04 Thread Carl Johnstone
> http://www.verizonnoticias.com/ Sure it validates on w3c? http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fwww.verizonnoticias.com%2FHome%2Findex.ad2 In fact I'm not actually getting *any* headers back: $ telnet www.verizonnoticias.com http Trying 69.88.132.175... Connected to www.v

Re: Make your next million Stas!

2006-02-13 Thread Carl Johnstone
Speaking of which, when will the mp2 version of Practical Mod Perl be coming out? I'm sure Stas will make a handsome lot (I would use 'bomb' but these are sensitive times...) when he releases it, cause we're all depending so much on the book... Are there any good mp2 books out in the wild yet

testing frameworks

2006-01-30 Thread Carl Johnstone
Hi, Been reading through this page: http://perl.apache.org/docs/general/testing/testing.html at the bottom of the page the "Puffin" testing framework is suggested, with a link to http://puffin.sourceforge.net/ this redirects to www.puffinhome.org which is a domain for sale page. There see

Re: Getting keep-alive sorted

2005-12-29 Thread Carl Johnstone
If so how do I do it? I looked at the mod_perl docs and found: Apache2::Response->set_keep_alive() The example: $ret = $r->set_keepalive(); That overrides the default KeepAlive setting for this particular request. Doesn't really make sense to me. I already have the following in my code: $r

Re: Need use modules in my code?

2005-12-21 Thread Carl Johnstone
#!/usr/bin/perl use Compress::Zlib; . print Compress::Zlib::memGzip($htmlstr); This one is best practise - and is a requirement when you want to import functions into your own scripts name space. Carl

Re: Apache::DBI + DBD::Multiplex

2005-11-24 Thread Carl Johnstone
> Thanks for the suggestion. It appears that DBD::Multiplex is mashing up > the ref address each time. Interesting its not mashing up the sub ref > address for mx_error_proc. I'll dig deaper into Multiplex and see why > its changing it. The subroutine will only be defined once at file load time so

Re: Apache::DBI + DBD::Multiplex

2005-11-24 Thread Carl Johnstone
> Philippe M. Chiasson wrote: > > 2 possible avenues to investigate: > > - Change your code to not use an array-ref as mx_dsns argument but some string (comma delimited, etc) > > - Look at changing Apache::DBI to not use the ref as part of the dsn cache key, but use the contents of the array > >

Re: A handler just for the / location

2005-10-14 Thread Carl Johnstone
Yes it also handles that path (no-path) I heard that some browsers use to add the "/" after the location if it doesn't end in "/", but I am not sure they do that because for example if I have an URL like: http://www.site.com/test then Internet Explorer doesn't add a "/" after it if /test locat

Re: mod_perl, shared memory and solaris

2005-09-20 Thread Carl Johnstone
Any advice on memory use on Solaris is appreciated < Take a look at: http://people.ee.ethz.ch/~oetiker/tobjour/2003-02-12-09-00-f-1.html There's some useful information, including a chunk covering what you're after. Specifically try: pmap -x PID the private/anon column shows the am

Re: Masquerading requests as HTTPS

2005-09-16 Thread Carl Johnstone
Can add my voice to the "BigIP should do this" school of thought. If it's effectively converting HTTPS into HTTP requests for you, then I would expect it should be able to rewrite redirects automatically for you too. Same way that apache does it in mod_proxy. However can I also point out tha

Re: Sth I don't understand about pnotes

2005-09-16 Thread Carl Johnstone
From: "Anthony Gardner" <[EMAIL PROTECTED]> Can s.o. explain what is wrong with the following code $r->pnotes('KEY' => push( @{ $ar }, $some_val ) ); It's a perl problem - not a mod_perl problem. push returns the new number of elements on the array. So in effect you're doing: $r->pnot

Re: catalyst/Debian (was Re: *nix distro compatibility)

2005-09-14 Thread Carl Johnstone
I'd like to have similar flexibility as to *nix distribution -- e.g. developed/ supported under one (likely, Debian 3.1; that's what I know best), and later tested/ supported under others (if the need arises and help is available). I'm hoping that Catalyst will facilitate this goal. There's s

Re: *nix distro compatibility (was Re: survey)

2005-08-30 Thread Carl Johnstone
> I think a great first-place to start for advocacy is to work with the > various linux/bsd/*nix distributions out there to make sure that they > have a modern, compatible version of mod_perl 2. As a user, I don't > want to maintain my own perl/mod_perl build tree - I want my distro to > do the ri

Re: [MP2] having trouble obtaining $r

2005-08-11 Thread Carl Johnstone
Message> I'm having trouble getting the request object from mod_perl. Here is the original attempt: < Have you simply tried: my $r = shift; at the beginning of your handler? If you're using Apache::Registry, then your whole file is a handler so you can do that at the top. Carl

Re: Docs error?

2005-04-26 Thread Carl Johnstone
OK, in which case it must be some relatively recent change, since an unescaped & in the QUERY_STRING was a valid separator. A pointer to the relevant RFC would be nice so we can add that to the URL that started this thread. Here? http://www.w3.org/TR/1999/REC-html401-19991224/appendix/notes.htm

Docs error?

2005-04-26 Thread Carl Johnstone
On: http://perl.apache.org/docs/tutorials/client/browserbugs/browserbugs.html It talks about browsers misreading URLs like: http://example.com/foo.pl?foo=barĀ®=foobar Presuming this is within a HTML page e.g.: http://example.com/foo.pl?foo=barĀ®=foobar";> ... then the actual problem is that the & has

Re: how to take out the default charset append?

2005-04-22 Thread Carl Johnstone
Please help me with one more related question: if I am to simply use $r->content_type('text/html'), the final render to the client comes with ';charset=8859-1' appended to the header. Is this the result of Apache, or mod_perl? Is there any way I can just render Content-Type: text/html without a

Re: RC5 really broke some stuff

2005-04-22 Thread Carl Johnstone
People like Jonathan and myself just have to double up (or triple-up!) because of the change. Try telling that to your bosses that the latest version of modperl is holding things back ('told you we should've used Java!'). Did your boss know that the "latest" version of mod_perl is actually a pr

Re: Apache-DBI

2005-04-18 Thread Carl Johnstone
From what I understand, Apache::DBI provides certain performance benefits over DBI in much the same manner that mod_perl does over standalone Perl, but isn't required to use DBI in a mod_perl environment. Essentially it makes your database connections persistent. So when you establish a connectio

Re: Question about Files directive

2005-03-02 Thread Carl Johnstone
> Chuck, use Apache::Reload and you won't have to restart the server. > http://modperlbook.org/html/ch06_08.html Although on a production server that's dealing with many thousands of requests, that could be an awful lot of checks to see if modules have been updated. Personally I prefer a bit of s

Re: Question about Files directive

2005-03-02 Thread Carl Johnstone
CCing it back onto the list... > Now if I do not want all to specify all cgi scripts (*.cgi) to be handled by the handler precisely to avoid pitfalls and only specify some files to be used, then how do I do that via the Files directive. < There's a couple of different approaches. The fir

Re: Question about Files directive

2005-03-02 Thread Carl Johnstone
Hi, To explain exactly what is going on... The "Files" directive is an *apache* not mod_perl directive. You can use it within apache to define specific rules for a file (or bunch of files). The "SetHandler" directive is also an apache directive, that tells apache what hander should be used. So

Re: Protecting perl-status by IP on a backend server

2005-02-27 Thread Carl Johnstone
> > SetHandler server-status > Order deny,allow > Deny from all > Allow from env=admin_ip > > > I still get > > [client 127.0.0.1] client denied by server configuration Put the access rules in the front-end (non-mod_perl) apache rather than the back-end. Carl

Re: [mp1] Apache::Cookie(?) Seg Fault

2005-02-25 Thread Carl Johnstone
OK; I'm just guessing at this point, so you may need to track this bug down yourself. I'll do what I can - long time since I wrote any C though. #2 0xfe1d5a40 in ApacheCookie_new (r=0x1380960) at apache_cookie.c:79 #3 0xfe1d3550 in XS_Apache__Cookie_parse (cv=0xe7cce4) at Cookie.xs:208 #4 0x001

Re: [mp1] Apache::Cookie(?) Seg Fault

2005-02-25 Thread Carl Johnstone
Out of curiosity, what does `perl -V` say? Summary of my perl5 (revision 5.0 version 8 subversion 3) configuration: Platform: osname=solaris, osvers=2.8, archname=sun4-solaris uname='sunos g-web1 5.8 generic_108528-19 sun4u sparc sunw,ultra-4 solaris ' config_args='-ds -e -DDEBUGGING -D

Re: [mp1] Apache::Cookie(?) Seg Fault

2005-02-25 Thread Carl Johnstone
I'm using gcc 3.3.2. Will leave a build of gcc 3.4.3 running overnight and try rebuilding apache with that sometime tomorrow. Actually realised this morning that one of our others servers is doing the same. Same versions of apache etc, this time on Solaris 9 built with gcc 2.95.3. That isolates

Re: [mp1] Apache::Cookie(?) Seg Fault

2005-02-24 Thread Carl Johnstone
This looks like a va_* related bug to me. None of the va_* arguments would seem to be used before we hit the fault. The arg list to ApacheCookie_new() must be NULL-terminated, and between the r and NULL there must be an even number of arguments. The call to ApacheCookie_new() in XS_Apache__Cookie_p

Re: Apache::Clean worthwhile in addition to mod_gzip ?

2005-02-24 Thread Carl Johnstone
If you are already using a compression tool like mod_gzip, does it tend to be worthwhile to add an Apache::Clean phase as well? I'm curious to know if other Apache::Clean users have felt there was significant benefit or a noticeably performance penalty. It would same the bandwidth is more of an i

[mp1] Apache::Cookie(?) Seg Fault

2005-02-24 Thread Carl Johnstone
Getting an occasional Segfault which I've traced back to this line in a FixupHandler: my %cookies = Apache::Cookie->fetch; I'm running Apache/1.3.31 with mod_perl/1.29 on Solaris 8. Looking at the gdb trace, is the request pool becoming corrupt somewhere between ApacheCookie_new and ap_make_arr