Make test with mod_perl 1.26

2001-07-29 Thread jmeltze

Greetings.  I had a mod_perl setup with Apache 1.3.11/ mod_perl 
1.24 on a RedHat Linux box running fine.  Then I decided (or was 
asked, actually) to upgrade to Apache 1.3.20/ mod_perl 1.26.  

The Apache install by itself ran fine, but when I try to 'make test' 
with mod_perl, I get the following error:

../apache_1.3.20/src/httpd -f `pwd`/t/conf/httpd.conf -X -d `pwd`/t 
httpd listening on port 8529
will write error_log to: t/logs/error_log
letting apache warm up...\c
done
/usr/bin/perl t/TEST 0
modules/actions.ok
modules/cgi.FAILED test 4
Failed 1/5 tests, 80.00% okay

No other errors but this one, but this one is enough to stop the 
install from working.

Any ideas?  I have tried reinstalling, redownloading...

The only thing I have NOT done is installed Perl 5.6.1, which both 
Bundle::CPAN and Bundle::Apache tried to install.  Is this 
necessary for this to work?  Perl 5.00503 is on the box already.  I 
was not planning to upgrade Perl at this time.

I looked through the mailing list for similar errors, but no one 
seems to be having this exact problem.

Thanks,

Jonathan



[Problem] Can't return Content-type with SERVER_ERROR

2001-07-29 Thread Paul Kulchenko

Hi, All!

Code is simple, but I can't return custom content-type with
SERVER_ERROR:

sub handler {

  . $self-response is HTTP::Response object

  if ($self-response-is_success) {
$self-response-headers-scan(sub { $r-header_out(@_) });
$r-send_http_header(join '; ', $self-response-content_type);
$r-print($self-response-content);
  } else {
$self-response-headers-scan(sub { $r-err_header_out(@_) });
$r-content_type(join '; ', $self-response-content_type);
$r-custom_response($self-response-code, 
$self-response-content);
  }
  $self-response-code;
}

In ALL cases (200OK and 500ServerError) I need to return error code,
content, content-type and optional headers.

Regardless of my settings content-type is always text/html;
charset=iso-8859-1 which I expect to be text/xml; charset=utf-8:

HTTP/1.1 500 Internal Server Error
Connection: close
Date: Sun, 29 Jul 2001 16:01:20 GMT
Server: Apache/1.3.12 (Win32) mod_perl/1.23
Content-Length: 642
Content-Type: text/html; charset=iso-8859-1
Client-Date: Sun, 29 Jul 2001 16:01:22 GMT
Client-Peer: 127.0.0.1:80
SOAPServer: SOAP::Lite/Perl/0.51

?xml version=1.0 encoding=UTF-8?SOAP-ENV:Envelope
xmlns:SOAP-ENC=http://schemas.xmlsoap.org/soap/encoding/;
SOAP-ENV:encodingStyle=http://schemas.xmlsoap.org/soap/encoding/;
xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/;
xmlns:xsi=http://www.w3.org/1999/XMLSchema-instance;
xmlns:xsd=http://www.w3.org/1999/XMLSchema;SOAP-ENV:BodySOAP-ENV:Faultfaultcode
xsi:type=xsd:stringSOAP-ENV:Client/faultcodefaultstring
xsi:type=xsd:stringFailed to locate method (echo1) in class
(My::Parameters) at C:/Perl/site/5.6.0/lib/SOAP/Lite.pm line 1997.
/faultstring/SOAP-ENV:Fault/SOAP-ENV:Body/SOAP-ENV:Envelope

What am I doing wrong and what is the correct way to specify custom
content-type? Everything works fine with 200OK. Thanks a lot.

Best wishes, Paul. 

__
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/



Re: Problem with arrayrefs in PSections

2001-07-29 Thread Steve Piner



Geoffrey Young wrote:
 
 without having an environment to test on or the Eagle book to reference...
 
 I seem to recall something in the Eagle book about arguments to Allow and
 Deny - that from 10.3.4.1 is really a single argument and not two (in the
 TAKE2 sense), so maybe your approach is wrong and you need to make each of
 those entries in your array a single string.

Thanks, but that's not it.

Allow = ['from 1.2.3.0/24', 'from 192.168.1.0/24'],

is treated as the directive 'Allow from 1.2.3.0/24 from 192.168.1.0/24'
which of course doesn't work.

Allow = [['from 1.2.3.0/24'], ['from 192.168.1.0/24']],

gives me the following error:

[Mon Jul 30 09:55:21 2001] [error] Perl: allow requires at least two
arguments, 'from' followed by hostnames or IP-address wildcards

The Eagle says that directives that occur multiple times should be an
array of arrays. And it works when I'm not using a single arrayref for
the configuration.

Steve

 -Original Message-
 From: Steve Piner
 To: [EMAIL PROTECTED]
 Sent: 7/27/01 12:26 AM
 Subject: Problem with arrayrefs in PSections
 
 I've come across an oddity in configuring Apache through Perl sections.
 
 If I have a local as follows,
 
 my %access = (
 Order = 'deny,allow',
 Deny = 'from all',
 Allow = [['from', '1.2.3.0/24'],
   ['from', '192.168.1.0/24']],
 );
 
 then set up locations (or directorys) as follows
 
 %Location = (
 '/server-status' = {
 SetHandler = 'server-status',
 %access,
 },
 '/server-info' = {
 SetHandler = 'server-info',
 %access,
 },
 );
 
 Then only one of the locations will let me access it.
 
 http://servername/server-status will let me in,
 http://servername/server-info won't.
 
 The problem seems to be with the shared reference: changing the 'Allow'
 line above to
 Allow = 'from all' works - though without the desired restriction of
 course, as does
 changing the code above to the following.
 
 %Location = (
 '/server-status' = {
 SetHandler = 'server-status',
 %access,
 Allow = [['from', '1.2.3.0/24'],
   ['from', '192.168.1.0/24']],
 },
 '/server-info' = {
 SetHandler = 'server-info',
 %access,
 Allow = [['from', '1.2.3.0/24'],
   ['from', '192.168.1.0/24']],
 },
 );
 
 Is this a bug, a stupid-user problem, or something else?
 
 I'm using Apache/1.3.20, mod_perl/1.25 and 1.26, and Perl v5.6.1
 
 Steve
 
 --
 Steve Piner
 Web Applications Developer
 Marketview Limited
 http://www.marketview.co.nz

-- 
Steve Piner
Web Applications Developer
Marketview Limited
http://www.marketview.co.nz



Using Apache::Reload in development environment?

2001-07-29 Thread Philip Mak

I have a site running mod_perl that I'm constantly making changes to.

What do I have to do in order to make it so that when I edit any file
(either a .pl script directly called on the site, or a .pm module that my
perl script uses), then the changes will take effect automatically? I
would rather not have to go into each file manually and put use
Apache::Reload.

Do I just put

PerlInitHandler Apache::Reload

in httpd.conf? Is there anything else that I have to do?




Re: Apache::DBI

2001-07-29 Thread will trillich

On Thu, Jul 26, 2001 at 07:48:14AM -0600, Castellon, Francisco wrote:
   Does anyone know if Apache::DBI is included with mod_perl? if not
 could someone tell me where i could get it from?

if you're using DEBIAN, you find it like this:

$ dpkg -S Apache::DBI
libapache-dbi-perl: /usr/share/man/man3/Apache::DBI.3pm.gz
libapache-dbilogger-perl: /usr/man/man3/Apache::DBILogger.3pm.gz

so (as root) you'd just

# apt-get install libapache-dbi-perl

and you're off to the races.

-- 
I'd concentrate on living in the now because it is fun
and on building a better world because it is possible.
- Tod Steward

[EMAIL PROTECTED]
http://sourceforge.net/projects/newbiedoc -- we need your brain!
http://www.dontUthink.com/ -- your brain needs us!



Re: Apache=SCALAR(?????)

2001-07-29 Thread will trillich

On Fri, Jul 27, 2001 at 04:04:54PM -0700, Jeffrey W. Baker wrote:
 
 
 On Fri, 27 Jul 2001, Greg Lontok wrote:
 
  hello,
 
  I recently changed a username/password check script to mod_perl, however
  when under mod_perl, I noticed that failed logins with the correct username
  and password combination show the password in the log as Apache=SCALAR(???),
  i.e. Apache=SCALAR(0x2d9f74). What is mod_perl doing here to my password
  parameter.
 
 This is a basic Perl question.  Apache=SCALAR(0xcafebabe) means that the
 thing you printed is scalar reference to an object, blessed into the
 Apache class, and its memory address is 0xcafebabe.

meaning, more or less, somewhere you're doing this --

package Apache;
my $item;
print \$item;

or

use Apache;
my $something = \$Apache::patricularGizmo;
print $something;

or

use Apache;
print Apache-pickAMethod($value,@list); # which returns a scalar ref

or... :}

-- 
I'd concentrate on living in the now because it is fun
and on building a better world because it is possible.
- Tod Steward

[EMAIL PROTECTED]
http://sourceforge.net/projects/newbiedoc -- we need your brain!
http://www.dontUthink.com/ -- your brain needs us!



Re: [Problem] Can't return Content-type with SERVER_ERROR

2001-07-29 Thread Stas Bekman

On Sun, 29 Jul 2001, Paul Kulchenko wrote:

 Hi, All!

 Code is simple, but I can't return custom content-type with
 SERVER_ERROR:

 sub handler {

   . $self-response is HTTP::Response object

   if ($self-response-is_success) {
 $self-response-headers-scan(sub { $r-header_out(@_) });
 $r-send_http_header(join '; ', $self-response-content_type);
 $r-print($self-response-content);
   } else {
 $self-response-headers-scan(sub { $r-err_header_out(@_) });
 $r-content_type(join '; ', $self-response-content_type);
 $r-custom_response($self-response-code,
 $self-response-content);
   }
   $self-response-code;
 }

i think you want to use err_headers_out() instead.
http://www.modperl.com/book/chapters/ch9.html#Server_Response_Methods

 In ALL cases (200OK and 500ServerError) I need to return error code,
 content, content-type and optional headers.

 Regardless of my settings content-type is always text/html;
 charset=iso-8859-1 which I expect to be text/xml; charset=utf-8:

 HTTP/1.1 500 Internal Server Error
 Connection: close
 Date: Sun, 29 Jul 2001 16:01:20 GMT
 Server: Apache/1.3.12 (Win32) mod_perl/1.23
 Content-Length: 642
 Content-Type: text/html; charset=iso-8859-1
 Client-Date: Sun, 29 Jul 2001 16:01:22 GMT
 Client-Peer: 127.0.0.1:80
 SOAPServer: SOAP::Lite/Perl/0.51

 ?xml version=1.0 encoding=UTF-8?SOAP-ENV:Envelope
 xmlns:SOAP-ENC=http://schemas.xmlsoap.org/soap/encoding/;
 SOAP-ENV:encodingStyle=http://schemas.xmlsoap.org/soap/encoding/;
 xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/;
 xmlns:xsi=http://www.w3.org/1999/XMLSchema-instance;
 
xmlns:xsd=http://www.w3.org/1999/XMLSchema;SOAP-ENV:BodySOAP-ENV:Faultfaultcode
 xsi:type=xsd:stringSOAP-ENV:Client/faultcodefaultstring
 xsi:type=xsd:stringFailed to locate method (echo1) in class
 (My::Parameters) at C:/Perl/site/5.6.0/lib/SOAP/Lite.pm line 1997.
 /faultstring/SOAP-ENV:Fault/SOAP-ENV:Body/SOAP-ENV:Envelope

 What am I doing wrong and what is the correct way to specify custom
 content-type? Everything works fine with 200OK. Thanks a lot.

 Best wishes, Paul.

 __
 Do You Yahoo!?
 Make international calls for as low as $.04/minute with Yahoo! Messenger
 http://phonecard.yahoo.com/




_
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://eXtropia.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/