cvs commit: modperl-2.0/t/apache scanhdrs2.t
stas2003/01/10 23:41:04 Modified:t/apache scanhdrs2.t Log: t_cmp's args are (expected, received, comment) not (received, expected, comment) (the debug info was confusing otherwise) Revision ChangesPath 1.2 +3 -3 modperl-2.0/t/apache/scanhdrs2.t Index: scanhdrs2.t === RCS file: /home/cvs/modperl-2.0/t/apache/scanhdrs2.t,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- scanhdrs2.t 29 Jun 2002 20:39:22 - 1.1 +++ scanhdrs2.t 11 Jan 2003 07:41:04 - 1.2 @@ -14,10 +14,10 @@ my $res = GET $location?$redirect, redirect_ok = 0; -ok t_cmp($res-header('Location'), $redirect, +ok t_cmp($redirect, $res-header('Location'), Location header); -ok t_cmp($res-code, 302, +ok t_cmp(302, $res-code, status == 302); $redirect = '/index.html'; @@ -27,7 +27,7 @@ ok t_cmp(1, !$res-header('Location'), no Location header); -ok t_cmp($res-code, 200, +ok t_cmp(200, $res-code, status == 200); ok t_cmp(qr{welcome to}, $res-content,
Re: OSCON ideas - missing proceedings
Nathan == Nathan Torkington [EMAIL PROTECTED] writes: Nathan Not for two years at least (the duration of the contract with the Nathan Portland hotel). The San Diego hotel was much more expensive and Nathan remote, compared to the Portland hotel. I think people are really Nathan going to enjoy being in the middle of a city at this year's OSCON. Yes... the number of things that are within walking distance of the hotel is rather nice. The waterfront park should be rather spectacular, especially at night when the 14 bridges across the Willamette are lit up in their own unique ways. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 [EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/ Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
Unregister streamed output filters
Hello all, is there a way to unregister a streamed filter? I have seen this in many (all?) apache (C programmed) filters; they are able of declining the filtering of a certain stream, for example, when they do not know how to handle a certain content type. In the apache api this is done with ap_remove_output_filter(f). Is there something similar in mp2? Thanks in advance!! E s t eb a n! :wq
Re: development techniques
Do you develop with an xterm tailing the logs, an emacs window (or other editor) to edit the script and/or the packages (and on some occassions httpd.conf), and a web browser (on an alternate virtual desktop)? Do you pepper code with : print option: . $option{$foo . br if $debug; Fairly low tech, huh. HI Jim, I do this all the time ... but have tried to extend the tracing technique. I use a Tracer object that: * captures a small amount of meta-info like the caller() * prints out an object's internal state - all objects inherit a toString() method which prints out a DataDumper-like snapshot This is during development ... when something moves to production I try *not* to use traditional logging ... mainly because bugs can be missed, and I can't rely on trawling through the logs to find a bug, instead - all major Exceptions turn into an email which is seen by at least two people. This means bugs don't go undetected for long - the idea is, the more a bug is 'seen/tangible' the better the chance of stopping it (http://london.pm.org/tech_talks/21_nov_2002/nigel/). Finally for testing during development each major object has a test script. For example: testwebbrowser.pl - WebBrowser.pm testtrawler.pl - Trawler.pm The script acts as a test harness for the Object. This has reduced the amount of time spent looking for bugs. The 'test first' methodology, borrowed from XP, seems to be working - the next step will be to put the individual test scripts into a Unit testing framework (e.g., Junit) and run a daily battery of tests ... NIge -- Nigel Hamilton Turbo10 Metasearch Engine email: [EMAIL PROTECTED] tel:+44 (0) 207 987 5460 fax:+44 (0) 207 987 5468 http://turbo10.com Search Deeper. Browse Faster.
Re: OSCON ideas - missing proceedings
Randal L. Schwartz wrote: Nathan == Nathan Torkington [EMAIL PROTECTED] writes: Nathan Not for two years at least (the duration of the contract with the Nathan Portland hotel). The San Diego hotel was much more expensive and Nathan remote, compared to the Portland hotel. I think people are really Nathan going to enjoy being in the middle of a city at this year's OSCON. Yes... the number of things that are within walking distance of the hotel is rather nice. The waterfront park should be rather spectacular, especially at night when the 14 bridges across the Willamette are lit up in their own unique ways. I agree. No matter what, speaking as someone who hasn't travelled around America all that much, I think it's fun to know that the OSCon is in different places every couple of years and to get exposed to those places. Also, speaking as someone who earns money in a non-US currency, having a less expensive place to stay at is much nicer. I am sure the self-employed in the US also feel similarly... (ie anyone who doesn't have a company paying for it...and isn't a shareholder of that company). Later, Gunther
Re: OSCON ideas - MVC talk
On Thu, Jan 09, 2003 at 09:22:35AM -0700, Rob Nagler wrote: So how about a panel discussion. I would gladly represent the MVC camp. :-) (see http://www.bivio.biz/hm/why-bOP for my position.) And I would gladly represent the MVC-is-not-the-final-word camp :-) A
RE: OSCON ideas - missing proceedings
On Thu, 9 Jan 2003, Nathan Torkington wrote: Mark Schoonover writes: Any chance they will bring it back to San Diego?? :) Not for two years at least (the duration of the contract with the Portland hotel). The San Diego hotel was much more expensive and remote, compared to the Portland hotel. I think people are really going to enjoy being in the middle of a city at this year's OSCON. Hallelujah to that, brother! San Diego was gorgeous, and the hotel was nice, but I didn't rent a car, and just doing stuff like getting to the city for lunch (on the days when lunch wasn't served) was a giant PITA, compounded by the fact that I'm vegan, so I can't go just anywhere and be guaranteed that they'll have something I'd want. And a less-expensive place is also a good thing. The San Diego Sheraton was _expensive_, and since I'll be footing the bill (hopefully only partially if I can get a tutorial accepted ;) cheaper is good! -dave /*=== House Absolute Consulting www.houseabsolute.com ===*/
Problem combining mod_proxy, mod_rewrite mod_perl
G'day! I would like to combine mod_proxy, mod_rewrite and mod_perl on an Apache 2.0.43 for Windows with mod_perl 2.0. The Perl Version I use is ActiveState 5.6.1. Just by loading the module the server behaves differently. Instead seeing the the reverse proxied site I get following error in the browser: - Proxy Error The proxy server received an invalid response from an upstream server. The proxy server could not handle the request GET /directx1/directx1/directx1/directx1/directx1/directx1/directx1/directx1/directx1/directx1/directx1/. Reason: Max-Forwards has reached zero - proxy loop? - It seems as if the rewrite rules are applied in a recursive loop. The rewrite.log does support this. Any ideas why this is happening and how can I get the config running again. Regards Jan -- The rewrite log does look like this: sid#4ade80][rid#484888/initial] (2) init rewrite engine with requested uri / sid#4ade80][rid#484888/initial] (3) applying pattern '^/(.*)' to uri '/' sid#4ade80][rid#484888/initial] (2) rewrite / - /directx/ sid#4ade80][rid#484888/initial] (2) forcing proxy-throughput with http://192.168.X.X/directx/ sid#4ade80][rid#484888/initial] (1) go-ahead with proxy request proxy:http://192.168.X.X/directx/ [OK] sid#4ade80][rid#48a8a0/initial] (2) init rewrite engine with requested uri /directx/ sid#4ade80][rid#48a8a0/initial] (3) applying pattern '^/(.*)' to uri '/directx/' sid#4ade80][rid#48a8a0/initial] (2) rewrite /directx/ - /directx/directx/ sid#4ade80][rid#48a8a0/initial] (2) forcing proxy-throughput with http://192.168.X.X/directx/directx/ sid#4ade80][rid#48a8a0/initial] (1) go-ahead with proxy request proxy:http://192.168.X.X/directx/directx/ [OK] ... { Shortend } - I have following httpd.conf (shortend): LoadFile C:/Perl/bin/perl56.dll LoadModule access_module modules/mod_access.so LoadModule actions_module modules/mod_actions.so LoadModule alias_module modules/mod_alias.so LoadModule asis_module modules/mod_asis.so LoadModule auth_module modules/mod_auth.so LoadModule autoindex_module modules/mod_autoindex.so LoadModule cgi_module modules/mod_cgi.so LoadModule dir_module modules/mod_dir.so LoadModule env_module modules/mod_env.so LoadModule imap_module modules/mod_imap.so LoadModule include_module modules/mod_include.so LoadModule isapi_module modules/mod_isapi.so LoadModule log_config_module modules/mod_log_config.so LoadModule mime_module modules/mod_mime.so LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_connect_module modules/mod_proxy_connect.so LoadModule proxy_http_module modules/mod_proxy_http.so LoadModule negotiation_module modules/mod_negotiation.so LoadModule rewrite_module modules/mod_rewrite.so LoadModule setenvif_module modules/mod_setenvif.so LoadModule userdir_module modules/mod_userdir.so LoadModule ssl_module modules/mod_ssl.so LoadModule perl_module modules/mod_perl.so VirtualHost 1192.168.X.X:81 ServerName foo.bar DocumentRoot /htdocs_rp RewriteEngine On RewriteLog logs/rewrite.log RewriteLogLevel 9 RewriteRule ^/inject$ /tap1/inject.html [P] RewriteRule ^/(.*) /directx1/$1 [P] ProxyPass /tap1/ http://127.0.0.1/ ProxyPassReverse / http://127.0.0.1/ ProxyPass /directx1/ http://acm.org/ ProxyPassReverse / http://acm.org/ /VirtualHost
Re: [mod_perl] Re: OSCON ideas
Matt Sergeant wrote: I've done a lot on bayes for spam (I had an effective bayesian filter before Paul Graham wrote his article on the subject), but there's not much in it for a full talk. Maybe a lightning talk. Hmm... That would be great Matt. Funny how Paul Graham has become so synonymous with Bayesian probabilities isn't it? Your work preceeds his, Google Page Rank apparently uses Bayesians (pre-Graham) and, here in the UK, Autonomy (http://www.autonomy.com/) have been doing ground-breaking work for a few years now with Bayesians at the core of their technology. Despite this, Paul Graham is the first person people think of when you start to talk Bayesians, I wonder why? -- Jonathan M. Hollin Technical Director: Digital-Word Co. (http://digital-word.com/) Co-ordinator: WYPUG (http://wypug.pm.org/)
Re: development techniques
On Thu, 9 Jan 2003, Jim Martinez wrote: Is there some way to improve this cycle : edit code - refresh browser - possibly look at the error log - edit code - ... No one seems to have mentioned WWW::Mechanize (or if they have I've missed it.) It's a simple module that allows you to interact with LWP like it's a web browser (i.e. click on that link, enter these values into the form, etc) abstracting away the actual parsing of the HTML. Links: http://www.perladvent.org/2002/16th/ http://search.cpan.org/author/PETDANCE/WWW-Mechanize/lib/WWW/Mechanize.pm It's quite easy to integrate this with a test suite. You can start doing things like: #!/usr/bin/perl # turn on the safety features use strict; use warnings; # declare three tests use Test::More tests = 3; # create a new web browser use WWW::Mechanize; my $browser = WWW::Mechanize-new(); # see if we can get the front page of search.cpan.org $browser-get(http://search.cpan.org/;); ok($browser-{res}-is_success, search.cpan.org); # see if we can get a search page back $browser-form(1); $browser-field(query,Acme::Buffy); $browser-click(); ok($browser-{res}-is_success, module listing back); # something that will fail $browser-get(http://2shortplanks.com/nosuchurl;); ok($browser-{res}-is_success, no such url); This prints out: 1..3 ok 1 - search.cpan.org ok 2 - module listing back not ok 3 - no such url # Failed test (test.pl at line 26) # Looks like you failed 1 tests of 3. Hope that helps. Mark. -- #!/usr/bin/perl -T use strict; use warnings; print q{Mark Fowler, [EMAIL PROTECTED], http://twoshortplanks.com/};
Shared memory 'copy-on-write' issue
Hi all, reading http://perl.apache.org/docs/1.0/api/Apache/SizeLimit.html#Shared_Memory_Opti ons i am seeing that link about memory sharing by copy-on-write points to http://perl.apache.org/docs/1.0/guide/index.html and 'META: change link when site is live' stands after it. Site is alive, how knows where should this link point to? Thanks, Anton Permaykov.
Re: OSCON ideas - more talk ideas
Let's forgive them, hopefully they know better what they are doing... ;-) Fortunately for us, I'm still here (I mean on mod_perl mailing list) to answer any of your practical questions concerning Apache::Dynagzip implementation. Regards, Slava HI Slava, Good to hear you're still here ... it's a bummer they didn't accept your proposal ... I'm sure others would find it very interesting. I'm planning on using Apache::Dynagzip soon after our next release so I'll report back to the list then. Nige Hi Nigel, OSCON is so far away from the Web Content Compression features. They discarded my proposal to talk about Effective Content Delivery over the Web. You know, O'Reilly itself delivers uncompressed web content to date (indeed, they have mod_gzip and mod_perl installed on Apache): C05 -- S06 GET / HTTP/1.1 C05 -- S06 Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/msword, */* C05 -- S06 Referer: http://users.outlook.net/~sbizyaye/cgi-bin/pp-slav.cgi/index.html C05 -- S06 Accept-Language: en-us C05 -- S06 Accept-Encoding: gzip, deflate C05 -- S06 User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows 98) C05 -- S06 Host: www.perl.com C05 -- S06 Accept-Charset: ISO-8859-1 == Body was 0 bytes == C05 -- S06 HTTP/1.1 200 OK C05 -- S06 Date: Fri, 10 Jan 2003 02:04:44 GMT C05 -- S06 Server: Apache/1.3.26 (Unix) PHP/4.2.1 mod_gzip/1.3.19.1a mod_perl/1.27 C05 -- S06 P3P: policyref=http://www.oreillynet.com/w3c/p3p.xml,CP=CAO DSP COR CURa ADMa DEVa TAIa PSAa PSDa IVAa IVDa CONo OUR DELa PUBi OTRa IND PHY ONL UNI PUR COM NAV INT DEM CNT STA PRE C05 -- S06 Content-Type: text/html; charset=ISO-8859-1 C05 -- S06 X-Cache: MISS from www.perl.com C05 -- S06 Transfer-Encoding: chunked C05 -- S06 == Incoming Body was 41869 bytes == == real URL = http://www.perl.com/ == == Transmission: text chunked == == Latency = 0.330 seconds, Extra Delay = 1.480 seconds == Restored Body was 41731 bytes == - Original Message - From: Nigel Hamilton [EMAIL PROTECTED] To: mod_perl list [EMAIL PROTECTED] Sent: Thursday, January 09, 2003 11:55 AM Subject: Re: OSCON ideas - more talk ideas HI, I'd really like to see talks on: 1. Web Server Compression - a comparison, between mod_gzip, DynaGzip Compress etc, pros / cons, SSL compression, and example configurations 2. Application Server Options - a comparison between pure-perl, Apache/mod_perl, POE, SpeedyCGI etc Nige -- Nigel Hamilton Turbo10 Metasearch Engine email: [EMAIL PROTECTED] tel: +44 (0) 207 987 5460 fax: +44 (0) 207 987 5468 http://turbo10.com Search Deeper. Browse Faster. -- Nigel Hamilton Turbo10 Metasearch Engine email: [EMAIL PROTECTED] tel:+44 (0) 207 987 5460 fax:+44 (0) 207 987 5468 http://turbo10.com Search Deeper. Browse Faster.
Re: [mod_perl] Re: OSCON ideas
On Fri, 10 Jan 2003, Jonathan M. Hollin wrote: Matt Sergeant wrote: I've done a lot on bayes for spam (I had an effective bayesian filter before Paul Graham wrote his article on the subject), but there's not much in it for a full talk. Maybe a lightning talk. Hmm... That would be great Matt. Funny how Paul Graham has become so synonymous with Bayesian probabilities isn't it? Your work preceeds his, Google Page Rank apparently uses Bayesians (pre-Graham) and, here in the UK, Autonomy (http://www.autonomy.com/) have been doing ground-breaking work for a few years now with Bayesians at the core of their technology. Despite this, Paul Graham is the first person people think of when you start to talk Bayesians, I wonder why? To be fair to Paul Graham, what he did was put it in a language that was accessible to geeks. Every single paper or book or whatever I've read on Bayesian probabilities talks in maths gobledegook (although I'm sure Ken Williams may disagree ;-). Paul Graham made it easy for the layman to grok and implement. A bayes lightning talk might be fun though. -- !-- Matt -- :-get a SMart net/:- Spam trap - do not mail: [EMAIL PROTECTED]
Re: Shared memory 'copy-on-write' issue
Anton Permyakov wrote: reading http://perl.apache.org/docs/1.0/api/Apache/SizeLimit.html#Shared_Memory_Opti ons i am seeing that link about memory sharing by copy-on-write points to http://perl.apache.org/docs/1.0/guide/index.html and 'META: change link when site is live' stands after it. Site is alive, how knows where should this link point to? It does go the guide correctly, but a more specific link would be this: http://perl.apache.org/docs/1.0/guide/performance.html#Sharing_Memory - Perrin
Re: mod_perl invokation valid?
Thanks for your quick response. I was informed that we were not running mod Perl, but at the same time the env hash indicated we were, so I really was not clear. Sorry. So, I'll try and clarify my question. We would like to take advantage of caching with PERL, and make use of the DBI packages as well. It would seem that there is duplicity that needs to be resolved here. The env hash for apache indicates we're running Perl ver 5.00503. I installed ver 5.8 to get the DBI stuff working. The mod_perl is part of the apache configuration that was there when I came on board. It would seem to me that we need to upgrade the apache/Perl relationship so that the env hash and programs recognize Perl 5.8. Question: Do I need to recompile anything, or are there just a couple httpd vars that I could change so that we can cache Perl 5.8? I've got some other apps that use CGI and HTTP modules associated with perl 5.00503. They don't appear to work with PERL 5.8 as configured on my machine. I'd like to get these working with PERL 5.8 as well. Another related question: Just to understand part of your response. Looks like I'm already ok with current versions of apache and mod_perl at 1.3.19 and 1.25? How are things in grand old England? Thanks, Charlie reference original question: From: Charlie Smith To: [EMAIL PROTECTED] Date: 1/6/2003 8:41 AM Subject: mod_perl invokation valid? CC: [EMAIL PROTECTED] I'm a newbee at this, so please have patience. Question: Even though I have PERL 5.8 installed, we wish to get mod_perl installed to make use of caching. Currently, a listing of the %ENV hash indicates that we're running mod_perl/1.25. PERL 5.8 is also listed out in the PERL5LIB env variable in httpd.conf. Is it correct assume we'll see a speed up after upgrading mod_perl?IF not, what else might need to be done to acheive a performance improvement with caching PERL. My configuration includes: GCC 2.95, PERL 5.8, DBI 1.3 and DBD::Oracle 1.12, Oracle 9.0.1 SunOS 5.8 Generic 108528-12 sun4u sparc SUNW, Ultra-80, Apache 1.3.19 mod_perl/1.25 Thanks, Charlie 1/6/02 "Ged Haywood" [EMAIL PROTECTED] 01/06/03 09:32AM Hi there,On Mon, 6 Jan 2003, Charlie Smith wrote:[snip,snip] assume we'll see a speed up after upgrading mod_perl?Your question is not clear. It depends on what you're doing with it.If you're already using mod_perl then simply upgrading it won't giveyou a substantial performance improvement.Read the mod_perl Guide, you'll find it at the mod_perl home pagehttp://perl.apache.org and it tells you a lot about performancetuning and other useful stuff. My configuration includes: GCC 2.95, PERL 5.8, DBI 1.3 and DBD::Oracle 1.12, Oracle 9.0.1SunOS 5.8 Generic 108528-12 sun4u sparc SUNW, Ultra-80, Apache 1.3.19 mod_perl/1.25You should upgrade to the latest versions of Apache and mod_perl(versions 1.3.x and 1.2x, not mod_perl 1.99 which is really 2.0x:)There have been problems now and again with SunOS but don't letme worry you about that, it might not happen.73,Ged. -- This message may contain confidential information, and is intended only for the use of the individual(s) to whom it is addressed. ==
[OT] Re: [mod_perl] Re: mod_perl invokation valid?
Charlie Smith wrote: snip How are things in grand old England? Well our country's gone to the dogs, our government is corrupt and ineffective and it's bloody cold at the moment too. But the sun is shining so a true Englishman won't complain. ;-) -- Jonathan M. Hollin Technical Director: Digital-Word Co. (http://digital-word.com/) Co-ordinator: WYPUG (http://wypug.pm.org/)
Re: mod_perl invokation valid?
Hi Charlie, On Fri, 10 Jan 2003, Charlie Smith wrote: Thanks for your quick response. I was informed that we were not running mod Perl, but at the same time the env hash indicated we were, Read the Guide, it has a section specifically addressing this issue. So, I'll try and clarify my question. We would like to take advantage of caching with PERL, and make use of the DBI packages as well. It would seem that there is duplicity that needs to be resolved here. The env hash for apache indicates we're running Perl ver 5.00503. I installed ver 5.8 to get the DBI stuff working. That probably wasn't necessary unless there's a 5.8 dependency in the particular modules you're using - I still routinely use DBI with Perl 5.00503 and MySQL in live servers. The mod_perl is part of the apache configuration that was there when I came on board. It would seem to me that we need to upgrade the apache/Perl relationship so that the env hash and programs recognize Perl 5.8. Question: Do I need to recompile anything, You need to recompile mod_perl if you want to use 5.8 with your mod_perl scripts. It's explained in the Guide and it's a lot easier than it looks at first. I've got some other apps that use CGI and HTTP modules associated with perl 5.00503. They don't appear to work with PERL 5.8 as configured on my machine. I'd like to get these working with PERL 5.8 as well. Then I guess you're going to have to do some recoding... Another related question: Just to understand part of your response. Looks like I'm already ok with current versions of apache and mod_perl at 1.3.19 and 1.25? I don't think I quite said that. You should upgrade to the latest stable Apache and mod_perl for several reasons, security and bug fixes being two of them. My recommendation would be that you always compile your own Apache and mod_perl from the sources whenever you can. How are things in grand old England? Snowing (but then I'm not going to stay here for very long... :) 73, Ged.
Re: An URL is not Invoking the Anticipated Perl Module [mp2]
To: Stas Bekman [or anyone else]; For the purpose of clarifying the issue, are you saying there is contention between the two handlers which are declared within the httpd.conf, as it has been setup in this case? That is, since a handler has been declared within by the directory section [/var/www/perl] and another for the location [/CurrDate], the two handlers are contenting against the one other? Therefore, in this case, although Location /CurrDate has been defined, the default handler Directory /var/www/perl is overriding the CurrDate name space[!?] Would someone please clarify. From studying this further, I noticed I forgot to prefix the Location /CurrDate section with a PerlModule directive. Consequently, the following line has been added to the perl.conf file. PerModule: MyApache::CurrDate However, now, with this addition, when starting the Apache the following exception is genereated: httpd failed. The error was: Starting httpd: [Fri Jan 10 12:11:15 2003] [error] Can't locate MyApache/CurrDate.pm in @INC (@INC contains: /var/www/perl /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/Apache2 /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl .) at (eval 4) line 3. You'll notice from this message, the path does include '/var/www/perl' and the perl module which is being called is within the '/var/www/perl/MyApache/' directory. (For good measure it was also placed within '/var/www/perl' without a resolution to the run time exception.) Incidentally, the format of the configuration file which is being used in this case has been adapted from the article Introducting mod_perl Handlers. I've also been using Getting Your Feet Wet with mod_perl. These resources can be respectfully found at http://perl.apache.org/docs/2.0/user/handlers/intro.html#What_are_Handlers_ and http://perl.apache.org/docs/2.0/user/intro/start_fast.html#Handler_Modules I found these to be very helpful for a newcomer. This later article was especially beneficial for it connected several fregmented thoughts together [at least in my own learning curve] into good concise working document. In my case, I found it helpful to get a perl script working [as a first measure] and then proceed to the use of a response handler. However, I did run across a problem with how the perl script name space was defined. The first example [in the article Getting Your Feet Wet] would not work when I used the syntax PerlResponseHandler Modperl::Registry nor PerlResponseHandler Modperl::Registry::handler. Consequently, I changed the format to PerlHandler ModPerl::Registry::handler and then my test script was able to run. Consequently, at this stage, a few questions remain. 1) Since, at least in this situation, I had to adapt the handler from being PerlResponseHandler to PerlHandler in order to get the perl scripting to work, does that also mean the same adaptation will be necessary in order to yield a result from a reponse handler for the CurrDate.pm module? 2) Once again, how do I instruct Apache to properly locate the CurrDate.pm file? [Stas, you may have already given me the answer to this latter question but more clarity is still needed.] 3) When I include the provision of the line PerModule: MyApache::CurrDate within the perl.conf file, Apache throws an exception and failed to start. Does this line need to be included, or something similiar to it, in order to Apache to locate the perl module? [Remember again, in this situation, a startup.pl script has been delcared in order to provide a library to search for perl modules.] The reason I'm asking this question is because the Introducing mod_perl Handlers article uses this convention while the Getting Your Feet Wet with mod_perl omitts this line. The environment is RH 8.0, Apache 2.0.40, mod_perl 1.99_05-dev, and Perl 5.8.0. [For those who are interested, the original post includes a complete copy of perf.conf and CurrDate.pm.] I have been piecing together various web resources but remain uncertain how to procede. Further help is appreciated. Stas, you have already replied to this once, and to another setup problem for which I was having. I am grateful. Thank you. Steve D wrote: The problem: Apache is generating File does not exist within its error.log and the message Object not found (The requested URL was not found. Error number 404.) while attempting to call a perl module from a brower. [...] Location /CurrDate SetHandler per-script PerlResponseHandler MyApache::CurrDate /Location s/per-script/perl-script/ SetHandler can't verify at parsing time whether a handler really exists, it's really a string. So in your case the default handler was handling that Location. See:
maybe off topic? Mod write config issue
Sorry if this is offtopic here - I looked on http://httpd.apache.org/lists.html and didn't see any better lists for this question...if there is one, let me know and Iwill post it there I want to redirect http://www.i18n.com/showcase/foo to http://showcase.i18n.com/foo I am running a dual apache config (mp1, current release for mp and apache) so Ialready have some rewrite rules: VirtualHost www.i18n.com ServerName www.i18n.com RewriteEngine On RewriteLogLevel 0 RewriteRule ^/(.*.shtml)$ http://localhost:8000/$1 [proxy] RewriteRule ^/(.*.pl)$ http://localhost:8000/$1 [proxy] RewriteRule ^/(.*.inc)$ http://localhost:8000/$1 [proxy,last] NoCache * ProxyPassReverse / http://www.i18n.com/ snip /VirtualHost This all works fine. The virtual host showcase.i18n.com is defined in the same httpd.conf file and it works. Now I want to add the new rewrite rule: RewriteLogLevel 3 RewriteLog /usr/local/httpd_docs/logs/vslash_rewrite.log RewriteRule ^/showcase/(.*)$ http://showcase.i18n.com/$1 [proxy,last] this is added to the top of the list of rules. some weird things happen: 1 - nothing get written to the log file, even at level 9. It is owned by root (created by touch). Is that ok? 2 - the rewrite doesn't happen and I get a 404 error; The requested URL /showcase was not found on this server. Apache/1.3.27 Server at www.i18n.com Port 80 in my browser (Opera 6.05). Any ideas? It is live if you want to see it.. thanks, GV
Re: Problem combining mod_proxy, mod_rewrite mod_perl
Jan P. Monsch wrote: G'day! I would like to combine mod_proxy, mod_rewrite and mod_perl on an Apache 2.0.43 for Windows with mod_perl 2.0. The Perl Version I use is ActiveState 5.6.1. Just by loading the module the server behaves differently. Instead seeing the the reverse proxied site I get following error in the browser: - Proxy Error The proxy server received an invalid response from an upstream server. The proxy server could not handle the request GET /directx1/directx1/directx1/directx1/directx1/directx1/directx1/directx1/directx1/directx1/directx1/. Reason: Max-Forwards has reached zero - proxy loop? - It seems as if the rewrite rules are applied in a recursive loop. The rewrite.log does support this. Any ideas why this is happening and how can I get the config running again. [...] From your explanations and debug traces it looks like a bug in mod_proxy/mod_rewrite. You probably will get the same story with mod_cgi. If so, you need to report this bug to the httpd-dev list. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Shared memory 'copy-on-write' issue
Perrin Harkins wrote: Anton Permyakov wrote: reading http://perl.apache.org/docs/1.0/api/Apache/SizeLimit.html#Shared_Memory_Opti ons i am seeing that link about memory sharing by copy-on-write points to http://perl.apache.org/docs/1.0/guide/index.html and 'META: change link when site is live' stands after it. Site is alive, how knows where should this link point to? It does go the guide correctly, but a more specific link would be this: http://perl.apache.org/docs/1.0/guide/performance.html#Sharing_Memory I've fixed the link to point to the above URL. Thanks for pointing this out. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: An URL is not Invoking the Anticipated Perl Module [mp2]
Steve, please don't throw more than one question into the same email. It makes it really hard to followup. Please post each question separately. Steve D wrote: For the purpose of clarifying the issue, are you saying there is contention between the two handlers which are declared within the httpd.conf, as it has been setup in this case? That is, since a handler has been declared within by the directory section [/var/www/perl] and another for the location [/CurrDate], the two handlers are contenting against the one other? Therefore, in this case, although Location /CurrDate has been defined, the default handler Directory /var/www/perl is overriding the CurrDate name space[!?] Would someone please clarify. Eh? Did you: s/per-script/perl-script/ and tried again? From studying this further, I noticed I forgot to prefix the Location /CurrDate section with a PerlModule directive. Consequently, the following line has been added to the perl.conf file. PerModule: MyApache::CurrDate However, now, with this addition, when starting the Apache the following exception is genereated: httpd failed. The error was: Starting httpd: [Fri Jan 10 12:11:15 2003] [error] Can't locate MyApache/CurrDate.pm in @INC (@INC contains: /var/www/perl /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/Apache2 /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl .) at (eval 4) line 3. You'll notice from this message, the path does include '/var/www/perl' and the perl module which is being called is within the '/var/www/perl/MyApache/' directory. (For good measure it was also placed within '/var/www/perl' without a resolution to the run time exception.) There was a bug in older mod_perl versions, and you'd get the Can't locate module error when in fact, the module has failed to compile. Please try again with the cvs version. Incidentally, the format of the configuration file which is being used in this case has been adapted from the article Introducting mod_perl Handlers. I've also been using Getting Your Feet Wet with mod_perl. These resources can be respectfully found at http://perl.apache.org/docs/2.0/user/handlers/intro.html#What_are_Handlers_ and http://perl.apache.org/docs/2.0/user/intro/start_fast.html#Handler_Modules I found these to be very helpful for a newcomer. Great. This later article was especially beneficial for it connected several fregmented thoughts together [at least in my own learning curve] into good concise working document. In my case, I found it helpful to get a perl script working [as a first measure] and then proceed to the use of a response handler. However, I did run across a problem with how the perl script name space was defined. The first example [in the article Getting Your Feet Wet] would not work when I used the syntax PerlResponseHandler Modperl::Registry nor PerlResponseHandler Modperl::Registry::handler. Consequently, I changed the format to PerlHandler ModPerl::Registry::handler and then my test script was able to run. It should work with 'PerlResponseHandler Modperl::Registry'. What was the error message (please start a new thread on this one, don't continue here) Consequently, at this stage, a few questions remain. 1) Since, at least in this situation, I had to adapt the handler from being PerlResponseHandler to PerlHandler in order to get the perl scripting to work, does that also mean the same adaptation will be necessary in order to yield a result from a reponse handler for the CurrDate.pm module? 2) Once again, how do I instruct Apache to properly locate the CurrDate.pm file? [Stas, you may have already given me the answer to this latter question but more clarity is still needed.] 3) When I include the provision of the line PerModule: MyApache::CurrDate within the perl.conf file, Apache throws an exception and failed to start. s/PerModule:/PerlModule/ I don't know where did you take PerModule: from. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: maybe off topic? Mod write config issue
George Valpak wrote: Sorry if this is offtopic here - I looked on http://httpd.apache.org/lists.html and didn't see any better lists for this question...if there is one, let me know and Iwill post it there George, why not to try a specially designated httpd-users support list: http://httpd.apache.org/lists.html#http-users Also see: http://httpd.apache.org/docs/mod/mod_rewrite.html http://httpd.apache.org/docs/misc/rewriteguide.html I want to redirect http://www.i18n.com/showcase/foo to http://showcase.i18n.com/foo I am running a dual apache config (mp1, current release for mp and apache) so Ialready have some rewrite rules: VirtualHost www.i18n.com ServerName www.i18n.com RewriteEngine On RewriteLogLevel 0 RewriteRule ^/(.*.shtml)$ http://localhost:8000/$1 [proxy] RewriteRule ^/(.*.pl)$ http://localhost:8000/$1 [proxy] RewriteRule ^/(.*.inc)$ http://localhost:8000/$1 [proxy,last] NoCache * ProxyPassReverse / http://www.i18n.com/ snip /VirtualHost This all works fine. The virtual host showcase.i18n.com is defined in the same httpd.conf file and it works. Now I want to add the new rewrite rule: RewriteLogLevel 3 RewriteLog /usr/local/httpd_docs/logs/vslash_rewrite.log RewriteRule ^/showcase/(.*)$ http://showcase.i18n.com/$1 [proxy,last] this is added to the top of the list of rules. some weird things happen: 1 - nothing get written to the log file, even at level 9. It is owned by root (created by touch). Is that ok? 2 - the rewrite doesn't happen and I get a 404 error; The requested URL /showcase was not found on this server. Apache/1.3.27 Server at www.i18n.com Port 80 in my browser (Opera 6.05). Any ideas? It is live if you want to see it.. thanks, GV -- __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Unregister streamed output filters
Esteban Fernandez Stafford wrote: Hello all, is there a way to unregister a streamed filter? I have seen this in many (all?) apache (C programmed) filters; they are able of declining the filtering of a certain stream, for example, when they do not know how to handle a certain content type. In the apache api this is done with ap_remove_output_filter(f). Is there something similar in mp2? Not at this moment, but hopefully it'll be supported soon. Since you need this feature, telling us in what situation you'd like to remove a filter will help us to build a better test case and provide a good real-world example for documentation. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
[ANNOUNCE] Apache::DBI 0.90_02
Last night I spent a bit of time making a proper test for Apache::DBI and make it work without Apache.pm. Just now I made it work with mod_perl 2.0. I have only tested that very briefly. Until it hits your CPAN mirror, get it from: http://develooper.com/code/Apache::DBI/ Or from CVS; instructions at http://dev.perl.org/cvs/info?module=Apache/DBI/ Please try it out if you have a chance. I would also like to see more tests added to the t/ directory. - ask Apache-DBI-0.90_02.tar.gz has entered CPAN as file: $CPAN/authors/id/A/AB/ABH/Apache-DBI-0.90_02.tar.gz size: 26770 bytes md5: e8c1082b19ad6a01bd572e13628da17d Changes since 0.89: 0.90_02 January 10, 2003 - Changes to make Apache::DBI load and function under mod_perl 2.0. A few important notes: connect_on_init does not work yet and there's no automatic RollBack cleanup handler when autocommit is turned off. 0.90_01 January 10, 2003 - Only call Apache::Status if Apache.pm is completely loaded - Make Test::More a prerequisite so we can do real tests - Make DBI.pm a prerequisite - Add a simple, but real, test script. Requires DBD::mysql and a test database
[ANNOUNCE] mod_perl-1.99_08
The URL http://perl.apache.org/dist/mod_perl-1.99_08.tar.gz has entered CPAN as file: $CPAN/authors/id/D/DO/DOUGM/mod_perl-1.99_08.tar.gz size: 653469 bytes md5: e32ef1bf6493673a83362ae2f1f1a86b Changes since 1.99_07: Correct ModPerl::RegistryCooker to reset %INC, after compile for .pl files which don't declare the package + add tests to check that [Stas] Log the real error message when Foo::Bar::sub_name fails to resolve, because of a problem in Foo::Bar, when Foo::Bar *was* found [Stas] Add PerlPreConnectionHandler support in Apache::Test [Stas] Enable PerlPreConnectionHandler [Stas] Support the Host: request header in Apache::TestClient [Stas] restore the ModPerl::RegistryLoader::new() method for backwards compatibility [Stas] port the support for NameWithVirtualHost in ModPerl::RegistryCooker and ModPerl::RegistryLoader [Stas] fix the handling of the return status in ModPerl::RegistryCooker, add a test to verify that [Stas] under non-threaded perl need to check whether mod_perl is running, when modperl_vhost_is_running check is done. [Stas] fix $r-read to read all the requested amount of data if possible, adjust the test TestApache::read to verify that [Stas] fix the method content() in Apache::compat to read a whole request body. same for ModPerl::Test::read_post. add tests. [Stas] Adjust the reverse filter test to work on win32 (remove trailing \r) [Randy Kobes [EMAIL PROTECTED]] Strongly suggest win32 users to upgrade to 5.8.0, if they run 5.6.x [Randy Kobes [EMAIL PROTECTED]] When installing the mod_perl shared object, first need to check whether the directory 'modules' already exists, and create it if not. [Randy Kobes [EMAIL PROTECTED]] Add a capability to tune the test configuration sections ordering in Apache::TestConfigPerl [Stas Bekman] fix the complaining code about late PerlSwitches when PerlLoadModule is used before it [Stas Bekman] add various tests that exercise PerlLoadModule and vhosts [Stas Bekman] handle correctly PerlLoadModules (directives) with vhosts: - handle gracefully cases when things are undef/NULL - handle the case when scfg==NULL, by stealing the base_servers's config [Stas Bekman] make mod_perl work with vhosts when the server is started prior to post_config(): - call modperl_init_globals as early as possible, because the main server record is needed during the configuration parsing, for perlloadmodule and vhosts - also make sure that we are using a real base_server, when dealing with modperl_init, and if not retrieve it from the global record [Stas Bekman] prevent segfaults, when scfg is NULL in Apache::Module-get_config(); [Stas Bekman] ensure that a core file is a file indeed, before complaining [Philippe M. Chiasson [EMAIL PROTECTED]] add $r-as_string [Geoffrey Young] add backcompat vars: $Apache::Server::CWD and $Apache::Server::AddPerlVersion [Stas Bekman] env var MOD_PERL_TRACE is working again [Stas Bekman] add a new test TestDirective::perlloadmodule2, which performs a more evolved merging. [Stas Bekman] fix Apache::TestConfigPerl under mod_perl 1.0, need to require mod_perl.pm before using $mod_perl::VERSION [Geoffrey Young [EMAIL PROTECTED]] add an Apache::SIG backcompat stub to Apache::compat [Stas Bekman] fix the Apache::TestConfigPerl's run_apache_test_config() function where test packages are scanned for the magic APACHE_TEST_CONFIGURE and if found get require()'d. Apache2 needs to be run for mod_perl 2.0. [Stas Bekman] move the custom mod_perl 2.0 configuration bits out of the ModPerl::TestRun, where they don't belong, into a special config file which is included at the very end of httpd.conf [Stas Bekman] extend Apache::Test to allow extra configuration files to be included at the very end of httpd.conf, when everything was loaded and configured [Stas Bekman] resolve a segfault in Apache::Module::get_config() for the edge case when the package name is bogus. [Stas Bekman] Apache::Reload: add support for watching and reloading modules only in specified sub-dirs [Harry Danilevsky [EMAIL PROTECTED]] enable APR.pm's linking for apr 0.9.2 and higher, which uses a new lib naming scheme, such as libapr-0.so.0.9.2, only if apr-config and apu-config scripts exist. [Stas Bekman] define IoTYPE_RDONLY/IoTYPE_WRONLY for perl-5.6.0 so the project compiles again under 5.6.0 [Stas Bekman] allow output streaming filters to append data to the end of the stream [Stas Bekman] fixes to compile with ActivePerl 5.8 beta [Randy Kobes [EMAIL PROTECTED]] fix for directive handlers within vhosts using threaded MPMs [Stephen Clouse [EMAIL PROTECTED]] fix IfDefine MODPERL2 support default AuthType to Basic if not set in $r-get_basic_auth_pw() [Philippe M. Chiasson [EMAIL PROTECTED]] workaround glibc/Perl-5.8.0 crypt() bug (seen with threaded MPMs) fix delete $ENV{$key} bug fix parse_args compat method to support non-ascii characters and tr/+/ / [Walery Studennikov [EMAIL PROTECTED]] fix