Re: open(FH,'|qmail-inject') fails
Greg Stark wrote: > A better plan for such systems is to have a queue in your database for > parameters for e-mails to send. Insert a record in the database and let your > web server continue processing. > > Have a separate process possibly on a separate machine or possibly on multiple > machines do selects from that queue and deliver mail. I think the fastest way > is over a single SMTP connection to the mail relay rather than forking a > process to inject the mail. > > This keeps the very variable -- even on your own systems -- mail latency > completely out of the critical path for web server requests. Which is really > the key measure that dictates the requests/s you can serve. > Exactly, Greg. This is homologous to proxy serving http requests. Ideally, the data/text should be relayed to a separate, dedicated mail server. This has come up repeatedly for me on performance tuning projects. If there are a number of mail processes negotiating with remote hosts even running on the same machine as you are web serving from, you may, under significant load, degrade performance.
Re: Trouble setting up mod_perl and name-based virtual hosts
"Kyle Dawkins" <[EMAIL PROTECTED]> wrote: > "Joe Brenner" <[EMAIL PROTECTED]> wrote: > > > I've run into problems adding virtual hosts to a machine > > where I've already got mod_perl working, but I'm having > > some trouble pinning it down, because apache just seems to > > die silently without giving me any hints in the error_log. > > > > It definitely does have something to do with an interaction > > with mod_perl though, because if I comment out "AddModule > > mod_perl.c" I can at least get apache to restart (though I > > guess whether the vhosts are working is another question). > > > > Does anyone out there have some sucessful examples of > > httpd.conf files for mod_perl+vhost sites that they can > > point me at? (Sorry if the answer to this one is out there > > somewhere, but I've been looking and having found it.) > > (I'm running a RedHat 6.1 linux system, using perl 5.05, > > mod_perl 1.21, and apache 1.3.9): > Your problem is with the RPMs that you're using (I bet). I am guessing > you're using the pre-built ones that come with RH6.1, right? Don't be > fooled... these are buggy. Well, you're quite right that I've been trying to stick to the rpms. In many cases they're the ones that came with RH 6.1, in other cases I downloaded newer ones... I guess I'll have to think about just building from source. Doesn't seem like it can hurt. (It occurs to me that I'm also using mod_perl as a DSO... it seemed to me like that was working fine, I wondered a bit why some people thought it was a bad idea. Maybe I've found out why...?) > You solution is extremely simple and will only > take a short time if you follow the instructions: > > 1. Use "rpm -e" to remove mod_perl and mod_php, then remove apache. > 2. DOWNLOAD THE SOURCES for Apache 1.3.12 and mod_perl 1.24 > 3. Build them from the source tarballs. You probably want to enable >"EVERYTHING" when you build mod_perl. Make sure you build a new apache >executable with mod_perl statically linked in. This >apache executable takes a bit more RAM but it's faster and way >more stable. > 4. To make sure that your new httpd has mod_perl built in, execute >httpd -l >and it should list its modules. If mod_perl appears, you're golden. > 5. Remove all the LoadModule and AddModule stuff from your httpd.conf, >restart apache, and if it doesn't work, I'd be very surprised... > > I had the same problem as you (although it was > LinuxPPC2000). Oh yeah, I'm just running i386 stuff on a oldish Pentium. It's a bad habit to fall into, not to mention that... > As did many others in the past (do a search for "SIGSEGV" > or "core dump" or "segmentation fault" in the mailing list > archives...), and it's a bummer of a bug because it > doesn't bite you until you try something slightly > difficult (uh, like "PerlModule Apache::DBI") and it > explodes.
Re: open(FH,'|qmail-inject') fails
Doug MacEachern <[EMAIL PROTECTED]> writes: > On Mon, 25 Sep 2000, Stas Bekman wrote: > > > All you care about is to measure the time between email sending start and > > end (when the process continues on its execution flow). Why should one > > care about the details of internal implementation. > > i only skimmed the first part of this thread, but assumed if you're > talking about performance, you'd want to compare the overall impact on > your system(s) of Net::SMTP vs. |qmail-inject. you cannot measure the > overall impact just using Benchmark.pm is all i'm trying to clarify. A better plan for such systems is to have a queue in your database for parameters for e-mails to send. Insert a record in the database and let your web server continue processing. Have a separate process possibly on a separate machine or possibly on multiple machines do selects from that queue and deliver mail. I think the fastest way is over a single SMTP connection to the mail relay rather than forking a process to inject the mail. This keeps the very variable -- even on your own systems -- mail latency completely out of the critical path for web server requests. Which is really the key measure that dictates the requests/s you can serve. -- greg
Re: Trouble setting up mod_perl and name-based virtual hosts
Joe Your problem is with the RPMs that you're using (I bet). I am guessing you're using the pre-built ones that come with RH6.1, right? Don't be fooled... these are buggy. You solution is extremely simple and will only take a short time if you follow the instructions: 1. Use "rpm -e" to remove mod_perl and mod_php, then remove apache. 2. DOWNLOAD THE SOURCES for Apache 1.3.12 and mod_perl 1.24 3. Build them from the source tarballs. You probably want to enable "EVERYTHING" when you build mod_perl. Make sure you build a new apache executable with mod_perl statically linked in. This apache executable takes a bit more RAM but it's faster and way more stable. 4. To make sure that your new httpd has mod_perl built in, execute httpd -l and it should list its modules. If mod_perl appears, you're golden. 5. Remove all the LoadModule and AddModule stuff from your httpd.conf, restart apache, and if it doesn't work, I'd be very surprised... I had the same problem as you (although it was LinuxPPC2000). As did many others in the past (do a search for "SIGSEGV" or "core dump" or "segmentation fault" in the mailing list archives...), and it's a bummer of a bug because it doesn't bite you until you try something slightly difficult (uh, like "PerlModule Apache::DBI") and it explodes. cheers kyle -- kyle dawkins [EMAIL PROTECTED] - Original Message - From: "Joe Brenner" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, October 02, 2000 19:43 Subject: Trouble setting up mod_perl and name-based virtual hosts > > I've run into problems adding virtual hosts to a machine > where I've already got mod_perl working, but I'm having > some trouble pinning it down, because apache just seems to > die silently without giving me any hints in the error_log. > > It definitely does have something to do with an interaction > with mod_perl though, because if I comment out "AddModule > mod_perl.c" I can at least get apache to restart (though I > guess whether the vhosts are working is another question). > > Does anyone out there have some sucessful examples of > httpd.conf files for mod_perl+vhost sites that they can > point me at? (Sorry if the answer to this one is out there > somewhere, but I've been looking and having found it.) > > Here's my entire httpd.conf file, if anyone wants see it > (I'm running a RedHat 6.1 linux system, using perl 5.05, > mod_perl 1.21, and apache 1.3.9):
Trouble setting up mod_perl and name-based virtual hosts
I've run into problems adding virtual hosts to a machine where I've already got mod_perl working, but I'm having some trouble pinning it down, because apache just seems to die silently without giving me any hints in the error_log. It definitely does have something to do with an interaction with mod_perl though, because if I comment out "AddModule mod_perl.c" I can at least get apache to restart (though I guess whether the vhosts are working is another question). Does anyone out there have some sucessful examples of httpd.conf files for mod_perl+vhost sites that they can point me at? (Sorry if the answer to this one is out there somewhere, but I've been looking and having found it.) Here's my entire httpd.conf file, if anyone wants see it (I'm running a RedHat 6.1 linux system, using perl 5.05, mod_perl 1.21, and apache 1.3.9): ServerType standalone ServerRoot "/etc/httpd" LockFile /var/lock/httpd.lock PidFile /var/run/httpd.pid ScoreBoardFile /var/run/httpd.scoreboard Timeout 300 KeepAlive On MaxKeepAliveRequests 100 KeepAliveTimeout 15 MinSpareServers 5 MaxSpareServers 20 StartServers 8 MaxClients 150 MaxRequestsPerChild 100 LoadModule vhost_alias_module modules/mod_vhost_alias.so LoadModule env_module modules/mod_env.so LoadModule config_log_module modules/mod_log_config.so LoadModule agent_log_module modules/mod_log_agent.so LoadModule referer_log_module modules/mod_log_referer.so LoadModule mime_modulemodules/mod_mime.so LoadModule negotiation_module modules/mod_negotiation.so LoadModule status_module modules/mod_status.so LoadModule info_modulemodules/mod_info.so LoadModule includes_modulemodules/mod_include.so LoadModule autoindex_module modules/mod_autoindex.so LoadModule dir_module modules/mod_dir.so LoadModule cgi_module modules/mod_cgi.so LoadModule asis_modulemodules/mod_asis.so LoadModule imap_modulemodules/mod_imap.so LoadModule action_module modules/mod_actions.so LoadModule userdir_module modules/mod_userdir.so LoadModule alias_module modules/mod_alias.so LoadModule rewrite_module modules/mod_rewrite.so LoadModule access_module modules/mod_access.so LoadModule auth_modulemodules/mod_auth.so LoadModule anon_auth_module modules/mod_auth_anon.so LoadModule db_auth_module modules/mod_auth_db.so LoadModule digest_module modules/mod_digest.so LoadModule proxy_module modules/libproxy.so LoadModule expires_module modules/mod_expires.so LoadModule headers_module modules/mod_headers.so LoadModule usertrack_module modules/mod_usertrack.so LoadModule setenvif_modulemodules/mod_setenvif.so LoadModule perl_modulemodules/libperl.so ClearModuleList AddModule mod_vhost_alias.c AddModule mod_env.c AddModule mod_log_config.c AddModule mod_log_agent.c AddModule mod_log_referer.c AddModule mod_mime.c AddModule mod_negotiation.c AddModule mod_status.c AddModule mod_info.c AddModule mod_include.c AddModule mod_autoindex.c AddModule mod_dir.c AddModule mod_cgi.c AddModule mod_asis.c AddModule mod_imap.c AddModule mod_actions.c AddModule mod_userdir.c AddModule mod_alias.c AddModule mod_rewrite.c AddModule mod_access.c AddModule mod_auth.c AddModule mod_auth_anon.c AddModule mod_auth_db.c AddModule mod_digest.c AddModule mod_proxy.c AddModule mod_expires.c AddModule mod_headers.c AddModule mod_usertrack.c AddModule mod_so.c AddModule mod_setenvif.c AddModule mod_perl.c Port 80 User nobody Group nobody # ServerAdmin [EMAIL PROTECTED] ServerAdmin [EMAIL PROTECTED] ServerName www.polymuse.com DocumentRoot "/home/httpd/html" Options FollowSymLinks AllowOverride None Options Indexes Includes FollowSymLinks AllowOverride None Order allow,deny Allow from all UserDir public_html DirectoryIndex index.html index.htm index.shtml index.cgi AccessFileName .htaccess Order allow,deny Deny from all UseCanonicalName On TypesConfig /etc/mime.types DefaultType text/plain MIMEMagicFile share/magic HostnameLookups Off ### Now also below inside the polymuse vhost... not good? ### Doesn't matter? ErrorLog /var/log/httpd/error_log LogLevel warn LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%h %l %u %t \"%r\" %>s %b" common LogFormat "%{Referer}i -> %U" referer LogFormat "%{User-agent}i" agent # CustomLog /var/log/httpd/access_log common ServerSignature On Alias /icons/ "/home/httpd/icons/" Options Indexes MultiViews AllowOverride None Order allow,deny Allow from all ScriptAlias /cgi-bin/ "/home/httpd/cgi-bin/" AllowOverride None Options ExecCGI Order allow,deny Allow from all IndexOptions FancyIndexing AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip AddIconByType (TXT,/icons/text.gif) text/* AddIconByType (IMG,/icons/image2.gif) image/* AddIconByType (SND,/icons/sound2.gif) audio/* AddIconBy
mod_so and mod_perl
I have a server that I'm trying to get mod_perl working on and I'm having a bit of trouble getting mod_so and mod_perl working together (at least I think). The server as it is has mod_so compiled into the httpd and loads PHP as a DSO. I have been able (as far as I can tell) to get the mod_perl install to compile an httpd with mod_perl and mod_so (at least they show up in the 'httpd -l' list). However, when I try running the httpd server with both mod_perl and mod_so etc. PHP doesn't seem to work correctly (otherwise the server works fine). No error message or even access message shows up when trying to access a php script through the webserver. It's really frustrating trying to solve this problem since I don't have much debugging / error information to work with. Any help would be greatly appreciated. Thanks.
More Info Re: IPC::Open2 Problems
The call to open2 seems to work fine for one or two times after I restart the server. Would that imply that the filehandles are not getting closed somehow? I'm explicitly closing them, to no avail. Also, when I check $! after the open2 call, I'm seeing the same error about "Illegal Seek..." every time. I've searched everywhere I could think of, but haven't found any information on what that means. Anybody encounter this before? I've seen references to needing to build Perl with sfio... I'm not sure what that means, and whether it is applicable to my problem. Can someone clue me in? Thanks, RYAN -- Ryan Adams [EMAIL PROTECTED] Vitessi Motorsports, Inc. www.vitessi.com Voice: 740/362-9254 Fax: 740/362-0354 --
Re: $r->header_only question (feeling a newbie!)
doug, lincoln, looks like www.modperl.com needs a link to errata. martin, check out: http://www.ora.com/catalog/wrapmod/errata/wrapmod.699 martin langhoff wrote: > Thanks Tim and all, > for-the-record, I did check www.modperl.com looking for an > errata. > > marks down for O'Reilly technical reviewers :p > > martin > > Tim Tompkins wrote: > > > > This should be an "if" instead of "unless" > > > > return OK if $r->header_only; > > > > header_only() will return true if the request method is HEAD. You'll want > > to simply return OK once you've gathered all the necessary outgoing headers > > for HEAD requests. -- ___cliff [EMAIL PROTECTED]http://www.genwax.com/
Re: Apache::Filter/::RegistryFilter/::Compress problem.
>>> Ken Williams writes: kw> Do you also have config lines like kw> PerlModule Apache::RegistryFilter kw> PerlModule Apache::Compress kw> somewhere in the config file? You should. i don't; i've been letting mod_perl do its own thing there. i'll make that change. kw> Other than that, is the filtering setup working okay? indeed. it's pretty excellent how much of a performance kick compressing the content gets you. furthermore, i like the apache::filter API (such as it is) -- it's been trivial to write custom filters. thanks for your help. cheers, k. -- kevin montuori support independent booksellers -- http://www.booksense.com
Re: Apache::Filter/::RegistryFilter/::Compress problem.
[EMAIL PROTECTED] (kevin montuori) wrote: > i'm wondering if anyone else has seen the following behaviour, and, > if you have, how you dealt with it. here's the problem: > > i have a bunch (200 or so) CGI scripts being handled by > Apache::RegistryFilter then Apache::Compress, i.e., > > > SetHandlerperl-script > PerlSetVarFilter On > PerlHandler Apache::RegistryFilter Apache::Compress > Hi Kevin, Do you also have config lines like PerlModule Apache::RegistryFilter PerlModule Apache::Compress somewhere in the config file? You should. If you don't, I think mod_perl does some magical loading of modules you need (I'm not even sure of that, since I always load the modules explicitly), but it might get messed up when new children are created or something. Other than that, is the filtering setup working okay? ------ Ken Williams Last Bastion of Euclidity [EMAIL PROTECTED]The Math Forum
Re: $r->header_only question (feeling a newbie!)
Thanks Tim and all, my gathering is that the sample script on page 146 of the Eagle: - needed a 'use Apache::Constants(:common);' line - needed a 'return OK;' line at EOF - had an 'unless' that should've been an 'if'. for-the-record, I did check www.modperl.com looking for an errata. Doug? Lincoln? I mean, it's one of the *simple* scripts, I do LOVE the book, but I guess I'll have to trust this list a hunderd times more than the book. And, unless it was all my mistake, for some unbeknownst reason, a few marks down for O'Reilly technical reviewers :p martin Tim Tompkins wrote: > > This should be an "if" instead of "unless" > > return OK if $r->header_only; > > header_only() will return true if the request method is HEAD. You'll want > to simply return OK once you've gathered all the necessary outgoing headers > for HEAD requests.
Re: $r->header_only question (feeling a newbie!)
On Mon, 2 Oct 2000, martin langhoff wrote: > Now shouldn't it be an 'if' instead of an 'unless'? yes, it should be an `if'. your script works fine for me with that change.
Re: Patch for easy testing of Apache::* modules (resend)
On Mon, 2 Oct 2000, Ken Williams wrote: ken, i have a feature request too :) i would like to be able to test if mod_include is linked static with httpd, otherwise Makefile.PL will disable PERL_SSI. a hash of parsed `httpd -l`, something like: my $static_modules = Apache::test->http_static_modules; if ($static_modules->{mod_include}) { ... } thanks!
Re: Update: Re: PerlSendHeader Off & socket persistence (was Re:question: usingApache for non-HTML messages)
On Mon, 2 Oct 2000, B. Burke wrote: > Why would the lack of a $r->send_http_header call cause socket persistence > to go away? I was under the impression that $r->send_http_header only affected > what was sent to the client, but appearantly it affects Apache's socket handling > as well. because send_http_header calls set_keepalive underneath, set_keepalive sets the flags so apache will keep the connection open. try the patch below and add $r->set_keepalive to your code. > 2) how can I make apache stop printing the outbound message size on each response what headers exactly is your client sending? you must be somehow triggering chunked encoding. Index: src/modules/perl/Apache.xs === RCS file: /home/cvs/modperl/src/modules/perl/Apache.xs,v retrieving revision 1.114 diff -u -r1.114 Apache.xs --- src/modules/perl/Apache.xs 2000/09/28 19:28:33 1.114 +++ src/modules/perl/Apache.xs 2000/10/02 21:23:28 @@ -937,6 +937,10 @@ send_http_header(r); mod_perl_sent_header(r, 1); +void +set_keepalive(r) +Apache r + #ifndef PERL_OBJECT int
Re: $r->header_only question (feeling a newbie!)
martin langhoff wrote: > > ... it made no difference ... :( > > Drew Taylor wrote: > > I believe all you need to add is "return OK;" after your print > > statement. Without that, Apache doesn't know what the status of the > > request should be. Doh. I missed what Tim caught. I believe Apache will assume an "OK" if you don't explicitly return a status code. Thus your code _should_ work after changing "unless" to "if". Can anyone check what Apache defaults to if no status code is returned? I'm guessing it's "OK". However, I'd still add a return OK after the print. :-) -- Drew Taylor Software Engineer Phone: 617.351.0245 Fax 617.350.3496 OpenAir.com - Making Business a Breeze! Open a free account today at www.openair.com
Re: Patch for easy testing of Apache::* modules (resend)
On Mon, 2 Oct 2000, Ken Williams wrote: > In looking over the changes, I found that I've done a little more work > since the last patch I sent. I didn't send it on because I wasn't sure > whether the first patch would be accepted or not. Anyway, I beefed up > the fetch() method and documented it. It's fully backward compatible, > so no changes are necessary to existing code that calls fetch(). I also > added/fixed tiny pieces in my previous work here and there. thanks ken, i applied this patch, but it broke modules/cgi 3-4,7, because it calls fetch() in an array context. i applied the bandaid below to get by for now. maybe it would be better for your more robust version of fetch() to be called get(), and the old fetch() becomes a wrapper around that? Index: lib/Apache/test.pm === RCS file: /home/cvs/modperl/lib/Apache/test.pm,v retrieving revision 1.18 diff -u -r1.18 test.pm --- lib/Apache/test.pm 2000/10/02 20:25:13 1.18 +++ lib/Apache/test.pm 2000/10/02 21:05:29 @@ -210,7 +210,8 @@ sub fetch { # Old code calls fetch() as a function, new code as a method -shift() if UNIVERSAL::isa($_[0], __PACKAGE__); +my $want_response; +$want_response = shift() if UNIVERSAL::isa($_[0], __PACKAGE__); my ($ua, $url) = (@_ == 1 ? ($UA, shift()) : @_); my $request = ref $url ? $url : {uri=>$url}; @@ -228,7 +229,7 @@ my $req = new HTTP::Request(@{$request}{'method','uri','headers','content'}); my $response = $ua->request($req); -return wantarray ? ($response->content, $response) : $response->content; +return $want_response ? $response : $response->content; } sub simple_fetch {
Re: $r->header_only question (feeling a newbie!)
... it made no difference ... :( Drew Taylor wrote: > I believe all you need to add is "return OK;" after your print > statement. Without that, Apache doesn't know what the status of the > request should be.
Re: $r->header_only question (feeling a newbie!)
This should be an "if" instead of "unless" return OK if $r->header_only; header_only() will return true if the request method is HEAD. You'll want to simply return OK once you've gathered all the necessary outgoing headers for HEAD requests. Thanks, Tim Tompkins -- Programmer / Staff Engineer http://www.arttoday.com/ -- - Original Message - From: "martin langhoff" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, October 02, 2000 1:37 PM Subject: $r->header_only question (feeling a newbie!) > hi, > > I've been developing with mod_perl for a while, but, thanks to > Richter's Embperl module and the excellent backwards compatibility > (regarding CGI.pm) I had never got anywhere near Apache::Request -- for > production, that is. > > Now I have this very silly question, that I've boiled down to this > little snippet of code (which carries a remakable resemblance to the > example found in page 146 of the Eagle Book): > -- > #!/usr/bin/perl -w > use strict; > use Apache::Constants qw(:common); > > my $r = Apache->request; > $r->content_type('text/html'); > $r->send_http_header; > > return OK unless $r->header_only; # THIS is the line I'm wondering about > > $r->print(< Hello ! > martin > END > 1; > > > > The issue is that I don't understand clearly what is this line supposed > to do. As it is, it'll make my script return an empty body ('document > contains no data!' said Navigator). Commented out, the proper contents > are sent. Reading the Eagle and `man Apache::Request` led me to thing > that the line is there to stop processing if all the client wants are > the headers (maybe because of a 'If-Modified-Since' parameter?). > > Now shouldn't it be an 'if' instead of an 'unless'? > > Am I too dumb today? Or is it just that it's monday? > > > > martin >
Re: $r->header_only question (feeling a newbie!)
martin langhoff wrote: > > hi, > > I've been developing with mod_perl for a while, but, thanks to > Richter's Embperl module and the excellent backwards compatibility > (regarding CGI.pm) I had never got anywhere near Apache::Request -- for > production, that is. > > Now I have this very silly question, that I've boiled down to this > little snippet of code (which carries a remakable resemblance to the > example found in page 146 of the Eagle Book): > -- > #!/usr/bin/perl -w > use strict; > use Apache::Constants qw(:common); > > my $r = Apache->request; > $r->content_type('text/html'); > $r->send_http_header; > > return OK unless $r->header_only; # THIS is the line I'm wondering about > > $r->print(< Hello ! > martin > END > 1; > > > > The issue is that I don't understand clearly what is this line supposed > to do. As it is, it'll make my script return an empty body ('document > contains no data!' said Navigator). Commented out, the proper contents > are sent. Reading the Eagle and `man Apache::Request` led me to thing > that the line is there to stop processing if all the client wants are > the headers (maybe because of a 'If-Modified-Since' parameter?). I believe all you need to add is "return OK;" after your print statement. Without that, Apache doesn't know what the status of the request should be. -- Drew Taylor Software Engineer Phone: 617.351.0245 Fax 617.350.3496 OpenAir.com - Making Business a Breeze! Open a free account today at www.openair.com
$r->header_only question (feeling a newbie!)
hi, I've been developing with mod_perl for a while, but, thanks to Richter's Embperl module and the excellent backwards compatibility (regarding CGI.pm) I had never got anywhere near Apache::Request -- for production, that is. Now I have this very silly question, that I've boiled down to this little snippet of code (which carries a remakable resemblance to the example found in page 146 of the Eagle Book): -- #!/usr/bin/perl -w use strict; use Apache::Constants qw(:common); my $r = Apache->request; $r->content_type('text/html'); $r->send_http_header; return OK unless $r->header_only; # THIS is the line I'm wondering about $r->print(< Hello ! martin END 1; The issue is that I don't understand clearly what is this line supposed to do. As it is, it'll make my script return an empty body ('document contains no data!' said Navigator). Commented out, the proper contents are sent. Reading the Eagle and `man Apache::Request` led me to thing that the line is there to stop processing if all the client wants are the headers (maybe because of a 'If-Modified-Since' parameter?). Now shouldn't it be an 'if' instead of an 'unless'? Am I too dumb today? Or is it just that it's monday? martin
Silicon Valley Perl Mongers FREE Party Tuesday
Hello Perl People: Silicon Valley Perl Mongers will be holding a social next Tuesday with *FREE* food and drinks, courtesy of Spinway Internet, our corporate sponsor for October. Yes, they're hiring Perl and C++ people. The event will be held at the QCafe in Palo Alto. You *must* RSVP me with a subject line of RSVP: 'number of people'. Event Information: Date: Tue, Oct 3 2000 7 pm - 9 pm Location: QCafe, 529 Alma St. Palo Alto, CA 94301 http://www.qcafe.com Cost: *FREE* if you RSVP before Tuesday Age: I guess you should be over 21 O'Reilly has also provided book catalogs and discount coupons. Thanks, James. -- Silicon Valley Perl Mongers http://www.rf.net/~sv-pm-org/ Spinway Internet http://www.spinway.com ActiveMessage - One-to-One eMarketing Ask me for a free outbound email trial account! http://ActiveMessage.com
Re: Question on Apache::Compress
>>> Ben Cottrell writes: bc> This fixes static html completely! It's compressed, and also bc> comes through as text/html. Thanks very much!! no problem. i've been doing a lot of this myself lately. bc> perl scripts are still coming through as compressed (which is bc> good) text/plain (which is bad). Umm. Who has control over the bc> content-type? the script; however, if you're compressing everything your script sends to STDOUT, you're compressing your headers too. (the first thing on your browser's screen is most likely Content-type: text/html.) instead have your developers do something like: my $r = shift; $r->content_type('text/html'); just as a by the way, i've been having a small problem with this configuration (see the mail i sent to the list earlier today). cheers, k. -- kevin montuori support independent booksellers -- http://www.booksense.com
IPC::open2 under mod_perl
I mentioned my issues with CyberCash yesterday, and I've been trying to work some of the bugs out of the implementation. But I seem to be having problems with their using IPC::open2. Basically, they use separate binaries to encrypt data and decrypt data that is to be sent to their server. The chunk of encrypted data is then sent over a basic, unencrypted http request. They're essentially doing this: IPC::Open2::open2(\*CIPHER, \*PLAINTEXT, '/foo/bar/encryption_binary') or die print PLAINTEXT "A Bunch Of Text To Be Encoded"; close(PLAINTEXT); my $EncryptedData = ; &SomethingWithEncryptedData($EncryptedData); close(CIPHER); And they do the reverse when they get a response. Sometimes it works, but most of the time, it warns that $EncryptedData is uninitialized and CyberCash pukes. I'm assuming that something weird is going on and the open2 is failing. Is this something that can reasonably be done under mod_perl? Any workarounds? Also, in the documentation for IPC it mentions that it won't return failure, but throws an exception. It doesn't look like CyberCash took this into account. What is the best way to fix it and catch the error? (I know this is more Perl than mod_perl...) Ideas are very welcome. Details: Apache 1.3.12 Linux 2.2.14-6.1.1smp mod_perl 1.24 mod_ssl 2.6.6-1.3.12 perl 5.6.0 Thanks in advance... RYAN -- Ryan Adams [EMAIL PROTECTED] Vitessi Motorsports, Inc. www.vitessi.com Voice: 740/362-9254 Fax: 740/362-0354 --
Re: Question on Apache::Compress
On Mon, 2 Oct 2000 15:28:09 -0400 (EDT), kevin montuori wrote: > bc> Static .html files aren't compressed at all (but do come through > bc> as text/html). > > do you have > > SetHandler perl-script > > in there somewhere? Kevin, This fixes static html completely! It's compressed, and also comes through as text/html. Thanks very much!! perl scripts are still coming through as compressed (which is good) text/plain (which is bad). Umm. Who has control over the content-type? I thought the perl script itself did (i.e. print "Content-Type: text/html\n\n") but I can't find that anywhere in our perl code (I'm not the one who writes the scripts, so I don't know the code... I'm just responsible for apache). Is there any other possible way the content type would have been getting set, previously, that might be broken with the addition of Apache::Compress? Thanks again :-) ~Ben
Question on Apache::Compress
Hi, This is in regards to Ken Williams' Apache::Compress module (announced here on August 22). I've installed it, along with zlib, Compress::Zlib, and Apache::Filter, and am having a couple of issues getting it running -- wondering if anyone has any clues. perl is version 5.004_04, apache is 1.3.6, mod_perl is a dev snapshot from February 4 of this year (1.21 something), with one local bug fix. Yes, I know all of those are out of date, to varying degrees :-) We've had some of apache stability issues at my company, and sometimes we've downgraded, or avoided upgrading, to avoid whack-a-mole bug stomping. mod_perl was compiled with EVERYTHING=1. For perl, we have: PerlModule Apache::Filter SetHandler perl-script PerlSetVar Filter on # the following line is what used to be here, and worked great, # but we're changing it to put compression in. # PerlHandler Apache::Registry PerlHandler Apache::RegistryFilter Apache::Compress PerlFixupHandler Apache::SizeLimit PerlSendHeader On ... And for static pages, we have: PerlModule Apache::Compress Options Includes FollowSymLinks ExecCGI Header set Pragma no-cache PerlHandler Apache::Compress ... Perl scripts compress perfectly, except come through as text/plain instead of text/html. Static .html files aren't compressed at all (but do come through as text/html). Any clues? Thanks! ~Ben
RE: Taint
> "HJ" == Herrington, Jack <[EMAIL PROTECTED]> writes: HJ> Compile-time? You mean, when I compile Perl 5.6 I can permanently disable HJ> taint checking? No, when your perl code is compiled, just prior to it being run. -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Vivek Khera, Ph.D.Khera Communications, Inc. Internet: [EMAIL PROTECTED] Rockville, MD +1-301-545-6996 GPG & MIME spoken herehttp://www.khera.org/~vivek/
Re: Apache::Filter/::RegistryFilter/::Compress problem.
>>> Matt Sergeant writes: ms> On Mon, 2 Oct 2000, kevin montuori wrote: >> i'm wondering if anyone else has seen the following behaviour, >> and, if you have, how you dealt with it. [...] ms> Do you have StatINC in that mix anywhere? i do not. should i? k. -- kevin montuori support independent booksellers -- http://www.booksense.com
RE: Taint
no, the other compile time :) see camel 3rd ed chapter 18 for compile v run-time distinctions, esp p467 --Geoff > -Original Message- > From: Herrington, Jack [mailto:[EMAIL PROTECTED]] > Sent: Monday, October 02, 2000 2:05 PM > To: 'Vivek Khera' > Cc: '[EMAIL PROTECTED]' > Subject: RE: Taint > > > Compile-time? You mean, when I compile Perl 5.6 I can > permanently disable > taint checking? > > -Original Message- > From: Vivek Khera [mailto:[EMAIL PROTECTED]] > Sent: Monday, October 02, 2000 11:04 AM > To: Herrington, Jack > Cc: '[EMAIL PROTECTED]' > Subject: RE: Taint > > > > "HJ" == Herrington, Jack <[EMAIL PROTECTED]> writes: > > > HJ> Is there a way to enable and disable taint checking at run-time? > > No; taint mode is a Perl compile time decision. >
Re: Apache::Filter/::RegistryFilter/::Compress problem.
On Mon, 2 Oct 2000, kevin montuori wrote: > > > folks -- > > i'm wondering if anyone else has seen the following behaviour, and, > if you have, how you dealt with it. here's the problem: > > i have a bunch (200 or so) CGI scripts being handled by > Apache::RegistryFilter then Apache::Compress, i.e., > > >SetHandlerperl-script >PerlSetVarFilter On >PerlHandler Apache::RegistryFilter Apache::Compress > > > this typically works very well; however, on occasion i get the > following error (reformatted): > > [Sun Oct 1 21:19:49 2000] [error] [Sun Oct 1 21:19:49 2000] > null: Undefined subroutine &Apache::RegistryFilter::handler > called at > /usr/local/lib/perl5/site_perl/5.005/Apache/Compress.pm line 37. Do you have StatINC in that mix anywhere? -- Fastnet Software Ltd. High Performance Web Specialists Providing mod_perl, XML, Sybase and Oracle solutions Email for training and consultancy availability. http://sergeant.org | AxKit: http://axkit.org
Re: Apache::ASP
Stefano Triolo wrote: I realy do not understand where is the problem!I attach the output that my internal server return when I try to execute these few lines: My First ASP script <% response.write "Hello, ASP World!" This should be $Response->Write("Hello ASP World"); Or better yet, you can use the shortcut method <%=$var%> like so: <% my $hello_string = "Hello ASP World"; %> ## <% ...%> evaluates perl code <%=$hello_string%> <%=..%> prints stuff to browser %> Please answer me to [EMAIL PROTECTED] Errors Output syntax error at (eval 14) line 41, near ""Hello, ASP World!" ## END ## $main::Response" , /usr/lib/perl5/site_perl/5.005/Apache/ASP.pm line 818 Debug Output STARTING ASP HANDLER (v0.09) for file /home/httpd/html/asp/first.asp GlobalASA package Apache::ASP::Compiles::_tmp_global_asa created $Application - SessionCookie - 6938529594b0bcf467de98c45b78ed4e new session state Apache::ASP::State=HASH(0x3c2e00) session not expired - time: 970480092; timeout: 970481261; tieing session - ASP object created - Application: Apache::ASP::Application=HASH(0x1b78ec); GlobalASA: Apache::ASP::GlobalASA=HASH(0x1b7874); Internal: Apache::ASP::State=HASH(0x34912c); Request: Apache::ASP::Request=HASH(0x1b782c); Response: Apache::ASP::Response=HASH(0x2bb9dc); Server: Apache::ASP::Server=HASH(0x1b7bc8); Session: Apache::ASP::Session=HASH(0x349234); app_start: 0; basename: first.asp; buffering_on: 1; cgi_do_self: 0; command_line: ; compile_error: ; compile_includes: ; cookie_path: /; debug: 2; debugs_output: ARRAY(0x3c2da0); dirname: /home/httpd/html/asp; errors: 0; errors_output: ARRAY(0x2c586c); filehandle: ; filename: /home/httpd/html/asp/first.asp; filter: 0; global: /tmp; group_refresh: 120; groups_refresh: 120; id: _home_httpd_html_asp_first_aspINLINE; mtime: 970480089; no_cache: ; no_headers: 0; no_session: ; no_state: 0; pod_comments: 1; r: Apache=SCALAR(0x1acf54); remote_ip: 192.168.1.111; secure_session: ; session_serialize: 0; session_timeout: 1200; soft_redirect: 0; stat_inc: 1; state_db: SDBM_File; state_dir: ./.state; state_manager: 10; compiling - package: _home_httpd_html_asp_first_aspINLINE; syntax error at (eval 14) line 41, near ""Hello, ASP World!" ## END ## $main::Response" , /usr/lib/perl5/site_perl/5.005/Apache/ASP.pm line 818 Compile Error syntax error at (eval 14) line 41, near ""Hello, ASP World!" ## END ## $main::Response" ASP to Perl Program 1: package Apache::ASP::Compiles::_home_httpd_html_asp_first_aspINLINE; 2: no strict; 3: use vars qw($Application $Session $Response $Server $Request); 4: 5: # allow developers to place modules in global directory 6: use lib qw(/tmp); 7: 8: # aliases here 9: sub exit { $main::Response->End(); } 10: 11: # handler gets called from ASP perl handler to run code 12: sub handler { 13: my($self, $routine) = @_; 14: 15: if($routine && ($routine ne "handler")) { 16: return &$routine; 17: } 18: $self = $routine = undef; 19: @_ = (); 20: 21: ### 22: ## Your ASP script has been parsed and inserted here !! 23: ### 24: 25: 26: $main::Response->Write( 27: ' 28: 29: My First ASP script 30: 31: 32: 33: 34: ' 35: ); 36: 37: ## CODE BEGIN ## 38: response.write "Hello, ASP World!" 39: ## END ## 40: 41: $main::Response->Write( 42: ' 43: 44: 45: ' 46: ); 47: 48: 49: ### 50: ## End script insert 51: ### 52: 53: $main::Response->End(); 54: } 55: 1; -- --- Carlos Ramirez + Boeing + Reusable Space Systems + 714.372.4181 --- - Someday I'll find that peer and reset his connection!
[ANNOUNCE] AxKit 1.0
I've finally managed to put AxKit 1.0 out, after a long run-up to the 1.0 release. There are a couple of known issues with XSP and a couple of other potential bugs still standing, but the API is now stable, and we can add further enhancements as "bug fixes" now. Despite these minor bugs, AxKit has proved to be very stable for production use, with no noticable memory leakage over time. Specific new features of 1.0 include: - Config directives now all documented in perldoc AxKit - XPathScript now much calls apply_templates if there is no output - New Filter provider allows AxKit to work with the output from Mason, Apache::ASP, or RegistryFilter scripts. - Improved error handling and reporting Please visit http://axkit.org/ for more information. For those who don't know, details of what AxKit is are below: AxKit is an XML Application Server for Apache. It provides on-the-fly conversion from XML to any format, such as HTML, WAP or text using either W3C standard techniques, or flexible custom code. AxKit also uses a built-in Perl interpreter to provide some amazingly powerful techniques for XML transformation. The emphasis with AxKit is on separation of content from presentation. The pipelining technique that AxKit uses allows content to be converted to a presentable format in stages, allowing certain platforms to see data differently to others. AxKit allows web designers to focus on web site design, content developers to work on a purely content basis, and webmasters to focus on their core competencies. AxKit is based on components that are replaceable. This allows the web site developer to create a completely custom XML Application Server based around the AxKit API. AxKit can either automatically provide caching facilities, or you can create your own cache handler, so that XML transformations (which can be time consuming) only happen when required. The toolkit also provides ability to build component based web sites, and dynamic content. Database integration is fully supported, allowing either deliver of XML from a database, or XML generation from a database query. Dynamic web components can be built using the Perl language, making the possibilities as infinite as CGI scripts, without the potential mess that CGI programming can cause. -- Fastnet Software Ltd. High Performance Web Specialists Providing mod_perl, XML, Sybase and Oracle solutions Email for training and consultancy availability. http://sergeant.org | AxKit: http://axkit.org
RE: Taint
Compile-time? You mean, when I compile Perl 5.6 I can permanently disable taint checking? -Original Message- From: Vivek Khera [mailto:[EMAIL PROTECTED]] Sent: Monday, October 02, 2000 11:04 AM To: Herrington, Jack Cc: '[EMAIL PROTECTED]' Subject: RE: Taint > "HJ" == Herrington, Jack <[EMAIL PROTECTED]> writes: HJ> Is there a way to enable and disable taint checking at run-time? No; taint mode is a Perl compile time decision.
Apache::Filter/::RegistryFilter/::Compress problem.
folks -- i'm wondering if anyone else has seen the following behaviour, and, if you have, how you dealt with it. here's the problem: i have a bunch (200 or so) CGI scripts being handled by Apache::RegistryFilter then Apache::Compress, i.e., SetHandlerperl-script PerlSetVarFilter On PerlHandler Apache::RegistryFilter Apache::Compress this typically works very well; however, on occasion i get the following error (reformatted): [Sun Oct 1 21:19:49 2000] [error] [Sun Oct 1 21:19:49 2000] null: Undefined subroutine &Apache::RegistryFilter::handler called at /usr/local/lib/perl5/site_perl/5.005/Apache/Compress.pm line 37. following this, any further registry requests made to this apache process result in this error. here are some details: - it isn't the case that only one or two CGI scripts cause this error; there is no clear culprit. - MaxRequestsPerChild is set to 10. - the request that first causes this error takes a long time (300 seconds or more) to complete. - this error only occurs on perhaps 3 requests in every 50k. - apache v1.3.9 on solaris 2.6 modperl 1.21 Apache::Filter 1.011 Apache::Compress 1.002 thanks for any suggestions, i appreciate your time. cheers, k. -- kevin montuori
RE: Taint
> "HJ" == Herrington, Jack <[EMAIL PROTECTED]> writes: HJ> Is there a way to enable and disable taint checking at run-time? No; taint mode is a Perl compile time decision.
Apache::ASP
I realy do not understand where is the problem! I attach the output that my internal server return when I try to execute these few lines: My First ASP script <% response.write "Hello, ASP World!"%> Please answer me to [EMAIL PROTECTED] Errors Outputsyntax error at (eval 14) line 41, near ""Hello, ASP World!"## END ##$main::Response", /usr/lib/perl5/site_perl/5.005/Apache/ASP.pm line 818Debug OutputSTARTING ASP HANDLER (v0.09) for file /home/httpd/html/asp/first.aspGlobalASA package Apache::ASP::Compiles::_tmp_global_asacreated $Application - SessionCookie - 6938529594b0bcf467de98c45b78ed4enew session state Apache::ASP::State=HASH(0x3c2e00)session not expired - time: 970480092; timeout: 970481261; tieing session - ASP object created - Application: Apache::ASP::Application=HASH(0x1b78ec); GlobalASA: Apache::ASP::GlobalASA=HASH(0x1b7874); Internal: Apache::ASP::State=HASH(0x34912c); Request: Apache::ASP::Request=HASH(0x1b782c); Response: Apache::ASP::Response=HASH(0x2bb9dc); Server: Apache::ASP::Server=HASH(0x1b7bc8); Session: Apache::ASP::Session=HASH(0x349234); app_start: 0; basename: first.asp; buffering_on: 1; cgi_do_self: 0; command_line: ; compile_error: ; compile_includes: ; cookie_path: /; debug: 2; debugs_output: ARRAY(0x3c2da0); dirname: /home/httpd/html/asp; errors: 0; errors_output: ARRAY(0x2c586c); filehandle: ; filename: /home/httpd/html/asp/first.asp; filter: 0; global: /tmp; group_refresh: 120; groups_refresh: 120; id: _home_httpd_html_asp_first_aspINLINE; mtime: 970480089; no_cache: ; no_headers: 0; no_session: ; no_state: 0; pod_comments: 1; r: Apache=SCALAR(0x1acf54); remote_ip: 192.168.1.111; secure_session: ; session_serialize: 0; session_timeout: 1200; soft_redirect: 0; stat_inc: 1; state_db: SDBM_File; state_dir: ./.state; state_manager: 10; compiling - package: _home_httpd_html_asp_first_aspINLINE; syntax error at (eval 14) line 41, near ""Hello, ASP World!"## END ##$main::Response", /usr/lib/perl5/site_perl/5.005/Apache/ASP.pm line 818Compile Errorsyntax error at (eval 14) line 41, near ""Hello, ASP World!"## END ##$main::Response"ASP to Perl Program 1: package Apache::ASP::Compiles::_home_httpd_html_asp_first_aspINLINE; 2: no strict; 3: use vars qw($Application $Session $Response $Server $Request); 4: 5: # allow developers to place modules in global directory 6: use lib qw(/tmp); 7: 8: # aliases here 9: sub exit { $main::Response->End(); } 10: 11: # handler gets called from ASP perl handler to run code 12: sub handler { 13: my($self, $routine) = @_; 14: 15: if($routine && ($routine ne "handler")) { 16: return &$routine; 17: } 18: $self = $routine = undef; 19: @_ = (); 20: 21: ### 22: ## Your ASP script has been parsed and inserted here !! 23: ### 24: 25: 26: $main::Response->Write( 27: ' 28: 29: My First ASP script 30: 31: 32: 33: 34: ' 35: ); 36: 37: ## CODE BEGIN ## 38: response.write "Hello, ASP World!" 39: ## END ## 40: 41: $main::Response->Write( 42: ' 43: 44: 45: ' 46: ); 47: 48: 49: ### 50: ## End script insert 51: ### 52: 53: $main::Response->End(); 54: } 55: 1;
RE: Taint
>> 4) How do I check the taint setting at run-time from a perl handler? >I'm not sure that you can. PerlTaintCheck On or Off applies to all perl >scripts/handlers... >see http://perl.apache.org/guide/porting.html#Taint_Mode The problem that I am having is that I am getting taint errors in mason without taint being turned on. So it makes me think that taint is actually on. Is there a way to enable and disable taint checking at run-time?
RE: Taint
> -Original Message- > From: Herrington, Jack [mailto:[EMAIL PROTECTED]] > Sent: Monday, October 02, 2000 12:59 PM > To: '[EMAIL PROTECTED]' > Subject: Taint > > > A couple of questions about taint checking. > > 1) What is the default taint check setting? off > > 2) Does compiling mod_perl with EVERYTHING=1 make a > difference to the taint > setting? no > > 3) Does 'PerlTaintCheck Off' actually work? yes > > 4) How do I check the taint setting at run-time from a perl handler? I'm not sure that you can. PerlTaintCheck On or Off applies to all perl scripts/handlers... see http://perl.apache.org/guide/porting.html#Taint_Mode HTH --Geoff > > Thanks! > > Jack Herrington > Engineering Manager > Certive - Building the world's first broadband B2B network > (650) 701-8809 >
Taint
A couple of questions about taint checking. 1) What is the default taint check setting? 2) Does compiling mod_perl with EVERYTHING=1 make a difference to the taint setting? 3) Does 'PerlTaintCheck Off' actually work? 4) How do I check the taint setting at run-time from a perl handler? Thanks! Jack Herrington Engineering Manager Certive - Building the world's first broadband B2B network (650) 701-8809
Awards and stuff
I read recently that webtechniques has an award pending for tools, and the Zope list just mentioned: http://www.linux-community.de/News/story?storyid=349 Any mod_perl evangelists interested? -- Dave Hodgkinson, http://www.hodgkinson.org Editor-in-chief, The Highway Star http://www.deep-purple.com Apache, mod_perl, MySQL, Sybase hired gun for, well, hire -
Re: Update: Re: PerlSendHeader Off & socket persistence (was Re:question: usingApache for non-HTML messages)
Why would the lack of a $r->send_http_header call cause socket persistence to go away? I was under the impression that $r->send_http_header only affected what was sent to the client, but appearantly it affects Apache's socket handling as well. When I don't use $r->send_http_header, my sockets are dying after Apache's response to the 1st query...dying from the apache side, not the client side. I have my test client hard-coded to keep the socket open and send keepalives on every request. Since I don't want the server to send headers, but I want socket persistence, I'm in a bind. I've tried tracing through the apache source and commenting out stuff I don't need (manually removing headers, the ugly way). However I cannot find the code segiment that prints the outbound hexidecimal message size (which I also want to remove), so I'm stuck for the moment. It seems I need to know 1 of 2 things: 1) How do you keep sockets open when $r->send_http_header isn't used 2) how can I make apache stop printing the outbound message size on each response Any help will be appreciated! Brian Doug MacEachern wrote: > On Thu, 28 Sep 2000, B. Burke wrote: > > > Once I changed how I was printing the header from the script, the socket > > persistence > > worked with PerlSendHeader Off. So I guess I solved my problem although I don't > > really > > know why. > > because CGI.pm will trigger a call to $r->send_http_header, regardless of > PerlSendHeader settings. whereas: "print Content-type: text/html\n\n"; > will not, unless PerlSendHeader is On.
Re: auth headers & logging
On Mon, 2 Oct 2000, Matthew Byng-Maddick wrote: > Given that filling the notes table is the standard method for things to be > logged, then is there much of a performance overhead. You might even be > able to pass data using notes to the standard apache logging mechanism, > although I'm not the right person to know quite how to do this. Ok, after some extra reading I don't think it's going to be that bad. I simply created a note and changed the LogFormat directive in my conf file to log that in place of the authentication header. Thanks, -- steven
RE: CyberCash and mod_perl Experiences
Thanks for the info and code. That is essentially what I was doing as well. I was just getting a lot of errors. Looking further into their code, they're misspelling a lot of their own variable names and have some incorrect regex syntax. Lots of "Use of uninitialized value in concatenation...", "Use of unitialized value in substitution..." filling up my httpd error log. It may be that I'm doing some thing wrong, so I'll start from scratch and see where I can get. Some of my frustration has to do with their goofy installation locations. They want me to put the .pm's under a cgi-bin directory, which I don't have since all my dynamic pages run from ContentHandlers. I guess what I really wanted was a library that installed like most other Perl Modules, that didn't require outside binaries and other such things. They're only making an http request to their own server with a message that has been encrypted using DES3. It just seems like that could be done in a much easier way than they seem to be doing it. For example, they use Socket to do the connection, when it seems like LWP would encapsulate it very well. Same thing with the external encryption binaries and the Crypt modules. And yet, I paid their setup fee, so I feel like I've paid for their software to work the way I wanted and rewriting it is effort I shouldn't have to make. I feel like I'm dealing with Microsoft. Thanks everyone for listening to me rant. I'll keep you posted on what I come up with. I'm toying with the idea of writing an CyberCash module for the Business::OnlinePayment interface. Anyone have any idea where to start? RYAN
Re: auth headers & logging
On Mon, 2 Oct 2000, steven wrote: > I'm rewriting authentication headers on the fly and those rewritten > headers are being logged, but I would like to log the details supplied by > the client as opposed to what I've rewritten them as. I thought of writing > a logging module and passing it a note, but it seems a bit long-winded and > I'm worried about the performance overhead. Is there a more efficient way > of doing this? Given that filling the notes table is the standard method for things to be logged, then is there much of a performance overhead. You might even be able to pass data using notes to the standard apache logging mechanism, although I'm not the right person to know quite how to do this. MBM -- The power to destroy a planet is insignificant when compared to the power of the Force. -- Darth Vader
auth headers & logging
Hi, I'm rewriting authentication headers on the fly and those rewritten headers are being logged, but I would like to log the details supplied by the client as opposed to what I've rewritten them as. I thought of writing a logging module and passing it a note, but it seems a bit long-winded and I'm worried about the performance overhead. Is there a more efficient way of doing this? Thanks, -- steven
Re: CyberCash and mod_perl Experiences
I have been using version 3.2.0.4, it definately leaves something to be desired. Insecure /tmp files, C-ish coding style, no good testing facilities, it goes on. One thing to note about the perfectly valid cards failing randomly: one time for a few months one time of credit card would fail no matter what ( forgot which ), because they had a broken gateway. Also, they don't seem to notify of outages or anything of that nature. Vivek Khera ([EMAIL PROTECTED]) was saying: > > "YR" == Yann Ramin <[EMAIL PROTECTED]> writes: > > YR> CyberCash is not reliable. Perfectly valid credit cards fail auth > YR> at times, and the service has a tendancy to crap out. What the > YR> book suggested to do was to have a backend which goes and queries > > This has never been my experience with cybercash. We were one of their > first customers, and though things were hard to set up in those dark > days, their latest incarnation of the software is quite trivial to > install and use (once you figure out how to program it). It involves > three Perl modules (pure perl, even) to be installed. Then you just > "use" the appropriate one, and call the right function. > > -- > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= > Vivek Khera, Ph.D.Khera Communications, Inc. > Internet: [EMAIL PROTECTED] Rockville, MD +1-301-545-6996 > GPG & MIME spoken herehttp://www.khera.org/~vivek/ -- [EMAIL PROTECTED] "With pain comes clarity."
Re: CyberCash and mod_perl Experiences
> "RA" == Ryan Adams <[EMAIL PROTECTED]> writes: RA> I'm trying to integrate CyberCash with a shopping system that we've RA> developed in-house using mod_perl almost exclusively. I haven't been RA> particularly impressed with the way it installs. We're on a Linux machine RA> and it has a very NT-centric design, in my opinion. I never felt that way. It consists entirely of installing 3 *.pm files and a config file if I recall correctly. RA> I have been able to get test scripts to run from the command-line RA> and through basic mod_cgi execution, but I can't get consistent RA> results when executing them via mod_perl ContentHandlers. In I used CyberCash from registry scripts without ever having any problems. We used the "authcapture" method. It took a long time to refine the error checking, but once done it was quite reliable. We only ever had failures when the credit card was bad or typed incorrectly by the user. RA> looking through their library files, they are doing some RA> IPC::Open2 calls to executables and some other pretty ugly stuff RA> that may or may not be causing the problems. I don't recall them calling external routines, but it has been a little while since I last checked. RA> Does anyone have experience doing this? What approach did you RA> take? Any good documentation? I've read all the CyberCash stuff, RA> but it hasn't given me the kind of answers I wanted. No good documentation. I can send you the snippet of my program that did the CyberCash call(s) and checked return status. Heck, I'll just post it here. Obviously, you'll have to fill in the details and change the data structure that holds your order info to be what you use, not what we use. # CyberCash config file my $cychConfigFile = '/path/to/merchant/mck-cgi/conf/merchant_conf'; use CCMckDirectLib3_2 qw(SendCC2_1Server); use CCMckLib3_2 qw(InitConfig); if (&InitConfig($cychConfigFile)) { return "Failed to initialize CyberCash config. Contact administrator!"; } # fix up some values for CyberCash program $orderInfo->{card_exp} =~ s|(\d{1,2})/(\d\d)(\d\d)|$1/$3|; # remove century $orderInfo->{card_number} =~ s/\D//g; # remove non-digits (blanks) # now charge credit card my %result = &SendCC2_1Server('mauthcapture', 'Order-ID', "${oidprefix}${orderid}", 'Amount', "usd $orderInfo->{total}", 'Card-Number', $orderInfo->{card_number}, 'Card-Name', $orderInfo->{bill_name}, 'Card-Address', $orderInfo->{bill_addr1}, 'Card-City', $orderInfo->{bill_city}, 'Card-State', $orderInfo->{bill_state}, 'Card-Zip', $orderInfo->{bill_zip}, 'Card-Country', $orderInfo->{bill_country}, 'Card-Exp', $orderInfo->{card_exp}); if ($result{"MStatus"} =~ m/^failure/i) { # mark order as "failed" -- ignore error $statush->execute('failed',$orderInfo->{card_number}, "$result{MErrMsg} ($result{MErrLoc})",$orderid); if ($result{"MErrLoc"} =~ m/BANK|CCSP/i) { return "OID $orderid: Card Declined."; } else { # if ($result{"MErrLoc"} =~ /CLIENT|MPMT|CCSRVR|SMPS/i) return "OID $orderid ERROR: $result{MErrMsg} ($result{MErrLoc})"; } } # catch non-successful, non failure-hard errors whatever they may be. if ($result{'MStatus'} ne "success") { # do not mark as failed, since this is usually transient error return "OID $orderid TRY AGAIN: $result{MErrMsg} ($result{MErrLoc})"; } # mangle CC number so we don't use it again $orderInfo->{card_number} =~ s/^(\d{2})(\d+)(\d{4})$/$1\*$3/; $ccstatus = "Auth Code: $result{'auth-code'}"; # if you get this far, you have the money.
Re: Way it is so copmplicated
> I am developing computer software for more than 30 years. > Yet not able to install even the minimal support for ASP using APACHE > on WIN95 platform (which is no doubt, the most popular in the world). Well we've all had problems when installing things for the first time, that's what this list is for, you'll find a lot of help here, provided you don't troll that is. Of course the Win95 platform may not be the best choice for a web server, in fact Microsoft recommends you use NT or 2000 for servers. > I do believe that there are a lot of persons getting salaries from > "APACHE ORG". This is of course totally untrue. "apache.org" doesn't even exist as a legal entity, it's just a domain name. The ASF (Apache Software Foundation) does not pay salaries to its members. > Is it not reasonable that some of them are paid by Microsoft to make thinks > complicated, to slow Linux penetrating ? No, it isn't. One of the major goals of the current rewrite of Apache (version 2.0) is to make it very portable, and to achieve the same level of performance under Windows version 1.3 has under Unix. -- Eric
Re: Way it is so copmplicated
On Mon, 2 Oct 2000, - wrote: > I am developing computer software for more than 30 years. > Yet not able to install even the minimal support for ASP using APACHE > on WIN95 platform (which is no doubt, the most popular in the world). Not for web serving. Please read the note about Windows on the Apache web site. Win95 is fundamentally broken for anything more than simple web serving. Even Microsoft's PWS for Win95 is extremely limited. (I really had better not be feeding a troll here, I haven't had much coffee yet...) > I do believe that there are a lot of persons getting salaries from > "APACHE ORG". I'm sure they wish that were the case. Most of the ASF members have day jobs. > Is it not reasonable that some of them are paid by Microsoft to make thinks > complicated, to slow Linux penetrating ? No. Thats a truly unfair and unjust label to pin on these people who have done incredible work for free. Remember that MS pump millions of dollars into developing IIS, ASP and VBScript. We don't have $$$, we just use our desire to "give something back". > It is the fight for freedom !!! I'm not sure whether to consider your post a troll or not. It certainly smells of one. If you have a specific problem with installing Apache::ASP then why don't you tell us what those problems are, instead of just saying "Its too hard". Maybe, just maybe, we can help you. -- Fastnet Software Ltd. High Performance Web Specialists Providing mod_perl, XML, Sybase and Oracle solutions Email for training and consultancy availability. http://sergeant.org | AxKit: http://axkit.org
Way it is so copmplicated
I am developing computer software for more than 30 years. Yet not able to install even the minimal support for ASP using APACHE on WIN95 platform (which is no doubt, the most popular in the world). I do believe that there are a lot of persons getting salaries from "APACHE ORG". Is it not reasonable that some of them are paid by Microsoft to make thinks complicated, to slow Linux penetrating ? It is the fight for freedom !!! Assil