Apache::Request->new() problem
I have the same problem as one of the previous reporters with Apache::Request->new(). The problem occurs whether I call it after a 'use' or after a 'PerlModule' load. Perl returns the no 'new' method could be found for Apache::Request. My setup is: Apache 1.3.12 mod_perl 1.24 Perl 6.5 Redhat 6.2 libapreq 0.31 Both Apache::Request and Apache::Cookie exhibit the same symptoms, and simply running this Perl script: use Apache::Request; my $apr = Apache::Request->new( $r ); Gives exactly the same response (as opposed to complaining about the unititliazed $r). Is there anywhere I can locate the original Apache::Request all-Perl code? Jack Herrington Engineering Manager Certive - Building the world's first broadband B2B network (650) 701-8809
Re: Can't locate object method "No" via package "such"
Doug MacEachern <[EMAIL PROTECTED]> writes: > On 4 Sep 2000, Alan E. Derhaag wrote: > > > I upgraded to openssl-0.9.5a and recompiled apache w/mod_ssl and > > mod_perl defining the SSL_BASE to the apache src and now the thing > > won't start and complains about: > > > > Can't locate object method "No" via package "such" at /dev/null line 1. > > looks to me like /dev/null is broken. if you run: > % cat /dev/null > Good try, but /dev/null is not broken on my machine. I finally gave up and eliminated the DSO version by compiling two versions of httpd. Both include mod_ssl but the Engine is only turned on with the light server. I did find a slight problem when running `configtest' but I doubt that that could have been the problem.
Re: question: using Apache for non-HTML messages
Really all you need to do is send your response back like you would any response, just without the HTML formatting. If you wanted to be a bit more "correct", you could change the content-type of the respose so that it is not 'text/html'. (In your case, you might just make one up like 'application/x-brians-spiffy-protocol' or whatever you think is appropriate preceded with 'x-'.) Or, if you wanted to debug it using a web browser, you could simply use 'text/plain', and your browser will display the raw result. It is important to note that Apache is an HTTP server, not an "HTML server". It is capable of serving any sort of serial content. So anyway, since it looks like you're using a registry script, you would merely start your output with : print "Content-type: " . $my_content_type . "\n\n"; # note the 2 newlines! and then proceed directly to your proprietary output. Make sense? David At 9.21 -0400 9/25/2000, B. Burke wrote: >Here is an example of what I'm looking to do. > >GET /perl/app.pl?MODE=search&CITY=Dallas&STATE=TX&ID=195302 HTTP/1.0 >Accept: text/html >User-Agent: MyTestClient1.0 >From: nowhere.com > >I want to replace the HTML request above with something like this: > >|MODE=search|CITY=Dallas|STATE=TX|ID=195302| > >I can hard code the handler to do GET's against only one script. The request >format >is VERY similiar to the arguments in a GET (all I really have to do is >translate the pipe). >I think for the response, all I need to do is remove the headers entirely, >and I can format >the script output to conform to our API (I don't need protocol headers for >requests nor >for responses). > >I've been able to basically remove the response headers by removing the >functionality >of ap_sen_header_field() before compiling Apache, but it would be nice to >have a >more eloquent solution through mod_perl. > >Thanks, >Brian > > >Matt Sergeant wrote: > >> On Mon, 25 Sep 2000, B. Burke wrote: >> >> > >> > I'm using Apache/1.3.11 with mod_perl/1.22 on an AIX platform to serve >> > as an application server, with persistent ties into a MySQL database. >> > >> > My company is using an in-house socket API for data transfers. The >> > request messages in our API are somewhat similiar to an HTML GET >> > request, in that we use tagged, delimited fields (pipe delimited >> > instead of & delimited). >> > >> > I have written a socket server gateway to act as a protocol converter, >> > to convert our API's requests into HTML GET's (and also convert the >> > HTML output into our API's response format). >> > >> > My question is this. Is it possible using mod_perl for me to >> > incorporate the protocol conversion into Apache itself? In other >> > words, can I strip out the need for HTML headers, and rewrite the >> > format of GET requests to comply with our proprietary API? I don't >> > know if this is something that I can do through mod_perl, or if I will >> > have to dig deeper into C and recompile a new server. >> > >> > Any help or ideas will be mucho appreciated! >> >> I don't think you'll actually have to re-write anything. Although an >> example of a transaction would be most helpful. All you have to do is >> setup mod_perl to handle the connection, Apache _should_ be able to handle >> the request if it looks enough like a GET request, and you should be able >> to respond to it with little enough information, provided your responses >> are also similar to HTTP responses (HTTP response code followed optionally >> by headers then the body). >> >> -- >> >> >> 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: open(FH,'|qmail-inject') fails
On Mon, 25 Sep 2000, Matt Sergeant wrote: > On Mon, 25 Sep 2000, Stas Bekman wrote: > > On Mon, 25 Sep 2000, Doug MacEachern wrote: > > > 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. > > Yup, you are right. The overall impact is important as well. > > * Benchmark to see the responce times. > > * Send lots of emails and watch to compare the overall impact. > And unfortunately you'll also miss certain issues with that too, unless > its a live system, for example DNS lookup issues with sending to different > hosts. The joys of benchmarking code when the network is involved! Plus the minor fact that email systems seem highly non-deterministic in general :) We have some code for London Transport, which seems to be very random about when it actually sends the email. MBM -- Tell me, O Octopus, I begs, / Is those things arms, or is they legs? / I marvel at thee, Octopus; / If I were thou, I'd call me us. -- Ogden Nash
Re: open(FH,'|qmail-inject') fails
On Mon, 25 Sep 2000, Matt Sergeant wrote: > On Mon, 25 Sep 2000, Stas Bekman wrote: > > > On Mon, 25 Sep 2000, Doug MacEachern wrote: > > > > > 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. > > > > Yup, you are right. The overall impact is important as well. > > > > * Benchmark to see the responce times. > > > > * Send lots of emails and watch to compare the overall impact. > > And unfortunately you'll also miss certain issues with that too, unless > its a live system, for example DNS lookup issues with sending to different > hosts. The joys of benchmarking code when the network is involved! Now I understand why do I get so much SPAM. People use it to test the network implication on the email sending. And since I get quite a lot of identical SPAM, it looks like it takes them a while to figure out the exact figures. So after all, I'm contributing to someone else by receiving all this SPAM. _ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] http://apachetoday.com http://jazzvalley.com http://singlesheaven.com http://perlmonth.com perl.org apache.org
Re: open(FH,'|qmail-inject') fails
On Mon, 25 Sep 2000, Stas Bekman wrote: > On Mon, 25 Sep 2000, Doug MacEachern wrote: > > > 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. > > Yup, you are right. The overall impact is important as well. > > * Benchmark to see the responce times. > > * Send lots of emails and watch to compare the overall impact. And unfortunately you'll also miss certain issues with that too, unless its a live system, for example DNS lookup issues with sending to different hosts. The joys of benchmarking code when the network is involved! -- 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: open(FH,'|qmail-inject') fails
On Mon, 25 Sep 2000, Doug MacEachern wrote: > 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. Yup, you are right. The overall impact is important as well. * Benchmark to see the responce times. * Send lots of emails and watch to compare the overall impact. _ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] http://apachetoday.com http://jazzvalley.com http://singlesheaven.com http://perlmonth.com perl.org apache.org
Re: open(FH,'|qmail-inject') fails
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.
Re: mod_perl guide corrections
Doug MacEachern <[EMAIL PROTECTED]> writes: > > my $args = $q->param; # hash ref > > you mean parms() ? the Apache::Request::parms hash ref is tied, so > there are still method calls, but less than calling params(), which does > extra stuff to emulate CGI::params. I just looked at line 21 from Request.pm; it looks like $q->param() returns the same thing as $q->parms does; but surely $q->parms is even better! > parms() is going to be renamed (to something less like params()) and > documented as faster than using the params() wrapper, in the next release. A new libapreq release? Great news! Here's YAP for libapreq - I added Dave Mitchell's memmem in multipart_buffer.c for better portability, and made some minor changes to apache_request.c to eliminate some unnecessary copying. I'd be glad to send you a url to a production server, if you'd like to see it in action. HTH, and thanks again. -- Joe Schaefer [EMAIL PROTECTED] SunStar Systems, Inc. diff -ur libapreq-0.31/c/apache_request.c libapreq/c/apache_request.c --- libapreq-0.31/c/apache_request.c Fri Jul 2 21:00:17 1999 +++ libapreq/c/apache_request.c Sun Sep 24 22:10:18 2000 @@ -64,8 +64,20 @@ for(x=0;str[x];x++) if(str[x] == '+') str[x] = ' '; } -static int util_read(ApacheRequest *req, const char **rbuf) +static int util_read(ApacheRequest *req, char **rbuf) { +/* could make pointer array (LoL) to capture growth + * p[1] -> [...\0] + * p[2] -> [\0] + * p[3] -> [..\0] + * + * would need hi-tech flushing routine (per string) + * also need a hi-tech reader. is it really worth the trouble? + * + * + * + */ + request_rec *r = req->r; int rc = OK; @@ -84,9 +96,9 @@ return HTTP_REQUEST_ENTITY_TOO_LARGE; } - *rbuf = ap_pcalloc(r->pool, length + 1); + *rbuf = ap_pcalloc(r->pool, length + 1); /* can we improve this? */ - ap_hard_timeout("[libapreq] util_read", r); + ap_hard_timeout("[libapreq] util_parse", r); while ((len_read = ap_get_client_block(r, buff, sizeof(buff))) > 0) { @@ -234,56 +246,56 @@ return req; } -static int urlword_dlm[] = {'&', ';', 0}; +/* static int urlword_dlm[] = {'&', ';', 0}; */ -static char *my_urlword(pool *p, const char **line) +char *my_urlword(ApacheRequest *req, char **line) { -int i; - -for (i = 0; urlword_dlm[i]; i++) { - int stop = urlword_dlm[i]; - char *pos = strchr(*line, stop); - char *res; - - if (!pos) { - if (!urlword_dlm[i+1]) { - int len = strlen(*line); - res = ap_pstrndup(p, *line, len); - *line += len; - return res; - } - continue; - } +char dlm[] = "&;"; +long int len; +char *word, *dlm_ptr; - res = ap_pstrndup(p, *line, pos - *line); +if (! *line) { return NULL; } - while (*pos == stop) { - ++pos; - } +dlm_ptr = strpbrk(*line, dlm); - *line = pos; +if (!dlm_ptr) { + word = *line; + *line = NULL; + return word; - return res; +} else { + *dlm_ptr = '\0'; + word = *line; + *line = dlm_ptr + 1; + return word; } - -return NULL; } -static void split_to_parms(ApacheRequest *req, const char *data) +static void split_to_parms(ApacheRequest *req, char *data) { request_rec *r = req->r; -const char *val; - -while (*data && (val = my_urlword(r->pool, &data))) { - const char *key = ap_getword(r->pool, &val, '='); +char dlm[] = "&;"; +char *word; +char *val; + +do { + word = my_urlword(req, &data); /* modifies data */ + + if (!(val = strchr( word, '='))) { + continue; /* ignores words w/o an = sign */ + } + + *val = '\0'; + ++val; - req_plustospace((char*)key); - ap_unescape_url((char*)key); req_plustospace((char*)val); ap_unescape_url((char*)val); + req_plustospace((char*)word); + ap_unescape_url((char*)word); + + ap_table_add(req->parms, word, val); - ap_table_add(req->parms, key, val); -} +} while ( data ) ; } @@ -293,7 +305,8 @@ int rc = OK; if (r->method_number == M_POST) { - const char *data, *type; + char *data = NULL; + const char *type; type = ap_table_get(r->headers_in, "Content-Type"); @@ -304,12 +317,13 @@ return rc; } if (data) { - split_to_parms(req, data); +split_to_parms(req, data); } + } if (r->args) { - split_to_parms(req, r->args); + split_to_parms(req, ap_pstrdup(r->pool,r->args)); } return OK; @@ -439,7 +453,7 @@ } if (r->args) { - split_to_parms(req, r->args); + split_to_parms(req, ap_pstrdup(r->pool,r->args)); } return OK; diff -ur libapreq-0.31/c/multipart_buffer.c libapreq/c/multipart_buffer.c --- libapreq-0.31/c/multipart_buffer.c Sat May 1 02:44:28 1999 +++ libapreq/c/multipart_buffer.c Fri Sep 22 02:14:25 2000 @@ -55,134 +55,180 @@ * */ +/* JS: 6/30/2000 + * This should fix the memory allocation issues, and handle client disconnects + * gracefully. Comments in the code should explain wh
Re: open(FH,'|qmail-inject') fails
On Mon, 25 Sep 2000, Doug MacEachern wrote: > On Fri, 8 Sep 2000, Stas Bekman wrote: > > > As Perrin has suggested, benchmark it an see what's faster. It's so > > simple. > > come on stas, benchmarking Net::SMTP vs. pipe to a program is nothing > close to simple, it is not something you can use Benchmark.pm to cover all > the bases (e.g. tcpserver forking, what happens after qmail-inject exits, > etc.) 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. At least that's what I meant by saying "benchmark it". _ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] http://apachetoday.com http://jazzvalley.com http://singlesheaven.com http://perlmonth.com perl.org apache.org
Re: Looking for docs for apache-2.0+perl
On Thu, 21 Sep 2000, Armand wrote: > Is it possible to build perl into apache-2.0 like the equivalent of 1.3 > with mod_perl. I've been looking and can't seem to find any reference > to it. it's under development, see: http://perl.apache.org/from-cvs/modperl-2.0/ discussion on [EMAIL PROTECTED]
Re: dir_config and Apache::Table confusion
On 21 Sep 2000, Bjørn Ola Smievoll wrote: > If I do this: > > $r->print($r->dir_config('key')); > > Then key is printed. > If I then do this: > > my $tab = $r->dir_config; > $r->print(Dumper($tab)); # Using Data::Dumper > > I get '$VAR1 = bless( {}, 'Apache::Table' )'; > It's empty, how come? works fine for me with this config: PerlSetVar foo bar SetHandler perl-script PerlHandler Apache::Registry Options +ExecCGI and test: use Data::Dumper; my $r = shift; $r->send_http_header; $r->print($r->dir_config('foo'), "\n"); my $tab = $r->dir_config; $r->print(Dumper $tab); outputs: bar $VAR1 = bless( { 'foo' => 'bar' }, 'Apache::Table' ); with mod_perl-1.24_01-dev, apache_1.3.13-dev, perl-current (5.7.0@7093)
Re: usemymalloc && mod_perl
On Sat, 16 Sep 2000, Ian Kallen wrote: > > I've seen some of the 'perl -V' outputs on this list over the years. Most > people have usermymalloc=n but I've a seen a number of Solaris cases that > have usemymalloc=y > > I have a system on Solaris 2.6 with usemymalloc=y and I have a very > infrequent bug that usually manifests iteslef as corrupted data at the > 64th byte (it can also happen at the 32nd byte!). It doesn't seem to > happen ever in single process mode but I have some data objects that > will consistently demonstrate this behavior with Apache forked (the bug > survives apache shutdowns/startups, so it's not just an errant child). > The other pieces of the puzzle: latest DBI, DBD::Oracle, Oracle 8.1.5 > > So, my question for this group: why would I want usemymalloc=y on Solaris > 2.6? Besides having to rebuild a somewhat complex mod_perl compile, I'm > not looking forward to rebuilding all libraries with XS code so any > insight as to the ins and outs of compiling w/ and w/o usemymalloc would > be much appreciated! > thanks, solaris system malloc will degrade your Perl performance a great deal. i'd be surprised if the bug is caused by Perl's malloc implementation. sounds more like buggy xs (or linked in library code) that is stepping out of bounds, duplicate free() or similar. purify would be the best tool to find the bug, but rather expensive if you don't have it already. can you tell us more about this data, like what structure it is, where it's passed around in what code?
Re: Value of ErrorLog directive via mod_perl
On 15 Sep 2000, Bjørn Ola Smievoll wrote: > I need to retrieve the value of the ErrorLog directive (i.e. the path > & filename of the error_log), but I can't find a way to do it with > mod_perl. (The C api equivalent is the error_fname field in the > server_rec struct). this patch should work. can you tell me why you need it so i can decide if this should be added to the distribution? Index: src/modules/perl/Server.xs === RCS file: /home/cvs/modperl/src/modules/perl/Server.xs,v retrieving revision 1.6 diff -u -r1.6 Server.xs --- src/modules/perl/Server.xs 1999/08/20 08:34:43 1.6 +++ src/modules/perl/Server.xs 2000/09/25 20:12:57 @@ -135,6 +135,16 @@ # char *names;/* Wildcarded names for HostAlias servers */ # char *virthost; /* The name given in */ +char * +error_fname(server) +Apache::Server server + +CODE: +RETVAL = server->error_fname; + +OUTPUT: +RETVAL + int timeout(server, set=0) Apache::Server server
Re: compile runs great but won't execute
On 15 Sep 2000, Alan E. Derhaag wrote: > apache_1.3.11 > mod_ssl-2.5.0-1.3.11 > mod_perl-1.24 > perl v5.6.0 > RedHat Linux 2.2.12-20 > > I compiled mod_ssl and mod_perl as DSOs and there were no errors.. a > few warnings but nothing really significant. When running configtest, > however, with the following in httpd.conf: > > LoadModule mod_perl libexec/libperl.so that should be "LoadModule perl_module" > AddModule mod_perl.c > > I get the result: > > Syntax error on line 146 of /usr/local/apache/conf/httpd.conf: > Can't locate API module structure `mod_perl' in file \ > /usr/local/apache/libexec/libperl.so: \ > /usr/local/apache/libexec/libperl.so: undefined symbol: mod_perl > > line continuations are mine. > > ..never seen this before! What defines mod_perl to the API? >
Re: mod_perl guide corrections
On 14 Sep 2000, Joe Schaefer wrote: > 2) Apache::Request is better than your performance numbers indicate. > > The problem I have with your comparison with Apache::args vs Apache::Request vs CGI > is that your benchmark code isn't fair. You're comparing method calls against > hash-table lookups, which is apples and oranges. To get more representative > numbers, try the following code instead > my $args = $q->param; # hash ref you mean parms() ? the Apache::Request::parms hash ref is tied, so there are still method calls, but less than calling params(), which does extra stuff to emulate CGI::params. parms() is going to be renamed (to something less like params()) and documented as faster than using the params() wrapper, in the next release.
Re: perl initialization per virtual host... is it possible
On Thu, 14 Sep 2000, William Deegan wrote: > When I do that a "SetEnv" in my virtual host doesn't seem to get > passed to the startup.pl... > > Is that the expected behavior? yes, SetEnv isn't passed until the request time fixup phase. try PerlSetEnv, which will be set at startup time outside of Directory/Location/Files/etc. sections.
Re: segfaulting httpd :(
On Thu, 14 Sep 2000, Bruce W. Hoylman wrote: > > > "Ben" == Ben Turner <[EMAIL PROTECTED]> writes: > > Ben> this afternoon i compiled a fresh httpd (apache 1.3.12), > Ben> together with mod_perl 1.24. i'm on Solaris 8, running perl > Ben> 5.6.0. > > Sounds like what I happened to just go through, finding perl 5.6.0 as > the (known) culprit. Go to: > > http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2000-06/msg00200.html > > and apply the supplied patch. It fixed my SIGSEGVs immediately. HTHYO. glad you found the patch/cure, i hope 5.6.1 hits the streets soon.
Re: tracking down why a module was loaded?;
On Thu, 14 Sep 2000, Justin wrote: > Can anyone tell me the easiest slickest way of determining > what was responsible for requesting a module, having discovered > that it has been loaded when viewing perl-status? override the builtin require with CORE::GLOBAL::require. something like the below prints a stacktrace to tell you where the require is called from. the two eval's are used to handle both "Foo.pm" and the bareword form of 'use Foo'. use Carp (); BEGIN { sub My::require { my $thing = shift; Carp::cluck($thing); eval { CORE::require($thing); } or eval "CORE::require($thing)"; die $@ if $@; } *CORE::GLOBAL::require = \&My::require; } sub blah { require Foo; } blah(); > and while I've got the podium: > I would like to congratulate Doug and > everyone involved in modperl.. by checking > pcdataonline.com, I found our entirely modperl site is > now #1850 in the top 10,000 websites, with over 10 million > *entirely dynamic* pages pushed out a month.. to half a > million unique users. This is a single Dell 2300 box with > two PII 450s cpus and a gig of memory.. (the mysql server > is on another box). Most pages are built between 20-100ms > of user time.. the same box runs backend and frontend > servers, serves images as well, plus a hunk of other > processes. great to hear, thanks for sharing that. > modperl is the best kept secret on the net. Shame! seems to generate plenty of list traffic for a "secret" ;)
[ANNOUNCE] HTTP::Monkeywrench 1.0 (new package)
The URL: http://sourceforge.net/project/showfiles.php?group_id=7560&release_id=11892 has entered CPAN as: file: $CPAN/authors/id/C/CN/CNATION/Monkeywrench-1.0.tar.gz size: 14849 bytes md5: 89e5c6aab819ad7781f842cf566f9acd HTTP::Monkeywrench is a web site testing utility. See http://opensource.cnation.com/projects/Monkeywrench/ for more information. - Although Monkeywrench is not written as a mod_perl application, it is tremendously useful to mod_perl developers, which is why I sent it to mod_perl. We developed Monkeywrench specifically because we needed to test our dynamic mod_perl sites. - Monkeywrench is a command line based application built for testing static or dynamic websites under development to test their integrity and report errors. - Monkeywrench works by letting you create 'test scenarios' which can be run against the site again and again. Test scenarios closely mimic a user going through your site performing specific actions like filling out a registration form, or ordering a product. It can then make sure each page had the desired results.
Re: Typo crashes Apache process
On Thu, 14 Sep 2000, Lupe Christoph wrote: > Hi! > > Sorry, I did not check if this is known problem. > > 8046b0c >perl_handler_ismethod(0x82b46c8,0x81e5f62,0x828ee0c,0x80e255c,0x82fa59c,0x82a5ce8) + >61 thanks for the solid report, but this is a bug long ago fixed in the cvs tree.
Re: tracking down segfaults
On Tue, 12 Sep 2000, Bill Moseley wrote: > Just a quick question: > > I'm running on Solaris 2.6 and mod_perl 1.21 and have these nagging > segfaults that I've asked about before. I get five or ten a day out of say > 20K requests. > > I need to upgrade to mod_perl 1.24 before spending a lot of time debugging. > My question is this: is there a more current version that I should use > that might include some of the patches posted here since 1.24 was released > that would be considered stable? Or should I stick with 1.24? > > I'm seeing this: > Undefined subroutine &Apache::RegistryNG->handler::handler > and > Can't locate object method "handler" via package "handler" you might want to try a cvs snapshot, or just the patch that was posted to change hard_timeout() usage to soft_timeout(), which could be the cause of this odd behavior. or wait for 1.25, which i really hope to have ready this week.
Re: open(FH,'|qmail-inject') fails
On Fri, 8 Sep 2000, Stas Bekman wrote: > As Perrin has suggested, benchmark it an see what's faster. It's so > simple. come on stas, benchmarking Net::SMTP vs. pipe to a program is nothing close to simple, it is not something you can use Benchmark.pm to cover all the bases (e.g. tcpserver forking, what happens after qmail-inject exits, etc.)
Re: Writing to the client's socket from an XS module
On Thu, 7 Sep 2000, Subhash Sankuratripati wrote: > Hello, > I would like to find out how can I write to the HTTP Client from an > XS module written in C being called from a Perl module running under apache. > > Even trying syswrite 1, "test" does not work from mod_perl. So > internally mod_perl is duping stdout to some other file handle and > eventually writing it to the accepted socket desc. from the client. mod_perl does not touch stdout. under cgi, stdout is connected to a pipe which is fed back to the client by mod_cgi, not the case with mod_perl. have a look at Apache::Peek on cpan, which redirects stderr to the client with a few defines: #ifdef MOD_PERL #include "modules/perl/mod_perl.h" #undef PerlIO #undef PerlIO_printf #undef PerlIO_vprintf #undef PerlIO_stderr #undef PerlIO_putc #undef PerlIO_puts #define PerlIO request_rec #define PerlIO_printf rprintf #define PerlIO_vprintf(r,fmt,vlist) \ vbprintf(r->connection->client, fmt, vlist) #define PerlIO_stderr() perl_request_rec(NULL) #define PerlIO_putc(r,c) rputc(c,r) #define PerlIO_puts(r,s) rputs(s,r)
RE: Can't locate object method "No" via package "such"
man null on Linux you need to do: mknod -m 666 /dev/null c 1 3 >-Original Message- >From: Doug MacEachern [mailto:[EMAIL PROTECTED]] >Sent: Monday, September 25, 2000 3:39 PM >To: Alan E. Derhaag >Cc: [EMAIL PROTECTED] >Subject: Re: Can't locate object method "No" via package "such" > > >On 4 Sep 2000, Alan E. Derhaag wrote: > >> I upgraded to openssl-0.9.5a and recompiled apache w/mod_ssl and >> mod_perl defining the SSL_BASE to the apache src and now the thing >> won't start and complains about: >> >> Can't locate object method "No" via package "such" at >/dev/null line 1. > >looks to me like /dev/null is broken. if you run: >% cat /dev/null > >you'll probably see something like "No such file or directory", >but of course /dev/null is always supposed to be empty. you should be >able to fix with: > >% sudo echo > /dev/null > >but that may only be a short-term fix if your /dev/null is >broken, i'm not >sure how to properly fix it. >
Re: Can't locate object method "No" via package "such"
On 4 Sep 2000, Alan E. Derhaag wrote: > I upgraded to openssl-0.9.5a and recompiled apache w/mod_ssl and > mod_perl defining the SSL_BASE to the apache src and now the thing > won't start and complains about: > > Can't locate object method "No" via package "such" at /dev/null line 1. looks to me like /dev/null is broken. if you run: % cat /dev/null you'll probably see something like "No such file or directory", but of course /dev/null is always supposed to be empty. you should be able to fix with: % sudo echo > /dev/null but that may only be a short-term fix if your /dev/null is broken, i'm not sure how to properly fix it.
Re: Apache::ASP rand, srand and fork...
On Tue, 19 Sep 2000, Joshua Chamas wrote: > Perhaps I should auto init srand() then for Apache::ASP > to make sure that its happening post fork? Something like > > if(! DONE FOR CURRENT PID) { >srand(); > } > > For reproducability within Apache::ASP, all that has to > happen is someone initializing it to srand(something) > in one of their scripts. > > This idea though I think would do well to be bundled > into modperl itself. Doug, what do you think? how about this patch which will override the builtin srand with a noop (Apache::srand) and call CORE::srand once per-child during child_init. Index: src/modules/perl/Apache.xs === RCS file: /home/cvs/modperl/src/modules/perl/Apache.xs,v retrieving revision 1.108 diff -u -r1.108 Apache.xs --- src/modules/perl/Apache.xs 2000/09/13 07:50:11 1.108 +++ src/modules/perl/Apache.xs 2000/09/25 19:15:51 @@ -540,6 +540,12 @@ Apache_terminate_if_done(r,sts); perl_call_halt(sts); +void +srand(...) + +CODE: +/*NOOP*/ + #in case you need Apache::fork # INCLUDE: fork.xs Index: src/modules/perl/mod_perl.c === RCS file: /home/cvs/modperl/src/modules/perl/mod_perl.c,v retrieving revision 1.126 diff -u -r1.126 mod_perl.c --- src/modules/perl/mod_perl.c 2000/09/01 05:23:17 1.126 +++ src/modules/perl/mod_perl.c 2000/09/25 19:16:05 @@ -591,6 +591,13 @@ perl_startup(s, p); } +static void override_core_global(char *name) +{ +GV *gv = gv_fetchpv(form("CORE::GLOBAL::%s", name), TRUE, SVt_PVCV); +GvCV(gv) = perl_get_cv(form("Apache::%s", name), TRUE); +GvIMPORTED_CV_on(gv); +} + void perl_startup (server_rec *s, pool *p) { char *argv[] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL }; @@ -771,10 +778,10 @@ #endif /* *CORE::GLOBAL::exit = \&Apache::exit */ -if(gv_stashpv("CORE::GLOBAL", FALSE)) { - GV *exitgp = gv_fetchpv("CORE::GLOBAL::exit", TRUE, SVt_PVCV); - GvCV(exitgp) = perl_get_cv("Apache::exit", TRUE); - GvIMPORTED_CV_on(exitgp); +/* *CORE::GLOBAL::srand = \&Apache::srand */ +if (gv_stashpv("CORE::GLOBAL", FALSE)) { +override_core_global("exit"); +override_core_global("srand"); } if(PERL_STARTUP_DONE_CHECK){ @@ -941,6 +948,7 @@ register_cleanup(p, args, perl_child_exit_cleanup, null_cleanup); mod_perl_init_ids(); +perl_eval_pv("CORE::srand()", TRUE); Apache__ServerStarting(FALSE); PERL_CALLBACK(hook, cls->PerlChildInitHandler); }
Re: Accessing images from a different server
Create an Alias to the vault30 directory in your httpd.conf file, like so: Alias /vault30 /vault30 -Carlos "Kairam, Raj" wrote: I have Apache 1.3.12 running on a HP-UX 11 (Machine_A). The document root is /usr/local/apache/htdocs. I need the ability to make images on a different HP-UX 10.20 (Machine_B) available for users from a web browser. The images are in a directory /vault30 which is exported on Machine_B and is nfs mounted on Machine_A. In other words from Machine_A I can cd to /vault30 and see the images ( 217359-0-2.tif) as if it is a local file. I have the file /usr/local/apache/htdocs/index.html which has the following line >From a browser, if the user gives the URL as http://Machine_A/index.html the browser should let him access the file 217359-0-2.tif. The browser has a plugin and that can view this file if it is actually there in /usr/local/apache/htdocs directory. Since the file is physically located on a different machine, despite the directory being nfs mounted, the browser fails to access that file. How do I make the Apache Server on Machine_A get to the file on Machine_B and make it available from the browser ?. Any advise on how to configure this in httpd.conf will be greatly appreciated. Thanks Raj Kairam -- --- Carlos Ramirez + Boeing + Reusable Space Systems + 714.372.4181 --- - Someday I'll find that peer and reset his connection!
RE: Accessing images from a different server
I have similar configurations, this is what I did: Mount image directory on machine_b to /usr/local/apache/htdocs/images on machine_a, link image files as /image/.tif. -Original Message- From: Kairam, Raj [mailto:[EMAIL PROTECTED]] Sent: Monday, September 25, 2000 8:19 AM To: '[EMAIL PROTECTED]' Cc: Kairam, Raj Subject: Accessing images from a different server I have Apache 1.3.12 running on a HP-UX 11 (Machine_A). The document root is /usr/local/apache/htdocs. I need the ability to make images on a different HP-UX 10.20 (Machine_B) available for users from a web browser. The images are in a directory /vault30 which is exported on Machine_B and is nfs mounted on Machine_A. In other words from Machine_A I can cd to /vault30 and see the images ( 217359-0-2.tif) as if it is a local file. I have the file /usr/local/apache/htdocs/index.html which has the following line >From a browser, if the user gives the URL as http://Machine_A/index.html the browser should let him access the file 217359-0-2.tif. The browser has a plugin and that can view this file if it is actually there in /usr/local/apache/htdocs directory. Since the file is physically located on a different machine, despite the directory being nfs mounted, the browser fails to access that file. How do I make the Apache Server on Machine_A get to the file on Machine_B and make it available from the browser ?. Any advise on how to configure this in httpd.conf will be greatly appreciated. Thanks Raj Kairam
RE: Why it prompt Multiple time for Authentication ???
Have you tried wrapping Apache::AuthenCache around Authen::Smb? It may help you out with the occasional communication issues with the backend PDC. Regards, Christian > -Original Message- > From: Jerrad Pierce [mailto:[EMAIL PROTECTED]] > Sent: Monday, September 25, 2000 10:54 AM > To: 'Sambit Nanda'; [EMAIL PROTECTED] > Subject: RE: Why it prompt Multiple time for Authentication ??? > > > This was covered previously, perhaps it should be covered in a FAQ? > > If your NT PDC is slow, occasionally an authentication > attempt will take too > long, > and return a status, which the module mistakenly regards as > an error and > reprompts > for authentication information > > >-Original Message- > >From: Sambit Nanda [mailto:[EMAIL PROTECTED]] > >Sent: Monday, September 25, 2000 11:51 AM > >To: [EMAIL PROTECTED] > >Subject: Why it prompt Multiple time for Authentication ??? > > > > > >Hi perl Experts > > > > Here is the problem : > > > > 1. I am using Apache 1.3.11 + openssl + mod _ssl + > >mod _perl + mod_php on my web server > > > > 2. I have the Module Installed call "Authen::Smb" > >for Authentication with Win NT PDC from Apache . > > > > > > Problem : I do not understand Some time My web > >server ask for Password repeated time for each session > >and some time it won't. I mean once u login and go > >to next page or location of the seem application it > >ask again the password. and some time it works very > >fine. > > > > What can be the Error. Why it happening so Funny.. > >?? > > > > > > 3. Is Multiple PDC Authentication Module with Apache > >released or Not ?? I need a kind attention of Joshu > >Gerth on this issue.. > > > >Any help would be appreciated > > > >Thanks > > > >Sambit Nanda > > > >Unix Admin > > > > > > > > > >__ > >Do You Yahoo!? > >Send instant messages & get email alerts with Yahoo! Messenger. > >http://im.yahoo.com/ > > >
RE: Why it prompt Multiple time for Authentication ???
This was covered previously, perhaps it should be covered in a FAQ? If your NT PDC is slow, occasionally an authentication attempt will take too long, and return a status, which the module mistakenly regards as an error and reprompts for authentication information >-Original Message- >From: Sambit Nanda [mailto:[EMAIL PROTECTED]] >Sent: Monday, September 25, 2000 11:51 AM >To: [EMAIL PROTECTED] >Subject: Why it prompt Multiple time for Authentication ??? > > >Hi perl Experts > > Here is the problem : > > 1. I am using Apache 1.3.11 + openssl + mod _ssl + >mod _perl + mod_php on my web server > > 2. I have the Module Installed call "Authen::Smb" >for Authentication with Win NT PDC from Apache . > > > Problem : I do not understand Some time My web >server ask for Password repeated time for each session >and some time it won't. I mean once u login and go >to next page or location of the seem application it >ask again the password. and some time it works very >fine. > > What can be the Error. Why it happening so Funny.. >?? > > > 3. Is Multiple PDC Authentication Module with Apache >released or Not ?? I need a kind attention of Joshu >Gerth on this issue.. > >Any help would be appreciated > >Thanks > >Sambit Nanda > >Unix Admin > > > > >__ >Do You Yahoo!? >Send instant messages & get email alerts with Yahoo! Messenger. >http://im.yahoo.com/ >
Why it prompt Multiple time for Authentication ???
Hi perl Experts Here is the problem : 1. I am using Apache 1.3.11 + openssl + mod _ssl + mod _perl + mod_php on my web server 2. I have the Module Installed call "Authen::Smb" for Authentication with Win NT PDC from Apache . Problem : I do not understand Some time My web server ask for Password repeated time for each session and some time it won't. I mean once u login and go to next page or location of the seem application it ask again the password. and some time it works very fine. What can be the Error. Why it happening so Funny.. ?? 3. Is Multiple PDC Authentication Module with Apache released or Not ?? I need a kind attention of Joshu Gerth on this issue.. Any help would be appreciated Thanks Sambit Nanda Unix Admin __ Do You Yahoo!? Send instant messages & get email alerts with Yahoo! Messenger. http://im.yahoo.com/
Accessing images from a different server
I have Apache 1.3.12 running on a HP-UX 11 (Machine_A). The document root is /usr/local/apache/htdocs. I need the ability to make images on a different HP-UX 10.20 (Machine_B) available for users from a web browser. The images are in a directory /vault30 which is exported on Machine_B and is nfs mounted on Machine_A. In other words from Machine_A I can cd to /vault30 and see the images ( 217359-0-2.tif) as if it is a local file. I have the file /usr/local/apache/htdocs/index.html which has the following line >From a browser, if the user gives the URL as http://Machine_A/index.html the browser should let him access the file 217359-0-2.tif. The browser has a plugin and that can view this file if it is actually there in /usr/local/apache/htdocs directory. Since the file is physically located on a different machine, despite the directory being nfs mounted, the browser fails to access that file. How do I make the Apache Server on Machine_A get to the file on Machine_B and make it available from the browser ?. Any advise on how to configure this in httpd.conf will be greatly appreciated. Thanks Raj Kairam
Re: question: using Apache for non-HTML messages
Here is an example of what I'm looking to do. GET /perl/app.pl?MODE=search&CITY=Dallas&STATE=TX&ID=195302 HTTP/1.0 Accept: text/html User-Agent: MyTestClient1.0 From: nowhere.com I want to replace the HTML request above with something like this: |MODE=search|CITY=Dallas|STATE=TX|ID=195302| I can hard code the handler to do GET's against only one script. The request format is VERY similiar to the arguments in a GET (all I really have to do is translate the pipe). I think for the response, all I need to do is remove the headers entirely, and I can format the script output to conform to our API (I don't need protocol headers for requests nor for responses). I've been able to basically remove the response headers by removing the functionality of ap_sen_header_field() before compiling Apache, but it would be nice to have a more eloquent solution through mod_perl. Thanks, Brian Matt Sergeant wrote: > On Mon, 25 Sep 2000, B. Burke wrote: > > > > > I'm using Apache/1.3.11 with mod_perl/1.22 on an AIX platform to serve > > as an application server, with persistent ties into a MySQL database. > > > > My company is using an in-house socket API for data transfers. The > > request messages in our API are somewhat similiar to an HTML GET > > request, in that we use tagged, delimited fields (pipe delimited > > instead of & delimited). > > > > I have written a socket server gateway to act as a protocol converter, > > to convert our API's requests into HTML GET's (and also convert the > > HTML output into our API's response format). > > > > My question is this. Is it possible using mod_perl for me to > > incorporate the protocol conversion into Apache itself? In other > > words, can I strip out the need for HTML headers, and rewrite the > > format of GET requests to comply with our proprietary API? I don't > > know if this is something that I can do through mod_perl, or if I will > > have to dig deeper into C and recompile a new server. > > > > Any help or ideas will be mucho appreciated! > > I don't think you'll actually have to re-write anything. Although an > example of a transaction would be most helpful. All you have to do is > setup mod_perl to handle the connection, Apache _should_ be able to handle > the request if it looks enough like a GET request, and you should be able > to respond to it with little enough information, provided your responses > are also similar to HTTP responses (HTTP response code followed optionally > by headers then the body). > > -- > > > 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: [OT] flock under win32
http://www.activestate.com/Products/ActivePerl/docs/lib/Pod/perlport.html#item_flock flock FILEHANDLE,OPERATION Not implemented (Mac OS, VMS, RISC OS, VOS). Available only on Windows NT (not on Windows 95). (Win32) and there is also this note in the same document: Don't open the same file more than once at a time for writing, as some operating systems put mandatory locks on such files.
Re: question: using Apache for non-HTML messages
On Mon, 25 Sep 2000, B. Burke wrote: > > I'm using Apache/1.3.11 with mod_perl/1.22 on an AIX platform to serve > as an application server, with persistent ties into a MySQL database. > > My company is using an in-house socket API for data transfers. The > request messages in our API are somewhat similiar to an HTML GET > request, in that we use tagged, delimited fields (pipe delimited > instead of & delimited). > > I have written a socket server gateway to act as a protocol converter, > to convert our API's requests into HTML GET's (and also convert the > HTML output into our API's response format). > > My question is this. Is it possible using mod_perl for me to > incorporate the protocol conversion into Apache itself? In other > words, can I strip out the need for HTML headers, and rewrite the > format of GET requests to comply with our proprietary API? I don't > know if this is something that I can do through mod_perl, or if I will > have to dig deeper into C and recompile a new server. > > Any help or ideas will be mucho appreciated! I don't think you'll actually have to re-write anything. Although an example of a transaction would be most helpful. All you have to do is setup mod_perl to handle the connection, Apache _should_ be able to handle the request if it looks enough like a GET request, and you should be able to respond to it with little enough information, provided your responses are also similar to HTTP responses (HTTP response code followed optionally by headers then the body). -- 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: [slightly OT] cache refusal problem with IE, http headers
I know this thread is rather lengthy, and took a few turns along the way, but I ran across this link the other day and thought it might be of use for everyone on the list - it's an official explanation of how IE handlers caching via headers. there's also a few links in it that are worth noting as well... http://support.microsoft.com/support/kb/articles/Q234/0/67.ASP HTH --Geoff > -Original Message- > From: Ime Smits [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, September 19, 2000 5:41 AM > To: [EMAIL PROTECTED] > Subject: [slightly OT] cache refusal problem with IE, http headers > > > Hi, > > I tried to nail this problem down for over 6 hours now. I use GD.pm to > dynamically generate images used in a dynamically generated > Apache::ASP > page. Each image is given a name which is unique (in fact: a > md5 on the > original name, width, height, color depth). Some of these > images are used in > a javascript onMouseOver. The images are send out to the browser via a > script, with the unique id as $ENV{PATH_INFO}. > > Now the odd thing is, both IE's I tried (4.01 and 5.5) seem > to /refuse/ to > cache the image oppsed to all Netscape versions, which handle > things like > expected. After searching deja, I found out that more people had this > problem, but I only read about javascript preloading and stuff. That's > already been taken care off. If I take a copy of those images > and let Apache > handle the request directly from disk, everything is ok. > > So I started to get suspicious about headers. I thought maybe > IE was choking > on the session-id cookie from Apache::ASP, so I rewrote the > Apache::ASP > gateway to plain mod_perl. I messed around with headers, even read > http://perl.apache.org/guide/correct_headers.html three > times, but nothing > fixed my problem so far. > > I know the problem is not really mod_perl related. I agree on > the fact that > this is probably a typical Microsoft inconsistancy. Maybe > some of you have > had the same problem. > > Below is a sample of the headers it returns. Any ideas? > Anything that is > communicated without me seeing it? > > Thanks, > > Ime > > > > > [ime@nobel /tmp]$ wget -S > http://192.168.31.1/mediaexporter.pl/ef6880b34b91e817f8c9973f0 e7efe10.png --10:55:32-- http://192.168.31.1:80/mediaexporter.pl/ef6880b34b91e817f8c9973f0e7efe10.png => `ef6880b34b91e817f8c9973f0e7efe10.png.86' Connecting to 192.168.31.1:80... connected! HTTP request sent, awaiting response... 200 OK 2 Date: Tue, 19 Sep 2000 09:21:34 GMT 3 Server: Apache/1.3.12 (Unix) mod_perl/1.21_03 4 Expires: Thu, 19 Oct 2000 08:52:50 GMT 5 Last-Modified: Tue, 19 Sep 2000 09:20:46 GMT 6 Cache-Control: public 7 ETag: ef6880b34b91e817f8c9973f0e7efe10 8 Content-Length: 294 9 Connection: close 10 Content-Type: image/png and here for the same image, but as a normal static file fron disk: HTTP request sent, awaiting response... 200 OK 2 Date: Tue, 19 Sep 2000 09:22:50 GMT 3 Last-Modified: Tue, 19 Sep 2000 09:22:10 GMT 4 Server: Apache/1.3.9 (Unix) mod_perl/1.21_03 5 ETag: "477b1-147-39b3889d" 6 Accept-Ranges: bytes 7 Connection: close 8 Content-Length: 327 9 Content-Type: image/png
question: using Apache for non-HTML messages
I'm using Apache/1.3.11 with mod_perl/1.22 on an AIX platform to serve as an application server, with persistent ties into a MySQL database. My company is using an in-house socket API for data transfers. The request messages in our API are somewhat similiar to an HTML GET request, in that we use tagged, delimited fields (pipe delimited instead of & delimited). I have written a socket server gateway to act as a protocol converter, to convert our API's requests into HTML GET's (and also convert the HTML output into our API's response format). My question is this. Is it possible using mod_perl for me to incorporate the protocol conversion into Apache itself? In other words, can I strip out the need for HTML headers, and rewrite the format of GET requests to comply with our proprietary API? I don't know if this is something that I can do through mod_perl, or if I will have to dig deeper into C and recompile a new server. Any help or ideas will be mucho appreciated! Thanks, Brian Burke [EMAIL PROTECTED]
Re: [ANNOUNCE] new module ApacheBench
On Thu, 21 Sep 2000, Adi wrote: > It took a little longer than planned, but here it is. It is a Perl API to > the Apache ab tool. It took so long because we added a number of useful > features, mainly the ability to benchmark sequences of URLs instead of just > one. Very nice Adi! > Before I upload it to CPAN, are there any objections to calling it > "ApacheBench"? Other names I considered are "Bench", "ab", "ABuse"... but > ApacheBench I thought was the best because an m/Apache/ search on CPAN will find > it. That's the proper name, since it's a glue code for ab, plus extra fuctionality. The only thing I'd add is a prefix so we could put other Benchmarking implementation under the same tree. Especially as you have mentioned in the pod it's not mod_perl specific. I'd go for HTTPD::Bench:: or HTTPDBench:: tree. But you have already released it on CPAN, so I don't know... (I couldn't reply earlier since I was preaching mod_perl at YAPC::Europe, which was a very cool conference :) > Stas, hopefully I'll be able to integrate this with your new Apache::Benchmark > module. I haven't had time to look over yours fully, but I'm thinking your > module will be a layer around this. Currently Apache::Benchmark uses ab, > right? This module almost completely replaces ab. There are a few features > that still need to be added. Yup, cool. In fact you are welcome to take over it :) Apache::Benchmark shouldn't be depenfing on the actual engine used for Benchmarking. One should be able to plug any engine instead of ab. > Here are the first few sections of the manual. Download the full package at > http://adiraj.org/sw/ApacheBench/ApacheBench-0.5.tar.gz. Enjoy. > > -Adi > > --- > > NAME >ApacheBench - Perl API for Apache benchmarking and >regression testing. > > SYNOPSIS > use ApacheBench; > > my $b = ApacheBench->new; > > # global configuration > $b->config({ > concurrency => 5, > priority => "run_priority", > }); > > # add sequence(s) of URLs to request > $b->add({ > repeat=> 10, > cookie=> ["Login_Cookie=b3dcc9bac34b7e60;"], > urls => ["http://localhost/one", > "http://localhost/two"], postdata => [undef, undef], > order => "depth_first", > }); > > my $regress = $b->execute; > > # calculate hits/sec == ($#urls+1)*$n*1000 / total_time > print (2*10*1000/$regress->{"total_time"})." req/sec\n"; > > # dump the entire regression hash (WARNING, this could be a LOT OF > DATA) > use Data::Dumper; > my $d = Data::Dumper->new([$regress]); > print $d->Dumpxs; > > GOALS >This project is meant to be the foundation for a complete >benchmarking and regression testing suite for an advanced, >transaction-based mod_perl site. We need to be able to >stress our server to its limit while also having a way to >verify the HTTP responses for correctness. Since our site >is transaction-based (as opposed to content-based), we >needed to extend the single-URL ab model to a multiple-URL >sequence model. > >ApacheBench is based on the Apache 1.3.12 ab code >(src/support/ab.c). > >Note: although this tool was designed to be used on an >Apache mod_perl site, it is generally applicable to any >HTTP-compliant server. Beware, however, that it sends a >high volume of HTTP requests in a very short period of >time, which may overwhelm some weaker HTTP server >platforms like NT/IIS. > > DESCRIPTION >ApacheBench sends sequences of HTTP requests to an HTTP >server and keeps track of the time taken to receive a >response, the data that was returned, the size of the data >that was returned, and various other bits of information. > >Since it is implemented in C, it sends HTTP requests in a >tight loop which can stress your server to 100% capacity, >especially if invoked in multiple concurrent instances. >It gives accurate time measurements down to the >millisecond for each HTTP request-response interval. > >Included is a simplified re-implementation of ab using the >ApacheBench Perl API. This should help get you started >with ApacheBench. > > METHODS >new() >The constructor. It takes no arguments. > >config({ %global_params }) >Global configuration method. Should only be invoked >once, else previous configuration parameters will be >clobbered. See the global configuration section for >details on how %global_params should be structured. > >add({ %run_params }) >Run configuration method. Can
Re: indexing and searching documents on your web server
> If you want something controllable via mod_perl then there are a couple of > things in the CPAN, under the DBIx hierarchy. If you're not bothered about > direct control, then you should check out htDig. one of these is DBIx::FullTextSearch - it does require a MySQL database though. it offers must include, can include, cannot include words, phrases, stop words and stemming. for more information, check out http://sourceforge.net/projects/fulltextsearch/
Re: Apache::Request server error??
On Mon, 25 Sep 2000, Sophokles Zafeiris wrote: > I' m trying to run the file_upload.pl. script, that can be found in the eg > directory of the Apache::Request source file. I've installed the > Apache::Request but I get the following server error : > Can't locate object method "new" via package "Apache::Request" at > /export/home0/www/cgi-bin/file_upload.pl.cgi line 8. > Can anyone help me?? The most obvious mistake is that you haven't 'use'd or 'PerlModule'd Apache::Request. This will often result in the above kind of error. MBM -- Tell me, O Octopus, I begs, / Is those things arms, or is they legs? / I marvel at thee, Octopus; / If I were thou, I'd call me us. -- Ogden Nash
Apache::Request server error??
I' m trying to run the file_upload.pl. script, that can be found in the eg directory of the Apache::Request source file. I've installed the Apache::Request but I get the following server error : Can't locate object method "new" via package "Apache::Request" at /export/home0/www/cgi-bin/file_upload.pl.cgi line 8. Can anyone help me?? (I need desperately a working script that uploads files from the web, which can be used from Macintosh) Sophokles