Return-Path: Delivered-To: apmail-perl-modperl-archive@www.apache.org Received: (qmail 44928 invoked from network); 9 May 2005 13:42:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 9 May 2005 13:42:52 -0000 Received: (qmail 20909 invoked by uid 500); 9 May 2005 13:42:39 -0000 Delivered-To: apmail-perl-modperl-archive@perl.apache.org Received: (qmail 20799 invoked by uid 500); 9 May 2005 13:42:37 -0000 Mailing-List: contact modperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Delivered-To: mailing list modperl@perl.apache.org Received: (qmail 20693 invoked by uid 99); 9 May 2005 13:42:35 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from mail.logilune.com (HELO mail.logilune.com) (195.80.154.36) by apache.org (qpsmtpd/0.28) with ESMTP; Mon, 09 May 2005 06:42:34 -0700 Received: from [127.0.0.1] (localhost.logilune.com [127.0.0.1]) by mail.logilune.com (Postfix) with ESMTP id 1E34AD693C; Mon, 9 May 2005 15:39:15 +0200 (CEST) Message-ID: <427F6802.3060201@stason.org> Date: Mon, 09 May 2005 09:39:14 -0400 From: Stas Bekman Organization: Hope, Humanized User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.6) Gecko/20050322 X-Accept-Language: en-us, en, he, ru MIME-Version: 1.0 To: dan.horne@redbone.co.nz CC: modperl@perl.apache.org Subject: Re: Can't retrieve page I just created with LWP under mod_perl References: <000201c5544e$4f8a8eb0$6403a8c0@rdbxp01> In-Reply-To: <000201c5544e$4f8a8eb0$6403a8c0@rdbxp01> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Dan Horne wrote: > I've written a small CGI::Application CMS that publishes content to flat > files via. The file-type can be any that the designers decide, but generally > it will be something that supports includes such as SSI or PHP. This is fine > most of the time but occasionally I need to produce dynamic pages - e.g. a > search result. > > To do this, I generate the search result php/shtml page to the file system, > and then request it from the web server using LWP: > > my $file = $self->get_value('cms_document_root') . "/" . $page; > $self->logger->debug("Creating $file"); > > # write the results to the temporary file > open(FH, ">$file") || die "Cannot create $file"; > print FH $template->output(); > close FH || die "Cannot close $file"; > $self->logger->debug("Created $file"); > > # request the temporary file > my $request_page = "http://" . $ENV{SERVER_NAME} . > $self->get_value('cms_publish_url') . "/$page"; > $self->logger->debug("request_page: $request_page"); > my $agent = LWP::UserAgent->new; > my $request = HTTP::Request->new(GET => $request_page); > > This works fine under standard CGI, but the LWP request times out under > mod_perl. The temporary page name is random, so I know that it's not a file > conflict. > > Have I missed something? I'm using Apache 1.3.31 and mod_perl 1.29 on > Windows XP, but whatever I do has to also work under vanilla CGI. Not sure if there is something specific under win32, but mod_perl differs from mod_cgi since: 1) it is running under the same username the server runs with 2) the environment persists In the script above, you don't use LWP, you create an agent, but you don't use it. I can't see where the actual request is. -- __________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:stas@stason.org http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com