Skip to search.

Breaking News Visit Yahoo! News for the latest.

×Close this window

modperl · Perl module for Apache

The Yahoo! Groups Product Blog

Check it out!

Group Information

? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Messages

Advanced
Messages Help
Messages 63146 - 63175 of 67621   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Show Message Summaries Sort by Date ^  
#63146 From: Tom Schindl <tomAtLinux@...>
Date: Tue Feb 1, 2005 7:08 am
Subject: Re: file upload problem
tomAtLinux@...
Send Email Send Email
 
John Saylor wrote:
> hi
>
> i'm trying to make this modperl upload handler work and it doesn't. it
> keeps giving me absolutely nothing for the file [but gives all the
> params and their values just fine].
>
[...]

Does your form pass things using the appropiate enctype: multipart/form-data

Tom

#63147 From: "Philippe M. Chiasson" <gozer@...>
Date: Tue Feb 1, 2005 6:50 pm
Subject: Re: Creating a filter for all text/html files
gozer@...
Send Email Send Email
 
Scott Gifford wrote:
> Hello,
>
> [...]
>
> I've got it working right now, but I'd like it to know the
> Content-Type that Apache would use for a document, so I can decide
> whether to filter it and so I can send a correct Content-Type header.

$r->content_type should tell you that.

http://perl.apache.org/docs/2.0/api/Apache/RequestRec.html#C_content_type_

> I can try to guess the content-type from the filename (which is what
> I'm doing now), but I'd prefer not to re-implement Apache's system for
> deciding content types, and I'd also like it to Do The Right Thing for
> CGI/mod_perl scripts, where you can't tell by the filename what
> content-type they're going to output.

Yes, certainly a good idea not to do anything of the sort. Let Apache tell you
that.

--------------------------------------------------------------------------------
Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5
http://gozer.ectoplasm.org/     F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5

#63148 From: Geoffrey Young <geoff@...>
Date: Tue Feb 1, 2005 7:01 pm
Subject: Re: Creating a filter for all text/html files
geoff@...
Send Email Send Email
 
> I can try to guess the content-type from the filename (which is what
> I'm doing now), but I'd prefer not to re-implement Apache's system for
> deciding content types, and I'd also like it to Do The Right Thing for
> CGI/mod_perl scripts, where you can't tell by the filename what
> content-type they're going to output.

in addition to what philippe said, Apache::Clean for mp2 should prove as a
good example for you to follow:

   http://search.cpan.org/~geoff/Apache-Clean-2.00_4/

see also the two articles on perl.com that talk about this particular module:

   http://www.perl.com/pub/a/2003/04/17/filters.html
   http://www.perl.com/pub/a/2003/05/22/testing.html

HTH

--Geoff

#63149 From: "Philippe M. Chiasson" <gozer@...>
Date: Tue Feb 1, 2005 9:05 pm
Subject: Re: [mp2] retrieving the calling handler
gozer@...
Send Email Send Email
 
Dorian Taylor wrote:
> how would i go about retrieving (mod_perl or otherwise) the name
> of the immediate calling handler of the current handler being
> executed?
>
> i'm trying to do loop checking in which a given handler may need
> to be executed as a result of multiple subrequests, but never back
> to back.

There was someone with a similar problem just a while ago:

http://gossamer-threads.com/lists/modperl/modperl/77721

I believe it is relevant to your question.

--------------------------------------------------------------------------------
Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5
http://gozer.ectoplasm.org/     F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5

#63150 From: "Rob Mueller" <robm@...>
Date: Tue Feb 1, 2005 10:06 pm
Subject: Re: Barrier to implementing web content compression in mod_perl
robm@...
Send Email Send Email
 
I'm surprised nobody has mentioned this yet on the list, but one approach
I'd recommend is going to 2 separate apache servers. A light frontend one
that does all the SSL/compression work, and a heavy backend mod_perl one.

http://modperlbook.org/html/ch12_01.html

This works fantastic for us, and avoids any of the issues of chained filters
in the mod_perl process. The light weight servers can easily do the
compression and SSL work and deal with clients on slow networks, leaving our
mod_perl servers to do the actual processing. Even though we process 2M+
requests a day, we generally don't have more than 20 mod_perl httpd procs at
any one time, while having 500-1000 frontend apache procs dealing with the
slow network clients.

We personally use mod_accel and mod_deflate written by Igor Sysoev. Although
most of the docs are in russian, we managed to get it working, and it's been
one of those things that has "just worked" since day 1. Anytime we've had
any technical issues, I've emailed Igor, and he's been fast and responsive
to reply and help, and he knows his stuff!

http://sysoev.ru/en/

See the link at the bottom for our success story and compilation procedure.

Good luck.

Rob

#63151 From: colin_e <colin_e@...>
Date: Tue Feb 1, 2005 10:31 pm
Subject: Re: setting environment variables
colin_e@...
Send Email Send Email
 
Geoff,
     I ran into some weirdness in this area (on a Win XP machine running
Apache 2.0.52)
that seemed to be related to using lowercase environment variable names.
It looked as if
PerlSetEnv uppercased the variable names, whereas SetEnv just ignored
vars with lower
case names.

Sounds weird I know, and I didn't pin it down exactly, but try uppercase
variables and
see if this works for you.

Regards: Colin

Geoffrey Young wrote:

>Octavian Rasnita wrote:
>
>
>>Hi,
>>
>>I have tried to put the following lines in httpd.conf:
>>
>>SetEnv user "gigel"
>>SetEnv pass "parola"
>>
>>Well, if I print the environment variables using a cgi script, they are
>>printed fine, but if I use MP, their values are not printed, and I can see
>>just a:
>>
>>user=
>>pass=
>>
>>Please tell me how can I do this to work fine with ModPerl also.
>>
>>
>
>please see
>
>  http://perl.apache.org/bugs/
>
>and report back with all the relevant info.  whether you are using a handler
>or Registry is also important.
>
>--Geoff
>
>
>
>

#63152 From: "shawn" <shawn@...>
Date: Wed Feb 2, 2005 3:35 am
Subject: Memory Question
shawn@...
Send Email Send Email
 

Hi, I am sure this is a simple question but I just can’t seem to find any documentation that can tell me exactly what is wrong. The current box I am running my apache 1.3.28 / Mod_perl server is a quad zeon 500 with 3GB of Ram, the server in general doesn’t get all that many hits, around 300,000 a day. Lately I have been seeing “server reached MaxClients setting, consider raising the MaxClients setting” about 6 seconds after I start up apache. Then I added

 

#memory info

<Location /perl-status>

        PerlModule Apache::Status

        PerlModule B::TerseSize

        SetHandler perl-script

        PerlHandler Apache::Status

        PerlSetVar StatusTerse On

        PerlSetVar StatusTerseSize On

        PerlSetVar StatusTerseSizeMainSummary On

        PerlSetVar StatusDumper On

        PerlSetVar StatusPeek On

</Location>

 

and found the average site to be 37MB so I added

 

PerlFixupHandler Apache::SizeLimit

$Apache::SizeLimit::MAX_UNSHARED_SIZE = 50000;

$Apache::SizeLimit::CHECK_EVERY_N_REQUESTS = 10;

 

 

Which I thought should cap it at 50MB so 3000 / 50 = 60 so I set

 

MinSpareServers 5

MaxSpareServers 10

StartServers 20

MaxClients 60

MaxRequestsPerChild 5000

 

Which in my mind should basically use up all 3GB of memory before I see the “server reached MaxClients setting, consider raising the MaxClients setting” but when the MaxClients error appears the memory is hardly being used at all

 

Cat /proc/meminfo

MemTotal:      3116164 kB

MemFree:       1929260 kB

Buffers:         40656 kB

Cached:         127360 kB

SwapCached:      11028 kB

Active:        1094232 kB

Inactive:        49228 kB

HighTotal:     2228208 kB

HighFree:      1133632 kB

LowTotal:       887956 kB

LowFree:        795628 kB

SwapTotal:     1048536 kB

SwapFree:      1031008 kB

Dirty:             340 kB

Writeback:           0 kB

Mapped:         974096 kB

Slab:            29068 kB

Committed_AS:  1390760 kB

PageTables:       3156 kB

VmallocTotal:   114680 kB

VmallocUsed:       648 kB

VmallocChunk:   114032 kB

HugePages_Total:     0

HugePages_Free:      0

Hugepagesize:     4096 kB

 

Free –lm –s 3

                        total       used       free     shared    buffers     cached

Mem:                3043       1126       1916          0         39        124

Low:                 867         90        777          0          0          0

High:                 2175       1036       1139          0          0          0

-/+ buffers/cache:           961       2081

Swap:               1023         17       1006

 

Which I can’t understand….. Why is there free memory if the max clients has already been reached? Shouldn’t there be 3GB used or cached before it wants more? Consequently the server is very up and down…… If anyone could explain this to me I would greatly appreciate it.

 

Thanks

Shawn

 


#63153 From: Stas Bekman <stas@...>
Date: Wed Feb 2, 2005 3:41 am
Subject: Re: make test failed on solaris 8
stas@...
Send Email Send Email
 
Tulan W. Hu wrote:
>>I'm not sure what went wrong, but there is nothing in the log. And there
>>must be something since you had 'Access Denied'
>
>
> Does it need to access on internet? I need to have a proxy setting to go
> out.

No, no, none of the tests require that.

>>Please do:
>>
>>t/TEST -clean
>>t/TEST -verbose t/protocol/pseudo_http.t t/apr/util.t

> t/protocol/pseudo_http....# connecting to localhost:8544

> # send: foobar
> # testing : banner
> # expected: Welcome to TestProtocol::pseudo_http
> # received: Access Denied
> not ok 5

So for some reason one of the AAA phases fail. Please apply this patch, run:

t/TEST -clean
t/TEST -verbose t/protocol/pseudo_http.t

and post only t/logs/error_log.

Index: t/protocol/TestProtocol/pseudo_http.pm
===================================================================
--- t/protocol/TestProtocol/pseudo_http.pm      (revision 148914)
+++ t/protocol/TestProtocol/pseudo_http.pm      (working copy)
@@ -84,6 +84,8 @@
       for my $method (qw(run_access_checker run_check_user_id
                          run_auth_checker)) {

+        warn "starting method: $method\n";
+
           my $rc = $r->$method();

           if ($rc != Apache::OK and $rc != Apache::DECLINED) {
@@ -98,8 +100,13 @@
               my $username = prompt($socket, "Login");
               my $password = prompt($socket, "Password");

+            warn "u/p: $username/$password\n";
+
               $r->set_basic_credentials($username, $password);
           }
+
+        warn "finished method: $method\n";
+
       }

       return Apache::OK;

> t/apr/util................1..4
> # Running under perl version 5.008006 for solaris
> # Current time local: Mon Jan 31 09:16:52 2005
> # Current time GMT:   Mon Jan 31 14:16:52 2005
> # Using Test.pm version 1.25
> # Using Apache/Test.pm version 1.21
> ok 1
> # crypt
> ok 2
> # sha1
> not ok 3

here the sha1 fails. it's strange because apparently the same test running
outside of modperl (i.e. t/apr-ext/util.t) doesn't have this problem. Is
that correct? Can you post the output of:

t/TEST -v t/apr-ext/util.t



--
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@... http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

#63154 From: Stas Bekman <stas@...>
Date: Wed Feb 2, 2005 3:52 am
Subject: Re: setting environment variables
stas@...
Send Email Send Email
 
colin_e wrote:
> Geoff,
>    I ran into some weirdness in this area (on a Win XP machine running
> Apache 2.0.52)
> that seemed to be related to using lowercase environment variable names.
> It looked as if
> PerlSetEnv uppercased the variable names, whereas SetEnv just ignored
> vars with lower
> case names.
>
> Sounds weird I know, and I didn't pin it down exactly, but try uppercase
> variables and
> see if this works for you.

That's probably due to the differences of how perl and Apache interpret
environ on win32. mod_perl really calls perl's funcs to get the env. I'm
sure if you try that on the command line (plain perl) you will see the
same behavior. something like:

setenv foo bar (whatever it is on win32)
perl -le 'print $ENV{FOO}'

on unix that won't work, but on win32 it should print 'bar'.

I believe Randy has mentioned this before.

How does mp1 deals with that?

Randy?


--
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@... http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

#63155 From: Stas Bekman <stas@...>
Date: Wed Feb 2, 2005 4:03 am
Subject: Re: Memory Question
stas@...
Send Email Send Email
 
shawn wrote:
> Hi, I am sure this is a simple question but I just can’t seem to find
> any documentation that can tell me exactly what is wrong. The current
> box I am running my apache 1.3.28 / Mod_perl server is a quad zeon 500
> with 3GB of Ram,

wow! I won't mind having one of those warming my room on the cold nights :)

> the server in general doesn’t get all that many hits,
> around 300,000 a day. Lately I have been seeing “server reached
> MaxClients setting, consider raising the MaxClients setting” about 6
> seconds after I start up apache. Then I added
[....]
> and found the average site to be 37MB so I added
>
> PerlFixupHandler Apache::SizeLimit
>
> $Apache::SizeLimit::MAX_UNSHARED_SIZE = 50000;
>
> $Apache::SizeLimit::CHECK_EVERY_N_REQUESTS = 10;

but it gets checked every 10 requests per process! So if you have 60
processes. that means only on the 600th request it'll get checked. At
least while debugging I'd check every request. But see below.

> Which I thought should cap it at 50MB so 3000 / 50 = 60 so I set

What this has to do with the memory limit? You hit the maxclients because
Apache has spawned 60 clients, not because you run out of memory. That
normally means that you either have 60 concurrent requests or you have
some sort of run-away processes, which don't return to the pool of free
servers.

I suggest that you install Apache::VMonitor and observe what exactly
happens to your servers. Hint: it'll also show you the real memory usage,
which you may have calculated incorrectly with other tools.

And you may want to review those chapters/sections:

http://modperlbook.org/html/ch10_01.html
http://modperlbook.org/html/ch11_01.html#pmodperl-CHP-11-SECT-1

--
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@... http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

#63156 From: jonathan vanasco <jvanasco@...>
Date: Wed Feb 2, 2005 4:52 am
Subject: Storing Objects in a Session
jvanasco@...
Send Email Send Email
 
slightly OT, but i'm doing this in mod_perl!

server
	 Apache/2.0.52 (Unix)
	 mod_perl/1.99_16
	 Perl/v5.8.1

use
	 use Apache::Cookie;
	 use Apache::Request ();
	 use Apache::Session;
	 use Apache::Session::File;

is there any way to store an object into an Apache Session ?

all attempts have been fruitless.  i'd rather not rebuild the object by
hand each time, but if needed i will.

#63157 From: Randy Kobes <randy@...>
Date: Wed Feb 2, 2005 4:53 am
Subject: Re: setting environment variables
randy@...
Send Email Send Email
 
On Tue, 1 Feb 2005, Stas Bekman wrote:

> colin_e wrote:
> > Geoff,
> >    I ran into some weirdness in this area (on a Win XP
> > machine running Apache 2.0.52) that seemed to be related
> > to using lowercase environment variable names.  It
> > looked as if PerlSetEnv uppercased the variable names,
> > whereas SetEnv just ignored vars with lower case names.
> >
> > Sounds weird I know, and I didn't pin it down exactly,
> > but try uppercase variables and see if this works for
> > you.
>
> That's probably due to the differences of how perl and
> Apache interpret environ on win32. mod_perl really calls
> perl's funcs to get the env. I'm sure if you try that on
> the command line (plain perl) you will see the same
> behavior. something like:
>
> setenv foo bar (whatever it is on win32)
> perl -le 'print $ENV{FOO}'
>
> on unix that won't work, but on win32 it should print 'bar'.

That's right, Stas - on Win32,
    C:\> set foo=bar
    C:\> perl -le "print $ENV{FOO}"
prints "bar".

> I believe Randy has mentioned this before.
>
> How does mp1 deals with that?
>
> Randy?

There is a difference in this respect between mp1 and mp2.
For example, with a registry script that has
    print "Foo = $ENV{Foo}<BR />";
    print "FOO = $ENV{FOO}<BR />";
    print "foo = $ENV{foo}<BR />";
one obtains:

- under Apache1/mp1,
    SetEnv Foo Bar
    SetEnv FOO BAR
yields
   Foo = BAR
   FOO = BAR
   foo = BAR
whereas
    PerlSetEnv Foo Bar
    PerlSetEnv FOO BAR
yields
   Foo = BAR
   FOO = BAR
   foo = BAR
So under mp1, SetEnv and PerlSetEnv behave the same,
as far as case goes.

- under Apache2/mp2,
    SetEnv Foo Bar
    SetEnv FOO BAR
yields
   Foo = bar
   FOO = bar
   foo = bar
whereas
    PerlSetEnv Foo Bar
    PerlSetEnv FOO BAR
yields
   Foo = BAR
   FOO = BAR
   foo = BAR

So the behaviour of SetEnv changed from Apache-1 to
Apache-2, as far as Win32 case goes, while PerlSetEnv
maintained the same behaviour from mp1 to mp2.

I suppose one could argue that we should change
PerlSetEnv under mp2 to lower-case things, so as
to be consistent with SetEnv?

--
best regards,
randy

#63158 From: David J Radunz <david.radunz@...>
Date: Wed Feb 2, 2005 5:00 am
Subject: Re: Storing Objects in a Session
david.radunz@...
Send Email Send Email
 
On Tue, 2005-02-01 at 23:52 -0500, jonathan vanasco wrote:
> slightly OT, but i'm doing this in mod_perl!
>
> server
>  Apache/2.0.52 (Unix)
>  mod_perl/1.99_16
>  Perl/v5.8.1
>
> use
>  use Apache::Cookie;
>  use Apache::Request ();
>  use Apache::Session;
>  use Apache::Session::File;
>
> is there any way to store an object into an Apache Session ?
>

Have you tried to freeze your object and then thaw it on retrieve?

perl -MCPAN -e install Storable
perldoc Storable

> all attempts have been fruitless.  i'd rather not rebuild the object by
> hand each time, but if needed i will.
>

This email and any files transmitted with it are confidential and intended
solely for the
use of the individual or entity to whom they are addressed. Please notify the
sender
immediately by email if you have received this email by mistake and delete this
email
from your system. Please note that any views or opinions presented in this email
are solely
  those of the author and do not necessarily represent those of the organisation.
Finally, the recipient should check this email and any attachments for the
presence of
viruses. The organisation accepts no liability for any damage caused by any
virus
transmitted by this email.

#63159 From: Perrin Harkins <perrin@...>
Date: Wed Feb 2, 2005 5:28 am
Subject: Re: Storing Objects in a Session
perrin@...
Send Email Send Email
 
jonathan vanasco wrote:
> is there any way to store an object into an Apache Session ?

Yes, you put any object in Apache::Session as long as it can be handled
by Storable.  You'll need to tell us what you tried and what didn't work
about it before we can help you more.

- Perrin

#63160 From: "Henrik Steffen" <steffen@...>
Date: Wed Feb 2, 2005 10:32 am
Subject: Trouble using Tie::RDBM
steffen@...
Send Email Send Email
 
Hello,

I wonder if someone could possible help me with an issue
regarding Tie::RDBM.

I am using it on a mod_perl 2.0 enabled website with apache
2.0.51 with persistent database connections to a postgresql-backend.

Everything works fine, but every once in a while there will
be an error in the error_log stating:

Can't call method "fetchrow_arrayref" on an undefined value
at /usr/lib/perl5/site_perl/5.8.3/Tie/RDBM.pm line 166

Module version is 0.7

I use the Tie::RDBM functinonality to translate contents
of webpage like this:

print<<HTML;
<h1>$translate{welcome_fellow}</h1>
<h2>$translate{this_is_an_example}</h2>
HTML

where the %translate hash is either tied to a table including
German key/value pairs, or English, Danish, Polish or whatever.

Now sometimes it happens, that some keys within a single
webpage are translated, but suddenly there's one particular
key, where the above error is raised and script execution is
terminated with a 500 Internal Server Error.

My only explanation is that the connection to the backend dies
for some reason just between two requests to the backend.

Did you anyone ever encounter such trouble? Can you give me a hint?

Or would it make sense to modify the Tie::RDBM module by adding
a check whether the backend is still alive just before executing
a statement?

Any help appreciated,

thanks in advance,


--

Kind regards

Henrik Steffen

top concepts Internetmarketing GmbH
Am Steinkamp 7 - D-21684 Stade - Germany
--------------------------------------------------------
http://www.topconcepts.de       Tel. +49 1805 9977 501*
mail: steffen@...    Fax. +49 1805 9977 502*
--------------------------------------------------------
SMS Versand ab 9.9 Cent: http://sms-gw.topconcepts.de
--------------------------------------------------------
Handelsregister: AG Stade HRB 5811 - UstId: DE 213645563
--------------------------------------------------------
*) EUR 0,12/Min. (CNS24)

Unterstützen auch Sie den
Bau der Küstenautobahn A22: http://www.a22-jetzt.de

#63161 From: ds10025@...
Date: Wed Feb 2, 2005 12:36 pm
Subject: POSIX valid_user.al
ds10025@...
Send Email Send Email
 
Morning


I'm trying to run Authen:Smb

After spending some time debugging, it returns an error can not locate
valid_user.al

valid_user() is a function call from within Authen::Smb.

Which package/module contain valid_user.al ?

Dan

#63162 From: Roman Va¹íèek <rv@...>
Date: Wed Feb 2, 2005 12:40 pm
Subject: Re: POSIX valid_user.al
rv@...
Send Email Send Email
 
Probably wrong/broken installation of Authen::Smb. Valid_User is defined
in file smbval/valid.c which is part of Authen::Smb distribution. Try to
recompile/reinstall Authen::Smb again.

   Roman

On Wed, Feb 02, 2005 at 12:36:06PM +0000, ds10025@... wrote:
> Morning
>
>
> I'm trying to run Authen:Smb
>
> After spending some time debugging, it returns an error can not locate
> valid_user.al
>
> valid_user() is a function call from within Authen::Smb.
>
> Which package/module contain valid_user.al ?
>
> Dan

--
  best regards
   Ing. Roman Vasicek

  software developer
+----------------------------------------------------------------------------+
  PetaMem s.r.o., Ocelarska 1, 190 00 Praha 9 - Liben, Czech Republic
  http://www.petamem.com/

#63163 From: Stas Bekman <stas@...>
Date: Wed Feb 2, 2005 1:18 pm
Subject: Re: setting environment variables
stas@...
Send Email Send Email
 
Randy Kobes wrote:
[...]
> So the behaviour of SetEnv changed from Apache-1 to
> Apache-2, as far as Win32 case goes, while PerlSetEnv
> maintained the same behaviour from mp1 to mp2.
>
> I suppose one could argue that we should change
> PerlSetEnv under mp2 to lower-case things, so as
> to be consistent with SetEnv?

I think yes. I'm sure you have a patch already :)



--
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@... http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

#63164 From: "Tulan W. Hu" <twhu@...>
Date: Wed Feb 2, 2005 1:19 pm
Subject: Re: make test failed on solaris 8
twhu@...
Send Email Send Email
 
1) Don't worry about the t/TEST -verbose t/apr/util.t anymore.
     The problem went away after I removed all RC4 and rebuilt it.
     don't really know what had happened.

2) After you mentioned AAA, I thought about our private modules again.
By default, they use cookie to authenticate instead of userid and passwd.
Unless the browser is set no cookie accept, the uid/pass will be prompted.
So that I tend to think that it may not be issues for those failures.
My question is if I can setup it not to use cookies in the test cases or the
conf file.

Our mp1 httpd.conf has
<directory /www/force/enter/uid/for/this/one>
         AuthCookieName NoCookieUsed
         AuthName "enter uid and password)"
         AuthType BasiC
         <limit GET POST>
             require valid-user
         </limit>
</directory>

$ t/TEST -clean
$ t/TEST -verbose t/protocol/pseudo_http.t
====error_log
END in modperl_extra.pl, pid=2338
[Wed Feb 02 07:23:35 2005] [notice] Apache/2.0.52 (Unix) world domination
series
/2.0 mod_perl/1.999.21 Perl/v5.8.6 configured -- resuming normal operations
[Wed Feb 02 07:23:35 2005] [info] Server built: Jan 31 2005 15:14:31
[Wed Feb 02 07:23:35 2005] [debug] prefork.c(955): AcceptMutex: fcntl
(default:fcntl)
starting method: run_access_checker
u/p: stas/foobar
finished method: run_access_checker
starting method: run_check_user_id
starting method: run_access_checker

*** The following error entry is expected and harmless ***
u/p: stas/foObaR
finished method: run_access_checker
starting method: run_check_user_id
[Wed Feb 02 07:23:39 2005] [info] Child process pid=2580 is exiting
[Wed Feb 02 07:23:39 2005] [info] Child process pid=2582 is exiting
END in modperl_extra.pl, pid=2580
END in modperl_extra.pl, pid=2582
[Wed Feb 02 07:23:39 2005] [info] Child process pid=2694 is exiting
END in modperl_extra.pl, pid=2694
[Wed Feb 02 07:23:39 2005] [info] removed PID file
/s5/twh/papache/mod_perl-2.0.0-RC4/t/logs/httpd.pid (pid=2462)
[Wed Feb 02 07:23:39 2005] [notice] caught SIGTERM, shutting down
END in modperl_extra.pl, pid=2462

#63165 From: Andrew Green <andrew@...>
Date: Wed Feb 2, 2005 2:54 pm
Subject: [mp1] Method handler that eventually seems to "forget" it's a method handler
andrew@...
Send Email Send Email
 
Hi,

I seem to have a bizarre problem with method handlers on my setup.  I
have a set of different handlers, all of which are method handlers so
that I can easily inherit shared code across a collection of different
installations of my application on the same server.

The first handler to get invoked is a PerlTransHandler -- everything
works fine (or at least seems to) for quite some time, but then the
handler begins "forgetting" that it's a method handler, and instead of
the class being passed before $r, $r becomes the first thing passed.
At least, that seems to be what's happening.  Is this a known problem?

My setup is as follows:

	  Perl 5.8.0 (Red Hat EL 3 default)
	  Apache/1.3.29
	  mod_perl/1.29


Here's what I imagine to be the relevant bits of httpd.conf:

	 MinSpareServers 10
	 MaxSpareServers 20
	 StartServers 10
	 MaxClients 60
	 MaxRequestsPerChild 1000
	 ...
	 <VirtualHost xxx>
		 PerlTransHandler MyApp::MyInstall::Dispatcher
		 ...


Here's the relevant bits of Dispatcher.pm:

	 package MyApp::MyInstall::Dispatcher;

	 use strict;
	 use Apache::Constants qw(OK DECLINED NOT_FOUND REDIRECT FORBIDDEN);
	 use Apache::URI;

	 our @ISA = qw(MyApp::Core::Dispatcher);

	 1;

	 ####

	 sub handler ($$) {

		 my ($class,$r) = @_;
		 return DECLINED unless ($r->is_initial_req());
		 ...


And here's the error (that only starts appearing after the server's
been running for a while:

	 Can't call method "is_initial_req" on an undefined value...

The error then points to the line quoted above.  Of course, Apache
never gets to other handlers later in the sequence, so I can't easily
see whether the problem is limited to TransHandlers, or whether all my
method handlers would stop acting as such.  Restarting the server makes
the problem go away -- for a while!

I'd really like to avoid having to upgrade/change Perl or mod_perl if
at all possible.  Nonetheless, any help, advice or guidance anyone can
provide would be very much appreciated.

Cheers,
Andrew.

#63166 From: Geoffrey Young <geoff@...>
Date: Wed Feb 2, 2005 3:10 pm
Subject: Re: [mp1] Method handler that eventually seems to "forget" it's a method handler
geoff@...
Send Email Send Email
 
>  <VirtualHost xxx>
> 	 PerlTransHandler MyApp::MyInstall::Dispatcher

make that

     PerlTransHandler MyApp::MyInstall::Dispatcher->handler

and see if that helps.  you should also be preloading via

   PerlModule MyApp::MyInstall::Dispatcher

or in a startup.pl.

HTH

--Geoff

#63167 From: Andrew Green <andrew@...>
Date: Wed Feb 2, 2005 3:25 pm
Subject: Re: [mp1] Method handler that eventually seems to "forget" it's a method handler
andrew@...
Send Email Send Email
 
On Wed, 02 Feb 2005 10:10:56 -0500, Geoffrey Young wrote:

>     PerlTransHandler MyApp::MyInstall::Dispatcher->handler
>
> and see if that helps.

I'll give that a go and see.  Is the following also kosher, then?

	 $r->push_handlers(
		 PerlCleanupHandler => MyApp::MyInstall::Cleaner->handler
	 );


> you should also be preloading via
>
>   PerlModule MyApp::MyInstall::Dispatcher
>
> or in a startup.pl.

Yes, I am -- sorry I forgot to mention this -- in a startup.pl, as
follows:

	 use MyApp::Core::Dispatcher ();
	 use MyApp::MyInstall::Dispatcher ();


Thanks for your help.

Cheers,
Andrew.
--
                    ::
       article seven       Andrew Green
  automatic internet       andrew@... | www.article7.co.uk

#63168 From: Geoffrey Young <geoff@...>
Date: Wed Feb 2, 2005 3:37 pm
Subject: Re: [mp1] Method handler that eventually seems to "forget" it's a method handler
geoff@...
Send Email Send Email
 
Andrew Green wrote:
> On Wed, 02 Feb 2005 10:10:56 -0500, Geoffrey Young wrote:
>
>
>>    PerlTransHandler MyApp::MyInstall::Dispatcher->handler
>>
>>and see if that helps.
>
>
> I'll give that a go and see.  Is the following also kosher, then?
>
>  $r->push_handlers(
> 	 PerlCleanupHandler => MyApp::MyInstall::Cleaner->handler
>  );

sorry, no - you can't currently push a method handler like that.  see the

   * method handler cached-CVs

entry in the STATUS file that ships with mod_perl-1.0 for some relevant links.

--Geoff

#63169 From: Geoffrey Young <geoff@...>
Date: Wed Feb 2, 2005 3:40 pm
Subject: Re: [mp1] Method handler that eventually seems to "forget" it's a method handler
geoff@...
Send Email Send Email
 
>>I'll give that a go and see.  Is the following also kosher, then?
>>
>> $r->push_handlers(
>>  PerlCleanupHandler => MyApp::MyInstall::Cleaner->handler
>> );
>
>
> sorry, no - you can't currently push a method handler like that.  see the
>
>   * method handler cached-CVs
>
> entry in the STATUS file that ships with mod_perl-1.0 for some relevant links.

and for those that don't go and read the links, while the above form isn't
valid you should be able to use this instead.

         $r->push_handlers(
		 PerlCleanupHandler => 'MyApp::MyInstall::Cleaner->handler'
	 );

(note the quotes)

--Geoff

#63170 From: ds10025@...
Date: Wed Feb 2, 2005 4:07 pm
Subject: Re: POSIX valid_user.al
ds10025@...
Send Email Send Email
 
I maybe missing something here.

I try to rpmbuild authen-smb.0.90.src.rpm

That fails to generate rpm file.

I did try to re-recompile authen-smb.0.91.tar.gz

It complies OK no errors.

It install Smb files. But, it do not generate valid_user.al file.

Do I need ti set a flag to create the valid_user.al file?

Dan
At 12:40 02/02/2005, Roman =?iso-8859-2?B?VmG57ehlaw==?= wrote:


>Probably wrong/broken installation of Authen::Smb. Valid_User is defined
>in file smbval/valid.c which is part of Authen::Smb distribution. Try to
>recompile/reinstall Authen::Smb again.
>
>   Roman
>
>On Wed, Feb 02, 2005 at 12:36:06PM +0000, ds10025@... wrote:
> > Morning
> >
> >
> > I'm trying to run Authen:Smb
> >
> > After spending some time debugging, it returns an error can not locate
> > valid_user.al
> >
> > valid_user() is a function call from within Authen::Smb.
> >
> > Which package/module contain valid_user.al ?
> >
> > Dan
>
>--
>  best regards
>   Ing. Roman Vasicek
>
>  software developer
>+----------------------------------------------------------------------------+
>  PetaMem s.r.o., Ocelarska 1, 190 00 Praha 9 - Liben, Czech Republic
>  http://www.petamem.com/

#63171 From: Martin Moss <martin_moss@...>
Date: Wed Feb 2, 2005 3:11 pm
Subject: Re: [mp1] Method handler that eventually seems to "forget" it's a method handler
martin_moss@...
Send Email Send Email
 
I've seen this problem and never got to the bottom of
it, on a redhat box with 5.8.3 (I think) and same
apache and mod_perl,

Marty




  --- Andrew Green <andrew@...> wrote:
> Hi,
>
> I seem to have a bizarre problem with method
> handlers on my setup.  I
> have a set of different handlers, all of which are
> method handlers so
> that I can easily inherit shared code across a
> collection of different
> installations of my application on the same server.
>
> The first handler to get invoked is a
> PerlTransHandler -- everything
> works fine (or at least seems to) for quite some
> time, but then the
> handler begins "forgetting" that it's a method
> handler, and instead of
> the class being passed before $r, $r becomes the
> first thing passed.
> At least, that seems to be what's happening.  Is
> this a known problem?
>
> My setup is as follows:
>
> 	 Perl 5.8.0 (Red Hat EL 3 default)
> 	 Apache/1.3.29
> 	 mod_perl/1.29
>
>
> Here's what I imagine to be the relevant bits of
> httpd.conf:
>
>  MinSpareServers 10
>  MaxSpareServers 20
>  StartServers 10
>  MaxClients 60
>  MaxRequestsPerChild 1000
>  ...
>  <VirtualHost xxx>
> 	 PerlTransHandler MyApp::MyInstall::Dispatcher
> 	 ...
>
>
> Here's the relevant bits of Dispatcher.pm:
>
>  package MyApp::MyInstall::Dispatcher;
>
>  use strict;
>  use Apache::Constants qw(OK DECLINED NOT_FOUND
> REDIRECT FORBIDDEN);
>  use Apache::URI;
>
>  our @ISA = qw(MyApp::Core::Dispatcher);
>
>  1;
>
>  ####
>
>  sub handler ($$) {
>
> 	 my ($class,$r) = @_;
> 	 return DECLINED unless ($r->is_initial_req());
> 	 ...
>
>
> And here's the error (that only starts appearing
> after the server's
> been running for a while:
>
>  Can't call method "is_initial_req" on an undefined
> value...
>
> The error then points to the line quoted above.  Of
> course, Apache
> never gets to other handlers later in the sequence,
> so I can't easily
> see whether the problem is limited to TransHandlers,
> or whether all my
> method handlers would stop acting as such.
> Restarting the server makes
> the problem go away -- for a while!
>
> I'd really like to avoid having to upgrade/change
> Perl or mod_perl if
> at all possible.  Nonetheless, any help, advice or
> guidance anyone can
> provide would be very much appreciated.
>
> Cheers,
> Andrew.
>





___________________________________________________________
ALL-NEW Yahoo! Messenger - all new features - even more fun!
http://uk.messenger.yahoo.com

#63172 From: Martin Moss <martin_moss@...>
Date: Wed Feb 2, 2005 3:14 pm
Subject: Re: [mp1] Method handler that eventually seems to "forget" it's a method handler
martin_moss@...
Send Email Send Email
 
I tried ->handler in my configs, made no difference.
I was doing a 'require' in a startup script if that
makes any difference. Haven't seen this issue with
simillar code anywhere else..

Marty

  --- Geoffrey Young <geoff@...> wrote:

>
> >  <VirtualHost xxx>
> > 	 PerlTransHandler MyApp::MyInstall::Dispatcher
>
> make that
>
>     PerlTransHandler
> MyApp::MyInstall::Dispatcher->handler
>
> and see if that helps.  you should also be
> preloading via
>
>   PerlModule MyApp::MyInstall::Dispatcher
>
> or in a startup.pl.
>
> HTH
>
> --Geoff
>





___________________________________________________________
ALL-NEW Yahoo! Messenger - all new features - even more fun!
http://uk.messenger.yahoo.com

#63173 From: Jonathan Vanasco <jvanasco@...>
Date: Wed Feb 2, 2005 5:26 pm
Subject: Re: Storing Objects in a Session
jvanasco@...
Send Email Send Email
 
On Feb 2, 2005, at 12:00 AM, David J Radunz wrote:
> Have you tried to freeze your object and then thaw it on retrieve?
>
> perl -MCPAN -e install Storable
> perldoc Storable

On Feb 2, 2005, at 12:28 AM, Perrin Harkins wrote:
> Yes, you put any object in Apache::Session as long as it can be
> handled by Storable.  You'll need to tell us what you tried and what
> didn't work about it before we can help you more.


I never thought of using storable.
I haven't actually done much work w/cookies and perl before
I thought i could just place an object in the tied session variable and
voila!

I'll try some session storable stuff now --

I'm basically trying to store the UserProfile object into the session,
so I can use the methods I've made to access data in it rather than
accessing the data directly (ideally, so that less things break in the
future)

#63174 From: Perrin Harkins <perrin@...>
Date: Wed Feb 2, 2005 5:39 pm
Subject: Re: Storing Objects in a Session
perrin@...
Send Email Send Email
 
On Wed, 2005-02-02 at 12:26 -0500, Jonathan Vanasco wrote:
> I never thought of using storable.

There's no need for you to use Storable.  Apache::Session does it
already.  Just put your objects in the session.

> I thought i could just place an object in the tied session variable and
> voila!

You can.

> I'm basically trying to store the UserProfile object into the session,
> so I can use the methods I've made to access data in it rather than
> accessing the data directly (ideally, so that less things break in the
> future)

Okay, so what's not working about it?  Show us some code and some error
messages.

- Perrin

#63175 From: Nick *** <doink123@...>
Date: Wed Feb 2, 2005 6:31 pm
Subject: Re: Re: mod_perl.c:61: `my_perl' undeclared under Cygwin
doink123@...
Send Email Send Email
 
>
  >Stas Bekman wrote:
  >> Nick *** wrote:
  >>>> [...]
  >>
  >> Yup, I can confirm that it's not working. I get a different error though:
  >>
  >>
/home/stas/apache.org/mp2-svn/src/modules/perl/mod_perl.a(modperl_xsinit.o)(.tex\
t+0x11):
  >> In function `xs_init':
  >> /home/stas/apache.org/mp2-svn/src/modules/perl/modperl_xsinit.c:57:
  >> undefined reference to `boot_Apache__URI'
  >>
  >> I had no idea we had this MP_STATIC_EXTS=1 option. I don't think it was
  >> tested since it was added some 3-4 years ago by Doug.
  >
  >Yeah, seems it's a usefull option that just fell off the radar, thus didn't
  >get tested much (if at all).
  >
  >> Philippe, do you know what does it do and why is it broken? (Philippe is
  >> the keeper of the static gate keys, amongs his other numerous occupations)
  >
  >It's fixed in r149218, was a simply typo in lib/ModPerl/BuildMM.pm

What is 'r149218'? I used the latest svn snapshot from today and it wasn't
working.

-----------------------------------------------------------------
http://gbg.bg/search - Èçïðîáâàéòå îùå ñåãà íàé-äîáðàòà áúëãàðñêà òúðñà÷êà!

Messages 63146 - 63175 of 67621   Oldest  |  < Older  |  Newer >  |  Newest
Add to My Yahoo!      XML What's This?

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help