Re: search engine for the Guide

2000-05-04 Thread Jeremy Howard

At 01:28 PM 5/4/00 +0300, Stas Bekman wrote:
>Two things:
>
>1) I'd better concentrate on improving the content and structure of the
>Guide and will leave this search engine task to someone who needs to use
>the Guide but find it unusable without the proper search engine.
>
>2) perl.apache.org doesn't have mod_perl installed, so it's better to use
>some other site. I don't have any.
>
I'd be happy to host a search engine on my site. I'm not prepared to write one from 
scratch though, so if anyone has any suggestions of what the best 'off-the-shelf' 
solutions are I'd love to hear.

One option is to use Google. Have a look at this link

(put it on one line, of course). It highlights the searched terms ('mod_perl' 'guide' 
in this case). Google doesn't allow searches within a site. However, if the same 
unique string were placed on each page of the guide, adding that string to the search 
query would only return hits from the guide. I think the best way to do this would be 
to create a custom search page that links to Google, and automatically includes the 
unique string in the request.

Of course, if there are any free search tools that provide this functionality and come 
with source, that would be even better!



Re: Problem with deleting uploaded files

2000-05-04 Thread Srinidhi Rao S

Hi ken,
 I tried using upload. everything works fine. But the image uploaded
will be corrupted and the temp file created in the present directory wount
get deleted.  I searched in the binaries of CGI, but nothing helped me.
   I am using win98 os for Apache. Is it something to do with this.
Hope you help me out
TIA
srini.

-Original Message-
From: Ken Y. Clark <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Friday, May 05, 2000 1:42 AM
Subject: Re: Problem with deleting uploaded files


>On Thu, 4 May 2000, Srinidhi Rao S wrote:
>
>> Hi all,
>> Here I have a problem. I used CGI module to upload a file. But the
>> problem is that the temp file created by CGI module is not getting
>> deleted even after execution finished. It simply getting heaped in
>> temp directory eating memory. Can anyone please give me a way through
>> this???
>> Here is a part of code I have written
>>
>> use CGI;
>> use CGI qw (:standard);
>> use CGI::Carp qw (fatalsToBrowser);
>>
>> $CGI::POST_MAX=1024 * 350;
>>  my $QObject = new CGI;
>>  print $QObject->header;
>>  $file_name = $QObject->param('upload');
>>
>>  open (FILE,">../xxx.jpeg") || die "cannot open the image file\n";
>>  while(read($file_name,$data,1024))
>>

>>   print FILE $data;
>>   }
>>  close(FILE);
>>  print "Success";
>>
>> I also have one more problem. If I upload a Image file, the image will
>> be corrupted in the uploaded file. Why is this hapenning?  Any help is
>> hugely appriciated.
>
>from `perldoc CGI`:
>
>STARTING AND ENDING A FORM
>   
>   multipart/form-data
>   This is the newer type of encoding introduced by
>   Netscape 2.0.  It is suitable for forms that contain
>   very large fields or that are intended for
>   transferring binary data.
>
>also:
>
>
>   To be safe, use the upload() function (new in version
>   2.47).  When called with the name of an upload field,
>   upload() returns a filehandle, or undef if the parameter
>   is not a valid filehandle.
>
>$fh = $query->upload('uploaded_file');
>while (<$fh>) {
>  print;
>}
>
>   This is the recommended idiom.
>
>there's some more info there.  do perldoc and then search for "binary."
>
>ky
>
>
>
>
>


--
Robosoft Technologies, Mangalore, India





how to get Devel::Symdump working with mod_perl code?

2000-05-04 Thread Tom Roche

I'm trying to use Devel::Symdump to document code, but Perl
is choking when it hits (what appears to me to be) autoloadable
stuff. I'd like to know how to invoke (or patch, or whatever) Perl in
such a way so as to ignore such problems (or perhaps merely warn/carp
about them), or how to run Devel::Symdump under Apache.

I've started working on a project that has several 10**4 lines of cgi
Perl currently running on a Netscape server. We're porting it to
mod_perl on Apache, and meanwhile trying to document the code, learn
more about it, and better structure it. (The code is pretty much just
one big collection of subroutines.) Note that the mod_perl code is
currently running in a development environment (separate database,
webserver, etc).

Among the data I'd like to acquire, for each user-defined subroutine
in each source file, are

1 a list of the variables used within the subroutine

2 a list of all the user-defined subroutines called within the
  subroutine

I've checked out all the source files into an offline directory (not
in Apache space). I've got a tags script that will get a list of all
the subroutines defined in each file, as well as do (1), but not
(2). Symdump seems like it should provide both. However, before I can
use it I've got to get Perl to load the code, hence the problem.

To learn more about Symdump I've written a driver, sub_scanner.pl, and
an auxilliary Loader.pm. Loader merely require's all our scripts.
sub_scanner require's Loader and Devel::Symdump, then tries to use the
latter as illustrated in the Symdump POD:

> @packs = qw(Loader);
> # $obj = Devel::Symdump->new(@packs);# no recursion
> $obj = Devel::Symdump->rnew(@packs);   # with recursion

> # Methods
> @packages = $obj->packages;
> @scalars = $obj->scalars;
> @arrays = $obj->arrays;
> @hashes = $obj->hashes;
> @functions = $obj->functions;
> @ios = $obj->ios;
> @unknowns = $obj->unknowns;

> @todo = (\@packages,
>  \@scalars,
>  \@arrays,
>  \@hashes,
>  \@functions,
>  \@ios,
>  \@unknowns);

> foreach $ref (@todo) {
>   foreach $item (@$ref) {
> print STDOUT "$item\n";
>   }
>   print STDOUT "\n";
> }

Unfortunately Loader, or rather Perl, is having a problem with
Apache::DBI.pm. The first source file require's OK. The second source
file, GetDBs.pm, use's Apache::DBI(), line 202 of which is

> ) if ($INC{'Apache.pm'} and Apache->module('Apache::Status'));

When I do 'perl sub_scanner.pl' (or just 'perl Loader.pm') I get

> Can't locate object method "module" via package "Apache" at
> /external/apps/perl5/lib/site_perl/5.005/Apache/DBI.pm line 202.
> BEGIN failed--compilation aborted at
> /external/apps/apache/mod_perl/dev/GetDBs.pm line 7.

Yet this same code runs under mod_perl, so I assume its interpreter must
be
doing something differently. Is there a way to get my "normal" Perl to
behave similarly, and load the code for Symdump to do its thing? Is
there a way Symdump can access the Apache interpreter's symbol table?
Is there some entirely different way to do what I'm trying to do?

Please reply directly to me as well as the list/group, and TIA,
[EMAIL PROTECTED]



Re: search engine for the Guide

2000-05-04 Thread Gunther Birznieks

I would think that apache.org would provide a free open source search 
engine as an infrastructural resource? Can't we take advantage of that? Or 
is perl.apache.org not actually part of apache.org infrastructure?

It seems to me that a lot more apache.org sites would benefit rather than 
perl.apache.org so it could be a shared resource. As for the programmatic 
characters not being recognized-- I think we kind of get used to that. It 
is a pain, but better a poor search than no search. I have actually wished 
for searching myself for just simple things here and there.

That's another thing that makes the full print out version (PDF) so nice is 
that you can do a Find

At 01:28 PM 5/4/00 +0300, Stas Bekman wrote:
>On Thu, 4 May 2000, Matt Sergeant wrote:
>
> > On Thu, 4 May 2000, Stas Bekman wrote:
> >
> > > > Yes. On some of the search engines (AltaVista springs to mind) you can
> > > > search for things on particular web sites, or even links to 
> particular web
> > > > sites. So as long as AltaVista keeps its search contents up to 
> date, you
> > > > can leverage their engine. IIRC either Randall or Lincoln did a
> > > > WebTechniques article about this a few months ago.
> > >
> > > Oh, I see.
> > >
> > > But I want to stress these 2 points:
> > >
> > > 1) Currently each chapter in the Guide is a huge document, so doing 
> search
> > > and having a hit, doesn't really help as you still have to go thru the
> > > page to find the exact section that you want to read. So I think we 
> want a
> > > search engine that's not working with the master version per se, but with
> > > a copy which has name anchors for each line and:
> > >
> > >   a. can bring you to exact line with match
> > >   b. have the keyword highlighted
> > >
> > > 2) Most of the search engines have problems with keywords including
> > > non-alpha chars, like if you search for Apache::Registry you will end up
> > > searching for Apache and Registry since :: is ignored. Now think about
> > > '$r->print' 'BEGIN {', '$@', etc. All these are must for the doc with 
> many
> > > non-alpha characters which should be searched for.
> > >
> > > What do you think?
> >
> > You seem to have it all worked out. I look forward to seeing your search
> > engine ;-)
> >
> > Seriously though, I have a search engine in the works, however I don't
> > know how well it will apply to your scheme above. It looks like you're
> > going to be better off writing one yourself. Its not too hard, provided
> > you have a DB to store the index on. Let me know if you need some
> > pointers.
>
>Two things:
>
>1) I'd better concentrate on improving the content and structure of the
>Guide and will leave this search engine task to someone who needs to use
>the Guide but find it unusable without the proper search engine.
>
>2) perl.apache.org doesn't have mod_perl installed, so it's better to use
>some other site. I don't have any.
>
>Which leads to: If you suffer from inability to get the best out of the
>Guide in the shortest time and wish to help others in the same boat,
>please create a searchable mirror site which answers on the above demands.
>You will get a monument while you are alive at the perl.apache.org site if
>you are looking for one, but of course the most important is a great
>feeling of giving something back and not just taking.
>
>Hmm, may be we should run another contest at the Perl conference. The name
>is 'find it in the Guide'. You will be given a number of unanswered posts
>from the mod_perl list and the first one that provides pointers in the
>Guide that solve these problems wins. This has a double effect:
>
>1) You get the prize
>
>2) You finally answer the unanswered questions :)
>
>Have a good day, folks!
>
>__
>Stas Bekman | JAm_pH--Just Another mod_perl Hacker
>http://stason.org/  | mod_perl Guide  http://perl.apache.org/guide
>mailto:[EMAIL PROTECTED]  | http://perl.orghttp://stason.org/TULARC/
>http://singlesheaven.com| http://perlmonth.com http://sourcegarden.org
>--




RE: mod_perl of FreeBSD 4

2000-05-04 Thread Ian Mahuron

> I have freebsd 4, and am going to install mod_perl on it.  If I go to
> /usr/ports/www/mod_perl and do a make, I get v1.21.  But if I go to the
> ftp site it has up to v1.23.  Can I change the ports, or update them to
> get the latest files?

Your question is somewhat off topic but I'll answer it anyway.

Get familiar w/ cvsup to keep your ports tree up to date.

You can download the new(est) mod_perl port from
http://www.freebsd.org/ports (1.22 seems to be the most recent addition.).

Better yet, install Apache and mod_perl from source.




RE: Help - Install mod_perl-1.23

2000-05-04 Thread James Xie


I used root to do everything, I even changed the httpd.conf file
(t/conf/httpd.conf) to use root user and users group.
User  root
Group users

But I still have the same problem when I do make test, the following is the
directory dump, please let me know what permission should
I change to. 

-rw-r--r--   1 root users 300 May 18  1998 LoadClass.pm
drwxr-xr-x   3 root users4096 Apr 20 23:43 STAGE
drwxr-xr-x   2 root users4096 Apr 20 23:43 auth
-rw-r--r--   1 root users  64 Sep 30  1998 badsyntax.pl
-rw-rw-r--   1 root users  87 Apr 29 15:27 blib.pl
-rw-r--r--   1 root users   21825 Dec 29  1998 book.gif
-rw-r--r--   1 root users   2 Dec  6  1997 content.html
-rw-r--r--   1 root users  40 Dec  6  1997 content.shtml
drwxr-xr-x   2 root users4096 Apr 20 23:43 dirmagic
-rw-r--r--   1 root users 551 Dec  6  1997 env.iphtml
-rw-r--r--   1 root users  12 Dec  6  1997 error.txt
-rw-rw-rw-   1 root users   1 Apr 29 15:27 hooks.txt
-rw-r--r--   1 root users1003 Dec  6  1997 lists.ehtml
-rw-r--r--   1 root users  30 Mar 19  1998 null.txt
-rw-r--r--   1 root users  90 Dec  6  1997 rgy-include.shtml
-rw-r--r--   1 root users 619 Sep 21  1998 rl.pl
drwxr-xr-x   2 root users4096 Apr 29 15:27 stacked
-rw-r--r--   1 root users 511 Dec  6  1997 stacked.pl
-rw-r--r--   1 root users6149 Apr  6  1999 startup.pl
drwxr-xr-x   2 root users4096 Apr 27 17:02 subr
-rw-r--r--   1 root users3045 Jan 25  1999 test.ep
-rw-r--r--   1 root users 566 Dec  6  1997 test.html
-rw-rw-r--   1 root users 566 Apr 27 17:00 test.shtml

-Original Message-
From: Stas Bekman [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 04, 2000 2:58 PM
To: James Xie
Cc: Doug MacEachern; [EMAIL PROTECTED]
Subject: RE: Help - Install mod_perl-1.23


On Thu, 4 May 2000, James Xie wrote:

> 
> It seems I have some kind of permission problem but I don't know how to
> resolve it. Please take a look at the outputs from the commands I run.
> Really appreciate your help!

4145  dup2(15, 2)   = 2
4145  rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
4145  stat("/home/jxie/mod_perl-1.23/t/docs/test.html", 0xbabc) = -1
EACCES (Permission denied)

File permission problem. Try to run the make test as the same user you
have created the files with. Your server is running under some user/group
-- the file /home/jxie/mod_perl-1.23/t/docs/test.html should be readble by
user or/and group.


> 
> James 
> 
> >> Helllo,
> >> 
> >> I recently downloaded Apache_1.3.12 and installed it on Redhat 6.1,
> >> everything was working fine. I run into problems when I tried to
install
> >> mod_perl-1.23. Everything was compiled ok, but I got error messages
(see
> >> below) when I try to run the make test. I'm new to both Apache and
> mod_perl,
> >> thank you for your help in advance. 
> 
> >> still waiting for server to warm up...not ok
> 
> hmm, what happens if you run:
> 
> % make start_httpd
> % GET http://localhost:8529/perl/perl-status
> % make kill_httpd
> 
> Here is what I get:
> 
> 
> An Error Occurred
> 
> An Error Occurred
> 403 Forbidden
> 
> 
> 
> 
> ?
> 
> >you can also get more details on why apache isn't reponding like so:
> 
> >% make start_httpd
> >% strace -f -s1024 -o strace.out -p `cat t/logs/httpd.pid`
> >% make run_tests
> >% make kill_httpd
> 
> >have a look at strace.out
> 
> Here is the strace.out
> 
> 4145  accept(16, {sin_family=AF_INET, sin_port=htons(1113),
> sin_addr=inet_addr("127.0.0.1")}, [16]) = 4
> 4145  fcntl(18, F_SETLKW, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0})
=
> 0
> 4145  rt_sigaction(SIGUSR1, {SIG_IGN}, {0x809cdd4, [],
> SA_INTERRUPT|0x400}, 8) = 0
> 4145  getsockname(4, {sin_family=AF_INET, sin_port=htons(8529),
> sin_addr=inet_addr("127.0.0.1")}, [16]) = 0
> 4145  setsockopt(4, IPPROTO_TCP1, [1], 4) = 0
> 4145  brk(0x85ce000)= 0x85ce000
> 4145  brk(0x85d1000)= 0x85d1000
> 4145  alarm(300)= 0
> 4145  read(4, "GET /test.html HTTP/1.0\r\nHost:
> localhost:8529\r\nUser-Agent: libwww-perl/5.48\r\n\r\n", 4096) = 79
> 4145  rt_sigaction(SIGUSR1, {SIG_IGN}, {SIG_IGN}, 8) = 0
> 4145  time(NULL)= 957457364
> 4145  alarm(300)= 300
> 4145  alarm(0)  = 300
> 4145  rt_sigaction(SIGALRM, NULL, {0x809b7c0, [], SA_INTERRUPT|0x400},
> 8) = 0
> 4145  dup2(15, 2)   = 2
> 4145  rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
> 4145  stat("/home/jxie/mod_perl-1.23/t/docs/test.html", 0xbabc) = -1
> EACCES (Permission denied)
> 4145  alarm(300)= 0
> 4145  alarm(0)  = 300
> 4145  alarm(300)= 0
> 4145  alarm(0)  = 

RE: Help - Install mod_perl-1.23

2000-05-04 Thread Stas Bekman

On Thu, 4 May 2000, James Xie wrote:

> 
> It seems I have some kind of permission problem but I don't know how to
> resolve it. Please take a look at the outputs from the commands I run.
> Really appreciate your help!

4145  dup2(15, 2)   = 2
4145  rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
4145  stat("/home/jxie/mod_perl-1.23/t/docs/test.html", 0xbabc) = -1
EACCES (Permission denied)

File permission problem. Try to run the make test as the same user you
have created the files with. Your server is running under some user/group
-- the file /home/jxie/mod_perl-1.23/t/docs/test.html should be readble by
user or/and group.


> 
> James 
> 
> >> Helllo,
> >> 
> >> I recently downloaded Apache_1.3.12 and installed it on Redhat 6.1,
> >> everything was working fine. I run into problems when I tried to install
> >> mod_perl-1.23. Everything was compiled ok, but I got error messages (see
> >> below) when I try to run the make test. I'm new to both Apache and
> mod_perl,
> >> thank you for your help in advance. 
> 
> >> still waiting for server to warm up...not ok
> 
> hmm, what happens if you run:
> 
> % make start_httpd
> % GET http://localhost:8529/perl/perl-status
> % make kill_httpd
> 
> Here is what I get:
> 
> 
> An Error Occurred
> 
> An Error Occurred
> 403 Forbidden
> 
> 
> 
> 
> ?
> 
> >you can also get more details on why apache isn't reponding like so:
> 
> >% make start_httpd
> >% strace -f -s1024 -o strace.out -p `cat t/logs/httpd.pid`
> >% make run_tests
> >% make kill_httpd
> 
> >have a look at strace.out
> 
> Here is the strace.out
> 
> 4145  accept(16, {sin_family=AF_INET, sin_port=htons(1113),
> sin_addr=inet_addr("127.0.0.1")}, [16]) = 4
> 4145  fcntl(18, F_SETLKW, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}) =
> 0
> 4145  rt_sigaction(SIGUSR1, {SIG_IGN}, {0x809cdd4, [],
> SA_INTERRUPT|0x400}, 8) = 0
> 4145  getsockname(4, {sin_family=AF_INET, sin_port=htons(8529),
> sin_addr=inet_addr("127.0.0.1")}, [16]) = 0
> 4145  setsockopt(4, IPPROTO_TCP1, [1], 4) = 0
> 4145  brk(0x85ce000)= 0x85ce000
> 4145  brk(0x85d1000)= 0x85d1000
> 4145  alarm(300)= 0
> 4145  read(4, "GET /test.html HTTP/1.0\r\nHost:
> localhost:8529\r\nUser-Agent: libwww-perl/5.48\r\n\r\n", 4096) = 79
> 4145  rt_sigaction(SIGUSR1, {SIG_IGN}, {SIG_IGN}, 8) = 0
> 4145  time(NULL)= 957457364
> 4145  alarm(300)= 300
> 4145  alarm(0)  = 300
> 4145  rt_sigaction(SIGALRM, NULL, {0x809b7c0, [], SA_INTERRUPT|0x400},
> 8) = 0
> 4145  dup2(15, 2)   = 2
> 4145  rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
> 4145  stat("/home/jxie/mod_perl-1.23/t/docs/test.html", 0xbabc) = -1
> EACCES (Permission denied)
> 4145  alarm(300)= 0
> 4145  alarm(0)  = 300
> 4145  alarm(300)= 0
> 4145  alarm(0)  = 300
> 4145  write(4, "HTTP/1.1 403 Forbidden\r\nDate: Thu, 04 May 2000 16:22:44
> GMT\r\nServer: Apache/1.3.12 (Unix) mod_perl/1.23
> Perl/5.00503\r\nConnection: close\r\nContent-Type: text/html;
> charset=iso-8859-1\r\n\r\n 2.0//EN\">\n\n403
> Forbidden\n\nForbidden\nYou don\'t have
> permission to access /test.html\non this server.\n\n", 391)
> = 391
> 4145  time(NULL)= 957457364
> 4145  write(17, "127.0.0.1 - - [04/May/2000:09:22:44 -0700] \"GET /test.html
> HTTP/1.0\" 403 207\n", 77) = 77
> 4145  alarm(30) = 0
> 4145  shutdown(4, 1 /* send */) = 0
> 4145  select(5, [4], NULL, NULL, {2, 0}) = 1 (in [4], left {2, 0})
> 4145  read(4, "", 512)  = 0
> 4145  close(4)  = 0
> 4145  alarm(0)  = 30
> 4145  rt_sigaction(SIGUSR1, {0x809cdd4, [], SA_INTERRUPT|0x400},
> {SIG_IGN}, 8) = 0
> 4145  alarm(0)  = 0
> 4145  rt_sigaction(SIGALRM, {0x809b7c0, [], SA_RESTART|0x400},
> {0x809b7c0, [], SA_INTERRUPT|0x400}, 8) = 0
> 4145  fcntl(18, F_SETLKW, {type=F_WRLCK, whence=SEEK_SET, start=0, len=0}) =
> 0
> 4145  accept(16, {sin_family=AF_INET, sin_port=htons(1114),
> sin_addr=inet_addr("127.0.0.1")}, [16]) = 4
> 4145  fcntl(18, F_SETLKW, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}) =
> 0
> 4145  rt_sigaction(SIGUSR1, {SIG_IGN}, {0x809cdd4, [],
> SA_INTERRUPT|0x400}, 8) = 0
> 4145  getsockname(4, {sin_family=AF_INET, sin_port=htons(8529),
> sin_addr=inet_addr("127.0.0.1")}, [16]) = 0
> 4145  setsockopt(4, IPPROTO_TCP1, [1], 4) = 0
> 4145  alarm(300)= 0
> 4145  read(4, "GET /test.html HTTP/1.0\r\nHost:
> localhost:8529\r\nUser-Agent: libwww-perl/5.48\r\n\r\n", 4096) = 79
> 4145  rt_sigaction(SIGUSR1, {SIG_IGN}, {SIG_IGN}, 8) = 0
> 4145  time(NULL)= 957457365
> 4145  alarm(300)= 300
> 4145  alarm(0)  = 300
> 4145  rt_sigact

Re: handlers

2000-05-04 Thread Kip Cranford

On: Thu, 04 May 2000 18:23:30 -0300 FEITO Nazareno wrote:

>Maybe this isn´t the correct mailing list to post this question but i really
>need an answer some kind of guide o something like that...
>I need to use handlers for my webpages under mod_perl, any tutorial or
>something?

Check out 

http://perl.apache.org/guide

--kip



handlers

2000-05-04 Thread FEITO Nazareno

Maybe this isn´t the correct mailing list to post this question but i really
need an answer some kind of guide o something like that...
I need to use handlers for my webpages under mod_perl, any tutorial or
something?
I´m using an old handlers that i use to be but now it doesn´t work... i
mean, when i use that handlers i check the apache error_log and it say
something like prototype mismatch, but if i don´t use handlers i can´t
submit the form so well... i really need it, some kind of help or idea here
it will be VERY PRECIED!!! thanks. :)



 Nazareno Feito

   Perl Programmer

 www.obsequie.com[EMAIL PROTECTED]






Re: Templates.

2000-05-04 Thread Matt Sergeant

On Wed, 3 May 2000, Jason C. Leach wrote:

> hi,
> 
> I'm looking for some good ideas on developing web sites w/ mod_perl.  One
> think we were looking at was to write template HTML pages, and run them
> through a perl prg to replace home made tags w/ data.

If what you're after is something to convert home made tags with data,
then you're probably going to love AxKit. It's an XML based solution,
using W3C standards, that offers a caching template solution for you.

http://xml.sergeant.org/axkit/

(hopefully soon to be axkit.org, if Demon get moving on it...)

-- 


Fastnet Software Ltd. High Performance Web Specialists
Providing mod_perl, XML, Sybase and Oracle solutions
Email for training and consultancy availability.
http://sergeant.org http://xml.sergeant.org




Re: search engine for the Guide (was Re: Why does $r->print()...)

2000-05-04 Thread Rick Myers

On May 04, 2000 at 10:37:05 +0100, Matt Sergeant twiddled the keys to say:
> On Thu, 4 May 2000, Stas Bekman wrote:
> 
> > On Wed, 3 May 2000, Matt Sergeant wrote:
> > 
> > > On Wed, 3 May 2000, Stas Bekman wrote:
> > > 
> > > > Yeah, I've been thinking about it. There was one site that has offered me
> > > > to provide a good search engine and they did, but the problem is that they
> > > > didn't keep up with new releases, so people were searching the outdated
> > > > version, which is quite bad -- I've removed the reference to it, after
> > > > asking them to update their copy for a few months, with no results.
> > > 
> > > Can't we use WWW::Search - If I recall correctly some of the sites can be
> > > restricted to a domain, so you could build a search interface pretty
> > > easily.
> > 
> > DESCRIPTION :
> > This class is the parent for all access methods supported by the
> > WWW::Search library. This library implements a Perl API to web-based
> > search engines.
> > 
> > It's not the search engine -- it's a Perl API to the search engines. We
> > need a search engine not the API to it. Did I miss something?
> 
> Yes. On some of the search engines (AltaVista springs to mind) you can
> search for things on particular web sites, or even links to particular web
> sites. So as long as AltaVista keeps its search contents up to date, you
> can leverage their engine. IIRC either Randall or Lincoln did a
> WebTechniques article about this a few months ago.

Leveraging the existing engines is a good idea, if you have fairly
static content. If you're a moving target though, I'm of the opinion
that it would be better to have an "in-house" engine.

The existing engines are "nice" and don't invade your site too
intrusively, so you end up with references which tend to lag current
content. How to deal with that is not something I've thought about.

The one time I tried an engine I ended up with a forking agrep, which
comes as part of the Glimpse package. Glimpse itself sucks (in my
opinion), but agrep works pretty good. The problem with it is you have
to fork, which of course sucks.

Oh well. My .02 :)

Rick Myers[EMAIL PROTECTED]

The Feynman Problem   1) Write down the problem.
Solving Algorithm 2) Think real hard.
  3) Write down the answer.



Re: search engine for the Guide (was Re: Why does $r->print()...)

2000-05-04 Thread Matt Sergeant

On Thu, 4 May 2000, Stas Bekman wrote:

> On Wed, 3 May 2000, Matt Sergeant wrote:
> 
> > On Wed, 3 May 2000, Stas Bekman wrote:
> > 
> > > Yeah, I've been thinking about it. There was one site that has offered me
> > > to provide a good search engine and they did, but the problem is that they
> > > didn't keep up with new releases, so people were searching the outdated
> > > version, which is quite bad -- I've removed the reference to it, after
> > > asking them to update their copy for a few months, with no results.
> > 
> > Can't we use WWW::Search - If I recall correctly some of the sites can be
> > restricted to a domain, so you could build a search interface pretty
> > easily.
> 
> DESCRIPTION :
> This class is the parent for all access methods supported by the
> WWW::Search library. This library implements a Perl API to web-based
> search engines.
> 
> It's not the search engine -- it's a Perl API to the search engines. We
> need a search engine not the API to it. Did I miss something?

Yes. On some of the search engines (AltaVista springs to mind) you can
search for things on particular web sites, or even links to particular web
sites. So as long as AltaVista keeps its search contents up to date, you
can leverage their engine. IIRC either Randall or Lincoln did a
WebTechniques article about this a few months ago.

-- 


Fastnet Software Ltd. High Performance Web Specialists
Providing mod_perl, XML, Sybase and Oracle solutions
Email for training and consultancy availability.
http://sergeant.org http://xml.sergeant.org




Re: PerlAddVar ?

2000-05-04 Thread Matt Sergeant

On Wed, 3 May 2000, Doug MacEachern wrote:

> On Mon, 1 May 2000, Matt Sergeant wrote:
> 
> > It would be nice, in my opinion, to have some way of doing:
> > 
> > PerlAddVar Fred "Value 1"
> > PerlAddVar Fred "Value 2"
> > 
> > And then in your script:
> > 
> > my @values = $r->dir_config('Fred');
> > 
> > which gets ("Value 1","Value 2") in @values.
> > 
> > Any thoughts on this? (I'm not set on the name PerlAddVar, if that's
> > anyone's concern - but what about the idea of it?)
> 
> you could implement that with a directive handler, that uses
> $r->dir_config->add at request time.

How do you get at $r in a directive handler?

Anyhow, in the end I went for first class configuration directives, so now
with AxKit you can go:

AddStyleMap text/xsl Apache::AxKit::Language::XSLT
AddStyleMap application/x-xpathscript Apache::AxKit::Language::XPathScript

Very cool - I was amazed it worked first time!

-- 


Fastnet Software Ltd. High Performance Web Specialists
Providing mod_perl, XML, Sybase and Oracle solutions
Email for training and consultancy availability.
http://sergeant.org http://xml.sergeant.org




Re: search engine for the Guide

2000-05-04 Thread Stas Bekman

On Thu, 4 May 2000, Matt Sergeant wrote:

> On Thu, 4 May 2000, Stas Bekman wrote:
> 
> > > Yes. On some of the search engines (AltaVista springs to mind) you can
> > > search for things on particular web sites, or even links to particular web
> > > sites. So as long as AltaVista keeps its search contents up to date, you
> > > can leverage their engine. IIRC either Randall or Lincoln did a
> > > WebTechniques article about this a few months ago.
> > 
> > Oh, I see.
> > 
> > But I want to stress these 2 points: 
> > 
> > 1) Currently each chapter in the Guide is a huge document, so doing search
> > and having a hit, doesn't really help as you still have to go thru the
> > page to find the exact section that you want to read. So I think we want a
> > search engine that's not working with the master version per se, but with
> > a copy which has name anchors for each line and:
> > 
> >   a. can bring you to exact line with match
> >   b. have the keyword highlighted
> > 
> > 2) Most of the search engines have problems with keywords including
> > non-alpha chars, like if you search for Apache::Registry you will end up
> > searching for Apache and Registry since :: is ignored. Now think about
> > '$r->print' 'BEGIN {', '$@', etc. All these are must for the doc with many
> > non-alpha characters which should be searched for.
> > 
> > What do you think?
> 
> You seem to have it all worked out. I look forward to seeing your search
> engine ;-)
> 
> Seriously though, I have a search engine in the works, however I don't
> know how well it will apply to your scheme above. It looks like you're
> going to be better off writing one yourself. Its not too hard, provided
> you have a DB to store the index on. Let me know if you need some
> pointers.

Two things: 

1) I'd better concentrate on improving the content and structure of the
Guide and will leave this search engine task to someone who needs to use
the Guide but find it unusable without the proper search engine.

2) perl.apache.org doesn't have mod_perl installed, so it's better to use
some other site. I don't have any.

Which leads to: If you suffer from inability to get the best out of the
Guide in the shortest time and wish to help others in the same boat,
please create a searchable mirror site which answers on the above demands. 
You will get a monument while you are alive at the perl.apache.org site if
you are looking for one, but of course the most important is a great
feeling of giving something back and not just taking. 

Hmm, may be we should run another contest at the Perl conference. The name
is 'find it in the Guide'. You will be given a number of unanswered posts
from the mod_perl list and the first one that provides pointers in the
Guide that solve these problems wins. This has a double effect: 

1) You get the prize

2) You finally answer the unanswered questions :)

Have a good day, folks!

__
Stas Bekman | JAm_pH--Just Another mod_perl Hacker
http://stason.org/  | mod_perl Guide  http://perl.apache.org/guide 
mailto:[EMAIL PROTECTED]  | http://perl.orghttp://stason.org/TULARC/
http://singlesheaven.com| http://perlmonth.com http://sourcegarden.org
--




Re: search engine for the Guide

2000-05-04 Thread Stas Bekman

> On Thu, 4 May 2000, Stas Bekman wrote:
> 
> > On Wed, 3 May 2000, Matt Sergeant wrote:
> > 
> > > On Wed, 3 May 2000, Stas Bekman wrote:
> > > 
> > > > Yeah, I've been thinking about it. There was one site that has offered me
> > > > to provide a good search engine and they did, but the problem is that they
> > > > didn't keep up with new releases, so people were searching the outdated
> > > > version, which is quite bad -- I've removed the reference to it, after
> > > > asking them to update their copy for a few months, with no results.
> > > 
> > > Can't we use WWW::Search - If I recall correctly some of the sites can be
> > > restricted to a domain, so you could build a search interface pretty
> > > easily.
> > 
> > DESCRIPTION :
> > This class is the parent for all access methods supported by the
> > WWW::Search library. This library implements a Perl API to web-based
> > search engines.
> > 
> > It's not the search engine -- it's a Perl API to the search engines. We
> > need a search engine not the API to it. Did I miss something?
> 
> Yes. On some of the search engines (AltaVista springs to mind) you can
> search for things on particular web sites, or even links to particular web
> sites. So as long as AltaVista keeps its search contents up to date, you
> can leverage their engine. IIRC either Randall or Lincoln did a
> WebTechniques article about this a few months ago.

Oh, I see.

But I want to stress these 2 points: 

1) Currently each chapter in the Guide is a huge document, so doing search
and having a hit, doesn't really help as you still have to go thru the
page to find the exact section that you want to read. So I think we want a
search engine that's not working with the master version per se, but with
a copy which has name anchors for each line and:

  a. can bring you to exact line with match
  b. have the keyword highlighted

2) Most of the search engines have problems with keywords including
non-alpha chars, like if you search for Apache::Registry you will end up
searching for Apache and Registry since :: is ignored. Now think about
'$r->print' 'BEGIN {', '$@', etc. All these are must for the doc with many
non-alpha characters which should be searched for.

What do you think?

__
Stas Bekman | JAm_pH--Just Another mod_perl Hacker
http://stason.org/  | mod_perl Guide  http://perl.apache.org/guide 
mailto:[EMAIL PROTECTED]  | http://perl.orghttp://stason.org/TULARC/
http://singlesheaven.com| http://perlmonth.com http://sourcegarden.org
--




Re: search engine for the Guide

2000-05-04 Thread Matt Sergeant

On Thu, 4 May 2000, Stas Bekman wrote:

> > Yes. On some of the search engines (AltaVista springs to mind) you can
> > search for things on particular web sites, or even links to particular web
> > sites. So as long as AltaVista keeps its search contents up to date, you
> > can leverage their engine. IIRC either Randall or Lincoln did a
> > WebTechniques article about this a few months ago.
> 
> Oh, I see.
> 
> But I want to stress these 2 points: 
> 
> 1) Currently each chapter in the Guide is a huge document, so doing search
> and having a hit, doesn't really help as you still have to go thru the
> page to find the exact section that you want to read. So I think we want a
> search engine that's not working with the master version per se, but with
> a copy which has name anchors for each line and:
> 
>   a. can bring you to exact line with match
>   b. have the keyword highlighted
> 
> 2) Most of the search engines have problems with keywords including
> non-alpha chars, like if you search for Apache::Registry you will end up
> searching for Apache and Registry since :: is ignored. Now think about
> '$r->print' 'BEGIN {', '$@', etc. All these are must for the doc with many
> non-alpha characters which should be searched for.
> 
> What do you think?

You seem to have it all worked out. I look forward to seeing your search
engine ;-)

Seriously though, I have a search engine in the works, however I don't
know how well it will apply to your scheme above. It looks like you're
going to be better off writing one yourself. Its not too hard, provided
you have a DB to store the index on. Let me know if you need some
pointers.

-- 


Fastnet Software Ltd. High Performance Web Specialists
Providing mod_perl, XML, Sybase and Oracle solutions
Email for training and consultancy availability.
http://sergeant.org http://xml.sergeant.org




Re: Apache::ModuleConfig

2000-05-04 Thread Matt Sergeant

On Thu, 4 May 2000, raptor wrote:

> hi,
> someone to know is there Apache::ModuleConfig as separate package...?

No, it comes with mod_perl. I think you require mod_perl 1.17 or
higher. Can anyone on the mod_perl list confirm this?

-- 


Fastnet Software Ltd. High Performance Web Specialists
Providing mod_perl, XML, Sybase and Oracle solutions
Email for training and consultancy availability.
http://sergeant.org http://xml.sergeant.org




little question about handlers...

2000-05-04 Thread FEITO Nazareno

When I run my test script from the webserver itdoesn´t work the submit
button... 

I don´t use handlers here, just this:

#!/usr/bin/perl -w
use CGI;
use strict;

my $debug=0;
my $error=0;

my $q->new CGI();
my $me=$q->script_name();

my $s;
print header();

printheader(); #i´m going to obvius the printheader subrutine here...

if ($s == ´1´)
{
print AskForAPass();
}
else
{
$name=$q->param(´name´);
$pass=$q->param(´pass´);
}

sub AskForAPass()
{
print $s = EOT;

-cut here
#Here goes the form part but at the bottom, when the submit appears i have
the problem
#see this piece of code
-cut here






EOT
return $s;
}

well... i execute this script, but when i push the submit button nothing
happens at all... any idea? any help will be very very very very
precied:

Nazareno Feito

Perl Programmer
www.obsequie.com
[EMAIL PROTECTED]





Re: Apache::Registry and clearing package name space

2000-05-04 Thread Richard Chen

Unfortunately, the crucial part about clearing/removing
subroutine alias does not work when using
Apache::PerlRun->flush_namespace('Q')
I suspect this is a bug in PerlRun. Here is the demo program
(It can be run from the command line)

$ cat tmp.pl
#!/usr/bin/perl -w
use strict;
use Apache::PerlRun;
print "Content-type: text/plain\n\n";
%Q::in=();
$Q::in{first_name}='first_name';
*Q::hello=\&hello;
print "here is the symbol table\n";
print join("\n", map { "\$Q::{$_}=$Q::{$_}" } keys %Q::),"\n";
print "\nbefore clear name space, \%Q::in is\n";
print join("\n", map { "\$Q::in{$_}=$Q::in{$_}" } keys %Q::in),"\n";
print "\nbefore clear name space, calling \&Q::hello yields\n";
&Q::hello();
print "-Now clear package name space-\n";
Apache::PerlRun->flush_namespace('Q');
print "here is the symbol table\n";
print join("\n", map { "\$Q::{$_}=$Q::{$_}" } keys %Q::),"\n";
print "\nafter name space, \%Q::in is\n";
print join("\n",map { "\$Q::in{$_}=$Q::in{$_}" } keys %Q::in),"\n";
print "\nafter clear name space, calling \&Q::hello yields\n"; 
&Q::hello();
sub hello { print "hello\n"; }

$ ./tmp.pl
here is the symbol table
$Q::{hello}=*Q::hello
$Q::{in}=*Q::in

before clear name space, %Q::in is
$Q::in{first_name}=first_name

before clear name space, calling &Q::hello yields
hello
-Now clear package name space-
Odd number of elements in hash assignment at 
/usr/lib/perl5/site_perl/5.005/i586-linux/Apache/PerlRun.pm line 310.
Use of uninitialized value at 
/usr/lib/perl5/site_perl/5.005/i586-linux/Apache/PerlRun.pm line 310.
here is the symbol table
$Q::{hello}=*Q::hello
$Q::{in}=*Q::in

after name space, %Q::in is
Use of uninitialized value at ./bar.cgi line 19.
$Q::in{}=

after clear name space, calling &Q::hello yields
hello


Note in particular that the value for &Q::hello still exists.
Since you have pointed out that symbol table is constructed at
compile time, at least the clean up of name space should make this
value undefed.


Doug MacEachern wrote:
> 
> On Mon, 1 May 2000, Richard Chen wrote:
> 
> > Hello,
> >   I am having a problem clearing variables and aliases
> > in a temporary package name space. The source of the problem
> > is in making legend cgi scripts work under Apache::Registry.
> > But the problem can be isolated and shown by the following
> > demo program:
> >
> > $ cat foo.cgi
> > #!/usr/bin/perl -w
> > use strict;
> > use Symbol qw(delete_package);
> > print "Content-type: text/plain\n\n";
> > %Q::userdata=();
> > $Q::userdata{first_name}='first_name';
> > $Q::userdata{last_name}='last_name';
> > *Q::hello=\&hello;
> > print "here is the symbol table\n";
> > while (my($k,$v)=each %Q::) {
> > print "$k => $v\n";
> > }
> > delete_package('Q');
> > sub hello {
> > print "hi\n";
> > }
> >
> > The first time it runs, it yields:
> >
> > here is the symbol table
> > userdata => *Q::userdata
> > hello => *Q::hello
> >
> > But there after, modperl shows emtpy symbol table.
> 
> the problem is that Perl creates symbol table references at compile time,
> Symbol::delete_package() wipes those references out of existence.
> try using Apache::PerlRun->flush_namespace('Q'), which clears just
> the values, and leaves the references in tact.



Re: Problem with deleting uploaded files

2000-05-04 Thread Ken Y. Clark

On Thu, 4 May 2000, Srinidhi Rao S wrote:

> Hi all,
> Here I have a problem. I used CGI module to upload a file. But the
> problem is that the temp file created by CGI module is not getting
> deleted even after execution finished. It simply getting heaped in
> temp directory eating memory. Can anyone please give me a way through
> this???
> Here is a part of code I have written
> 
> use CGI;
> use CGI qw (:standard);
> use CGI::Carp qw (fatalsToBrowser);
> 
> $CGI::POST_MAX=1024 * 350;  
>  my $QObject = new CGI;
>  print $QObject->header;
>  $file_name = $QObject->param('upload');
>  
>  open (FILE,">../xxx.jpeg") || die "cannot open the image file\n";
>  while(read($file_name,$data,1024))
>  { 
>   print FILE $data;
>   }
>  close(FILE);
>  print "Success"; 
> 
> I also have one more problem. If I upload a Image file, the image will
> be corrupted in the uploaded file. Why is this hapenning?  Any help is
> hugely appriciated. 

from `perldoc CGI`:

STARTING AND ENDING A FORM
   
   multipart/form-data
   This is the newer type of encoding introduced by
   Netscape 2.0.  It is suitable for forms that contain
   very large fields or that are intended for
   transferring binary data. 

also:


   To be safe, use the upload() function (new in version
   2.47).  When called with the name of an upload field,
   upload() returns a filehandle, or undef if the parameter
   is not a valid filehandle.

$fh = $query->upload('uploaded_file');
while (<$fh>) {
  print;
}

   This is the recommended idiom.

there's some more info there.  do perldoc and then search for "binary."

ky





RE: how do I use perl sections

2000-05-04 Thread Eric Cholet

> -Message d'origine-
> De:   Benedict Lofstedt [SMTP:[EMAIL PROTECTED]]
> Date: jeudi 4 mai 2000 15:38
> À:Eric Cholet
> Cc:   [EMAIL PROTECTED]
> Objet:RE: how do I use perl sections
> 
> Eric,
> 
>  > push @ScriptAlias, [ "/cgi-$_", "/users/$_/cgi-bin" ];
>  > 
>  > > Where can I find better info than given in
>  > > http://perl.apache.org/src/mod_perl.html#PERL_SECTIONS ?
>  > 
>  > http://www.modperl.com/book/chapters/ch8.html#Configuring_Apache_with_Perl
>  > 
>  > See the paragraph: "Directive is Repeated Multiple Times"
>  > 
> 
> Thank you for a quick reply and a good reference.
> 
> However, it seems that I have found a problem.  Even the simplest construct:
> 
> 
> push @ScriptAlias, "/cgi-benedict/", "/users/benedict/cgi-bin/"  ;
> 

but you're not following my example quoted above.
@ScriptAlias is a list of aliases. Each alias is a _reference_ to
a two-element array.

--
Eric





Re: Templates.

2000-05-04 Thread Ken Y. Clark

On Wed, 3 May 2000, Jason C. Leach wrote:

> I'm looking for some good ideas on developing web sites w/ mod_perl.  One
> think we were looking at was to write template HTML pages, and run them
> through a perl prg to replace home made tags w/ data.
> 
> Another was to write an apache mod that will contain/load the HTML on the
> first hit and cach all the pages and gfx (not too much).
> 
> Can anyone comment on some good techniques to develope mod_perl sites?  We
> will need mod_perl to be fast, interact w/ a DB, and run of FreeBSD or
> Linux.

we use the following at boston.com on numerous sites (mp3.boston.com,
www.digitalmass.com, travel.boston.com, ae.boston.com, www.boston.com)
with great success:

Linux
Apache/mod_perl
HTML::Template
MySQL

this combination makes for a very stable development environment for us.

hth,

ky





RE: how do I use perl sections

2000-05-04 Thread Benedict Lofstedt

Eric,

 > push @ScriptAlias, [ "/cgi-$_", "/users/$_/cgi-bin" ];
 > 
 > > Where can I find better info than given in
 > > http://perl.apache.org/src/mod_perl.html#PERL_SECTIONS ?
 > 
 > http://www.modperl.com/book/chapters/ch8.html#Configuring_Apache_with_Perl
 > 
 > See the paragraph: "Directive is Repeated Multiple Times"
 > 

Thank you for a quick reply and a good reference.

However, it seems that I have found a problem.  Even the simplest construct:


push @ScriptAlias, "/cgi-benedict/", "/users/benedict/cgi-bin/"  ;


doesn't work on my solaris2.7 box - but it works on my Solaris2.6 and my
Irix 6.5 boxes. 

Has anyone else experienced something similar?

--- benedict




Re: Why does $r->print() dereference its arguments?

2000-05-04 Thread Jeffrey W. Baker

On Wed, 3 May 2000, Doug MacEachern wrote:

> On Wed, 3 May 2000, Jeffrey W. Baker wrote:
> 
> > Apache::print() dereferences its arguments.  For example, this code:
> > 
> > my $foo = "bar";
> > $r->print(\$foo);
> > 
> > prints "bar" instead of the expected SCALAR(0xDEADBEEF).  Can anyone
> > explain the purpose of this behavior, or is it a misfeature?  In my case,
> > this is not the desired behavior.
> 
> it only pulls that stunt for strings.  assuming you're only printing the
> reference for debugging purposes, just stringify it first:
> 
> my $foo = \"bar";
> 
> print "$foo";
> 
> or, geoff's trick:
> 
> my $foo = "bar";
> 
> print \$foo . "";
> 
> do you need to avoid this feature for something other than debugging?

Not strictly for debugging, but for introspection.  I was toying with 
a module that pokes around inside the perlguts of a running mod_perl
server and makes some nice displays out of them.  Nothing for 
production/money mind you, just amusement.

Here is a patch I made against the documentation in Apache.pm.  Actually,
I had to attach it because it was wrapping.

Regards,
Jeffrey


--- Apache.pm.orig  Thu May  4 08:20:59 2000
+++ Apache.pm   Thu May  4 08:31:31 2000
@@ -911,7 +911,21 @@
 =item $r->print( @list )
 
 This method sends data to the client with C<$r-Ewrite_client>, but first
-sets a timeout before sending with C<$r-Ehard_timeout>.
+sets a timeout before sending with C<$r-Ehard_timeout>.  This method is
+called instead of CORE::print when you use print() in your mod_perl programs.
+
+This method treats scalar references specially.  If an item in @list is a 
+scalar reference, it will be dereferenced before printing.  This is a 
+performance optimization which prevents unneeded copying of large strings,
+and it is subtly different from Perl's standard print() behavior.
+
+Example: 
+
+$foo = \"bar"; print($foo);
+
+The result is "bar", not the "SCALAR(0xDEADBEEF)" you might have expected.  If
+you really want the reference to be printed out, force it into a scalar
+context by using print(scalar($foo)).
 
 =item $r->send_fd( $filehandle )
 



Re: Templates.

2000-05-04 Thread Autarch

On Wed, 3 May 2000, Jason C. Leach wrote:

> I'm looking for some good ideas on developing web sites w/ mod_perl.  One
> think we were looking at was to write template HTML pages, and run them
> through a perl prg to replace home made tags w/ data.
> 
> Another was to write an apache mod that will contain/load the HTML on the
> first hit and cach all the pages and gfx (not too much).

There's quite a number of templating modules.  Here's a few:

HTML::Mason
HTML::Template
HTML::EmbPerl
Apache::ASP
ePerl
Template Toolkit
CGI:WeT (is that how its spelled?)

I've only used the first two.  Mason supports caching of output and I
think some of the others do as well.  HTML::Template supports template
caching but not output caching.


-dave


/*==
www.urth.org
We await the New Sun
==*/




RE: Help - Install mod_perl-1.23

2000-05-04 Thread James Xie


It seems I have some kind of permission problem but I don't know how to
resolve it. Please take a look at the outputs from the commands I run.
Really appreciate your help!

James 

>> Helllo,
>> 
>> I recently downloaded Apache_1.3.12 and installed it on Redhat 6.1,
>> everything was working fine. I run into problems when I tried to install
>> mod_perl-1.23. Everything was compiled ok, but I got error messages (see
>> below) when I try to run the make test. I'm new to both Apache and
mod_perl,
>> thank you for your help in advance. 

>> still waiting for server to warm up...not ok

hmm, what happens if you run:

% make start_httpd
% GET http://localhost:8529/perl/perl-status
% make kill_httpd

Here is what I get:


An Error Occurred

An Error Occurred
403 Forbidden




?

>you can also get more details on why apache isn't reponding like so:

>% make start_httpd
>% strace -f -s1024 -o strace.out -p `cat t/logs/httpd.pid`
>% make run_tests
>% make kill_httpd

>have a look at strace.out

Here is the strace.out

4145  accept(16, {sin_family=AF_INET, sin_port=htons(1113),
sin_addr=inet_addr("127.0.0.1")}, [16]) = 4
4145  fcntl(18, F_SETLKW, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}) =
0
4145  rt_sigaction(SIGUSR1, {SIG_IGN}, {0x809cdd4, [],
SA_INTERRUPT|0x400}, 8) = 0
4145  getsockname(4, {sin_family=AF_INET, sin_port=htons(8529),
sin_addr=inet_addr("127.0.0.1")}, [16]) = 0
4145  setsockopt(4, IPPROTO_TCP1, [1], 4) = 0
4145  brk(0x85ce000)= 0x85ce000
4145  brk(0x85d1000)= 0x85d1000
4145  alarm(300)= 0
4145  read(4, "GET /test.html HTTP/1.0\r\nHost:
localhost:8529\r\nUser-Agent: libwww-perl/5.48\r\n\r\n", 4096) = 79
4145  rt_sigaction(SIGUSR1, {SIG_IGN}, {SIG_IGN}, 8) = 0
4145  time(NULL)= 957457364
4145  alarm(300)= 300
4145  alarm(0)  = 300
4145  rt_sigaction(SIGALRM, NULL, {0x809b7c0, [], SA_INTERRUPT|0x400},
8) = 0
4145  dup2(15, 2)   = 2
4145  rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
4145  stat("/home/jxie/mod_perl-1.23/t/docs/test.html", 0xbabc) = -1
EACCES (Permission denied)
4145  alarm(300)= 0
4145  alarm(0)  = 300
4145  alarm(300)= 0
4145  alarm(0)  = 300
4145  write(4, "HTTP/1.1 403 Forbidden\r\nDate: Thu, 04 May 2000 16:22:44
GMT\r\nServer: Apache/1.3.12 (Unix) mod_perl/1.23
Perl/5.00503\r\nConnection: close\r\nContent-Type: text/html;
charset=iso-8859-1\r\n\r\n\n\n403
Forbidden\n\nForbidden\nYou don\'t have
permission to access /test.html\non this server.\n\n", 391)
= 391
4145  time(NULL)= 957457364
4145  write(17, "127.0.0.1 - - [04/May/2000:09:22:44 -0700] \"GET /test.html
HTTP/1.0\" 403 207\n", 77) = 77
4145  alarm(30) = 0
4145  shutdown(4, 1 /* send */) = 0
4145  select(5, [4], NULL, NULL, {2, 0}) = 1 (in [4], left {2, 0})
4145  read(4, "", 512)  = 0
4145  close(4)  = 0
4145  alarm(0)  = 30
4145  rt_sigaction(SIGUSR1, {0x809cdd4, [], SA_INTERRUPT|0x400},
{SIG_IGN}, 8) = 0
4145  alarm(0)  = 0
4145  rt_sigaction(SIGALRM, {0x809b7c0, [], SA_RESTART|0x400},
{0x809b7c0, [], SA_INTERRUPT|0x400}, 8) = 0
4145  fcntl(18, F_SETLKW, {type=F_WRLCK, whence=SEEK_SET, start=0, len=0}) =
0
4145  accept(16, {sin_family=AF_INET, sin_port=htons(1114),
sin_addr=inet_addr("127.0.0.1")}, [16]) = 4
4145  fcntl(18, F_SETLKW, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}) =
0
4145  rt_sigaction(SIGUSR1, {SIG_IGN}, {0x809cdd4, [],
SA_INTERRUPT|0x400}, 8) = 0
4145  getsockname(4, {sin_family=AF_INET, sin_port=htons(8529),
sin_addr=inet_addr("127.0.0.1")}, [16]) = 0
4145  setsockopt(4, IPPROTO_TCP1, [1], 4) = 0
4145  alarm(300)= 0
4145  read(4, "GET /test.html HTTP/1.0\r\nHost:
localhost:8529\r\nUser-Agent: libwww-perl/5.48\r\n\r\n", 4096) = 79
4145  rt_sigaction(SIGUSR1, {SIG_IGN}, {SIG_IGN}, 8) = 0
4145  time(NULL)= 957457365
4145  alarm(300)= 300
4145  alarm(0)  = 300
4145  rt_sigaction(SIGALRM, NULL, {0x809b7c0, [], SA_RESTART|0x400}, 8)
= 0
4145  dup2(15, 2)   = 2
4145  rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
4145  stat("/home/jxie/mod_perl-1.23/t/docs/test.html", 0xbabc) = -1
EACCES (Permission denied)
4145  alarm(300)= 0
4145  alarm(0)  = 300
4145  alarm(300)= 0
4145  alarm(0)  = 300
4145  write(4, "HTTP/1.1 403 Forbidden\r\nDate: Thu, 04 May 2000 16:22:45
GMT\r\nServer: Apache/1.3.12 (Unix) mod_perl/1.23
Perl/5.00503\r\nConnection: close\r\nContent-Type: text/html;
charset=iso-8859-1\r\n\r\n\n\n403
Forbidden\n\nForbidden\nYou don\'t have
permission to acces

mod_perl of FreeBSD 4

2000-05-04 Thread Jason C. Leach

hi,

I have freebsd 4, and am going to install mod_perl on it.  If I go to
/usr/ports/www/mod_perl and do a make, I get v1.21.  But if I go to the
ftp site it has up to v1.23.  Can I change the ports, or update them to
get the latest files?

j.

--
Method Digital Logic Company
http://www.methodlogic.net
Solutions for:
 -Web Design-Database Programming
 -Office Networking -Custom Applications





Re: Templates.

2000-05-04 Thread Bernhard Graf

"Jason C. Leach" wrote:

> I'm looking for some good ideas on developing web sites w/ mod_perl.  One
> think we were looking at was to write template HTML pages, and run them
> through a perl prg to replace home made tags w/ data.
> 
> Another was to write an apache mod that will contain/load the HTML on the
> first hit and cach all the pages and gfx (not too much).
> 
> Can anyone comment on some good techniques to develope mod_perl sites?  We
> will need mod_perl to be fast, interact w/ a DB, and run of FreeBSD or
> Linux.

Have a look at the Template Toolkit by Andy Wardley.
It is on CPAN and it rocks (IMHO).

-- 
Bernhard Graf   -- s p e e d l i n k . d e --   fon +49-30-28000-182
[EMAIL PROTECTED]  http://www.speedlink.de  fax +49-30-28000-22
   sw engineering Dircksenstraße 47 D-10178 Berlin



Re: search engine for the Guide (was Re: Why does $r->print()...)

2000-05-04 Thread Stas Bekman

On Wed, 3 May 2000, Matt Sergeant wrote:

> On Wed, 3 May 2000, Stas Bekman wrote:
> 
> > Yeah, I've been thinking about it. There was one site that has offered me
> > to provide a good search engine and they did, but the problem is that they
> > didn't keep up with new releases, so people were searching the outdated
> > version, which is quite bad -- I've removed the reference to it, after
> > asking them to update their copy for a few months, with no results.
> 
> Can't we use WWW::Search - If I recall correctly some of the sites can be
> restricted to a domain, so you could build a search interface pretty
> easily.

DESCRIPTION :
This class is the parent for all access methods supported by the
WWW::Search library. This library implements a Perl API to web-based
search engines.

It's not the search engine -- it's a Perl API to the search engines. We
need a search engine not the API to it. Did I miss something?

__
Stas Bekman | JAm_pH--Just Another mod_perl Hacker
http://stason.org/  | mod_perl Guide  http://perl.apache.org/guide 
mailto:[EMAIL PROTECTED]  | http://perl.orghttp://stason.org/TULARC/
http://singlesheaven.com| http://perlmonth.com http://sourcegarden.org
--




Re: php And Apache::ASP

2000-05-04 Thread Joshua Chamas

Doug MacEachern wrote:
> 
> On Thu, 27 Apr 2000, Jerrad Pierce wrote:
> 
> > [Thu Apr 27 06:14:07 2000] [error] [asp] [2726] cannot load Apache::Symbol
> > for UndefRoutine: Can't locate Devel/Symdump.pm in @INC (@INC contains:
> 
> why does Apache::ASP use Apache::Symbol::undef?  that hack should be
> obsolete, as it was only need to avoid the mandatory 'constant subroutine
> redefined' warning, which went away in Perl 5.005

Believe it or no, I still run 5.004_04 on my NT dev box.
In working with Crypt::SSLeay, it has turned out recently that
lots of people have production 5.004_01 still. *ouch*

-- Joshua



Re: Modperl/Apache deficiencies... Memory usage.

2000-05-04 Thread shane

[chopping down the digital forest because the light has turned on :)]

> just a seperate thread that plucks a mip->avail interpreter, puts it in
> the mip->busy list, analyzes, puts back, plucks the next mip->avail, over
> and over.

Sounds like a good plan.  The first piece to put together is the
script that can register callbacks, and iterate through the perl
threads.  Do we have a devel version that's got the mip->avail type
stuff together, or is this something that will be coming together in
the next few weeks?  Okay so this is a module that would be loaded via
httpd.conf so that the thread can be spun off, and it can begin
analyzing.  It should have some parameters so that it doesn't suck up
too much CPU time, like sleep n seconds between jumping to the next
apache embedded interpreter thread, blah, blah.  Are we going to dump
this info to perlmemorylogs?  (Configurable to some location, etc)  Or
integrate it with some sort of online status program?
  Or both..., hehe, well, of course that's all
later, first piece is to get the iterator built that registers
callbacks.  As an aside, I think the callback thing was a really good
idea on your part, that way you can analyze how much memory your
programs are using and whether you need to re-think your design
strategy or implement a cleaner.  Any cleaner, a real aggresive one,
or a really kick back one.  In any event, I just wanted to mention
that this was a really good idea of yours (the callbacks).

Thanks,
Shane.




Problem with deleting uploaded files

2000-05-04 Thread Srinidhi Rao S




Hi all,
    Here I have a problem. I used 
CGI module to upload a file. But the problem is that the temp file created by 
CGI module is not getting deleted even after execution finished. It simply 
getting heaped in temp directory eating memory. Can anyone please give me a way 
through this??? 
    Here is a part of code I have 
written
 
use CGI;use CGI qw (:standard);use 
CGI::Carp qw (fatalsToBrowser);
 
$CGI::POST_MAX=1024 * 350;  
 my $QObject = new CGI;
 print 
$QObject->header; $file_name = 
$QObject->param('upload');  open 
(FILE,">../xxx.jpeg") || die "cannot open the image 
file\n"; while(read($file_name,$data,1024)) {   
print FILE $data;  } close(FILE); print 
"Success";	
 
I also have one more problem. If I upload a 
Image file, the image will be corrupted in the uploaded file. Why is this 
hapenning? 
Any help is hugely appriciated.
Thanx in advance
RegardsSrinidhi RaoRobosoft 
TechnologiesE-mail: [EMAIL PROTECTED]www.robosoftin.com