Memory issues with DSO

2003-08-29 Thread Stathy G. Touloumis
Sorry that I neglected to list all info :

Apache version 1.3.27
mod_perl version 1.26
OS version RedHat Linux 2.4.20-18.7
perl -V :

Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration:
  Platform:
osname=linux, osvers=2.4.18-3smp, archname=i386-linux
uname='linux warehouse-dev.spacdock.com 2.4.18-3smp #1 smp thu apr 18 
07:27:31 edt 2002 i686 unknown '
config_args='-des -Doptimize=-O2 -march=i386 -mcpu=i686 -Dcc=gcc 
-Dcf_by=Red Hat, Inc. -Dcccdlflags=-fPIC -Dinstallprefix=/usr 
-Ubincompat5005 -Uusemymalloc -Dprefix=/usr -Darchname=i386-linux 
-Dvendorprefix=/usr -Dsiteprefix=/usr -Uusethreads -Uuseithreads 
-Uuselargefiles -Dd_dosuid -Dd_semctl_semun -Di_db -Di_ndbm -Di_gdbm 
-Di_shadow -Di_syslog -Dman3ext=3pm'
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef 
usemultiplicity=undef
useperlio=undef d_sfio=undef uselargefiles=undef usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
  Compiler:
cc='gcc', ccflags ='-fno-strict-aliasing -I/usr/local/include',
optimize='-O2 -march=i386 -mcpu=i686',
cppflags='-fno-strict-aliasing -I/usr/local/include'
ccversion='', gccversion='2.96 2731 (Red Hat Linux 7.3 2.96-110)', 
gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', 
lseeksize=4
alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
ld='gcc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lnsl -ldl -lm -lc -lcrypt -lutil
perllibs=-lnsl -ldl -lm -lc -lcrypt -lutil
libc=/lib/libc-2.2.5.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib'





--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html


Re: Memory issues with DSO

2003-08-29 Thread Stathy G. Touloumis

> should building a DSO in mod_perl 1.x versions just be avoided?

I think so, and so I think does Randal.  This was discussed briefly
here not long ago in a couple of threads, check the archives.
Thanks, I will check the archives.



--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html


Memory issues with DSO

2003-08-29 Thread Stathy G. Touloumis
I am experimenting with using mod_perl 1.2x as a DSO and have noticed that 
it does not share much memory between process and also seems to utilize 
much more memory.

I thought that it is possible to use mod_perl 1.2x as a DSO when perl is 
compile with -Uusemymalloc and -Ubincompat5005 which it is.  Is this a know 
issue and should building a DSO in mod_perl 1.x versions just be avoided?

Thanks,

Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration:
  Platform:
osname=linux, osvers=2.4.18-3smp, archname=i386-linux
uname='linux warehouse-dev.spacdock.com 2.4.18-3smp #1 smp thu apr 18 
07:27:31 edt 2002 i686 unknown '
config_args='-des -Doptimize=-O2 -march=i386 -mcpu=i686 -Dcc=gcc 
-Dcf_by=Red Hat, Inc. -Dcccdlflags=-fPIC -Dinstallprefix=/usr 
-Ubincompat5005 -Uusemymalloc -Dprefix=/usr -Darchname=i386-linux 
-Dvendorprefix=/usr -Dsiteprefix=/usr -Uusethreads -Uuseithreads 
-Uuselargefiles -Dd_dosuid -Dd_semctl_semun -Di_db -Di_ndbm -Di_gdbm 
-Di_shadow -Di_syslog -Dman3ext=3pm'
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef 
usemultiplicity=undef
useperlio=undef d_sfio=undef uselargefiles=undef usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
  Compiler:
cc='gcc', ccflags ='-fno-strict-aliasing -I/usr/local/include',
optimize='-O2 -march=i386 -mcpu=i686',
cppflags='-fno-strict-aliasing -I/usr/local/include'
ccversion='', gccversion='2.96 2731 (Red Hat Linux 7.3 2.96-110)', 
gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', 
lseeksize=4
alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
ld='gcc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lnsl -ldl -lm -lc -lcrypt -lutil
perllibs=-lnsl -ldl -lm -lc -lcrypt -lutil
libc=/lib/libc-2.2.5.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib'



--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html


Re: Application design patterns

2003-07-24 Thread Stathy G. Touloumis
## NOTE : Very simple example which for the most part
## will seem like overkill and it is.  Typically the complexity
## of the application can be reduced by breaking it into the
## components below.  It makes for easier maintenance.
## Model responsible for data retrieval not formatting.
##In many architectures data will be retrieved from
## some sort of data storage (rdbms).
#--- MODEL ---
package My::Model
sub title { return 'MVC Hello World Example'; }
sub new { return bless {}, shift };
sub enter_room { return 'Hello'; }
sub leave_room { return 'Bye'; }
## Responisble for presentation/formatting of data not
## modifying/retrieving data.
#--- VIEW ---
package My::View
sub new { return bless {}, shift };
sub output {
  my $p = { @_ };
  print <

$p->{'title'}


$p->{'data'}

HTML
}
## Handles user actions/events ... retrieve data through
## model layer and present data through view layer.
#--- CONTROLLER 
## Depending on the application (CGI, etc.) initialization code here

my $m = My::Model->new;
my $v = My::View->new;
my $data = $m->leave_room;

if ( $input == 'enter_room' ) {
$data = $m->enter_room;
}
$v->output(
title=> $v->title,
data=> $data,
);

  I too would like to would like to have a better understanding of how
  MVC can be applied to mod_perl.  Maybe even HelloWorld sized example
  showing how all of the different components interact?



Re: Simultaneous GET and POST data

2003-02-12 Thread Stathy G. Touloumis


I recently changed form handling and got bitten by query strings.  My
previous code
used CGI.pm to parse the arguments (but not to run my scripts).  When I
changed to
use Apache::Request to parse the arguments I found that I was seeing
both the query
string arguments and the posted argumnets.


I am using Mason with Apache::Request I believe.  I don't think the 
developer is doing anything on their own but I will check.  Is this 
behavior with CGI.pm sporadic?  It only happens once every few hundred 
(maybe thousand) requests of a certain page.




Simultaneous GET and POST data

2003-02-11 Thread Stathy G. Touloumis
Has anyone experienced issues with retrieving data when POSTed by a form 
whith an action parameter that has a query string attached to it?  On rare 
occasion it seems that the posted data is not available.


Apache/1.3.22 (Unix) mod_perl/1.26 mod_ssl/2.8.5 OpenSSL/0.9.6b
Mason 1.04
Template Toolkit 2.07



Re: Disabling TransHandler

2003-02-11 Thread Stathy G. Touloumis


Our sysadmin was attempting to disable a TransHandler for a virtual host 
using a directive that he used in the past.  I wasn't aware of such a 
directive and was further stumped when I saw it :
PerlSetVar authsession false
He does not remember where he got this from but it seems to work.  Any 
ideas as to why this would disable a TransHandler?  Where does it come 
from and what mod_perl code uses it?
The only TransHandler on this site makes no references to using any 
configuration variables set this way.

I suppose you had PerlPostReadRequestHandler which was doing:

my $auth = $r->dir_config('authsession');
$r->set_handlers(PerlTransHandler => sub { return OK })
  if $auth eq 'false';

this is not a magic internal feature ;)


Nope, I wrote every handler being used on the system and there is nothing 
that uses the 'authsession' directive/variable.

It turns out this variable did nothing ... the trans handler took care of a 
simple redirect under certain circumstances which the sys-admin wanted to 
avoid.  It turns out that some time ago he put an html file containing a 
redirect that pointed to where he wanted which the trans handler redirected 
to!  He just forgot he did this and assumed that the PerlSetVar directive 
was what prevented the trans handler from functioning ...

Thanks for the response : )



Re: Disabling TransHandler

2003-02-06 Thread Stathy G. Touloumis


Our sysadmin was attempting to disable a TransHandler for a virtual host 
using a directive that he used in the past.  I wasn't aware of such a 
directive and was further stumped when I saw it :
PerlSetVar authsession false
He does not remember where he got this from but it seems to work.  Any 
ideas as to why this would disable a TransHandler?  Where does it come 
from and what mod_perl code uses it?
The only TransHandler on this site makes no references to using any 
configuration variables set this way.

I suppose you had PerlPostReadRequestHandler which was doing:

my $auth = $r->dir_config('authsession');
$r->set_handlers(PerlTransHandler => sub { return OK })
  if $auth eq 'false';

this is not a magic internal feature ;)


Nope, I wrote every handler being used on the system and there is nothing 
that uses the 'authsession' directive/variable.



Disabling TransHandler

2003-02-06 Thread Stathy G. Touloumis
Our sysadmin was attempting to disable a TransHandler for a virtual host 
using a directive that he used in the past.  I wasn't aware of such a 
directive and was further stumped when I saw it :

PerlSetVar authsession false

He does not remember where he got this from but it seems to work.  Any 
ideas as to why this would disable a TransHandler?  Where does it come from 
and what mod_perl code uses it?

The only TransHandler on this site makes no references to using any 
configuration variables set this way.

Thanks, 



Re: Memory leak on reload when the 'Pg' driver is preloaded

2002-10-16 Thread Stathy G. Touloumis


>Using Debian's static-mod_perled apache-perl eliminates the problem.

Do you mean you are using the 'so' version that comes with Debian?  You 
should be using the static build of apache/mod_perl




mod_perl2.0 / TIPool

2002-06-13 Thread Stathy G. Touloumis

Is there an idea of when the TIPool API will be available for mod_perl 2.0?




RE: Apache::Session

2002-05-09 Thread Stathy G. Touloumis

> You need to do some more debugging.  Problems with Apache::Session are 
> usually due to scoping, so put in some debug statements to see that the 
> session objects for the IDs having trouble are getting properly cleaned 
> up (i.e. DESTROY is getting called).  It is possible to have problems 
> with DB_File if it doesn't get untied after each request.

Wouldn't the issue above (untie) be alleviated by restarting apache?




RE: Apache::Session

2002-05-09 Thread Stathy G. Touloumis

> You need to do some more debugging.  Problems with Apache::Session are
> usually due to scoping, so put in some debug statements to see that the
> session objects for the IDs having trouble are getting properly cleaned
> up (i.e. DESTROY is getting called).  It is possible to have problems
> with DB_File if it doesn't get untied after each request.

In my experience when untie is not called the request usually hangs.  It
seems odd that it would be isolated to just a few workstations though.  Is
it possible that the issue can be isolated to a child instance even with
different ID's?

Thanks for the response : )




RE: Distributed Sessioning

2002-04-19 Thread Stathy G. Touloumis

Thanks for the response.  If the systems were not supplied by third party
vendors how do you think you would implement it?

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of
> Richard L. Goerwitz III
> Sent: Friday, April 19, 2002 1:12 PM
> To: Stathy G. Touloumis
> Subject: Re: Distributed Sessioning
>
>
> "Stathy G. Touloumis" wrote:
> >
> > Does anyone have experience with distributed sessioning
> (transparent login
> > across networks)?  If yes can you share your experiences?
>
> It's hard to do because many of the systems in our network are vendor-
> supplied and don't work and play well with our authentication infra-
> structure.
>
> --
>
> Richard L. Goerwitz III  Email:
> [EMAIL PROTECTED]
> Phone: +1 507 646 5526   Fax: +1
> 507 646 4537
> PGP key fingerprint: 4471 B6D3 57CC B2DC A0CF  82D3 0B7D EA19 F425 B0E0




Distributed Sessioning

2002-04-19 Thread Stathy G. Touloumis

Does anyone have experience with distributed sessioning (transparent login
across networks)?  If yes can you share your experiences?

Thanks : )




RE: Apache::Session

2002-03-26 Thread Stathy G. Touloumis

Thanks for responding . . .

Not sure what else you need.  Destroying session objects?  Do you mean to
untie the session $obj?  This is done at the end of each request via untie
( untie(%$obj) ).  I have noticed behavior where when attempting to delete a
session object ( tied(%$obj)->delete ) I get a 'false' value returned which
I cannot figure out why.

> > Has anyone ran into issues with data being written to the data
> source using
> > Apache::Session::Store::DB_File and Apache::Session::Lock::File?  We are
> > running into a unique instance where a value is not being saved to the
> > session store at a certain point through a workflow.  There are multiple
> > frames which are making requests but only one frame makes the
> request to the
> > server which runs code to write to the Session store.  We do have
> > KeepAlive's enabled so I don't think there should be any
> contention issues
> > when attempting to write to the store.  Nevertheless this still
> seems like
> > the only reason this might be happening.
> >
> > Apache 1.3.22
> > mod_perl 1.26
> > Apache::Session 1.54
>
> Could you give a little more detail please?  Lots of people have lots of
> problems with Apache::Session, but it always comes down to not
> destroying Session objects.




Apache::Session

2002-03-25 Thread Stathy G. Touloumis

Has anyone ran into issues with data being written to the data source using
Apache::Session::Store::DB_File and Apache::Session::Lock::File?  We are
running into a unique instance where a value is not being saved to the
session store at a certain point through a workflow.  There are multiple
frames which are making requests but only one frame makes the request to the
server which runs code to write to the Session store.  We do have
KeepAlive's enabled so I don't think there should be any contention issues
when attempting to write to the store.  Nevertheless this still seems like
the only reason this might be happening.

Apache 1.3.22
mod_perl 1.26
Apache::Session 1.54

Thanks,





RE: handler not being called

2002-03-20 Thread Stathy G. Touloumis

Can you send the code for Demo.pm?

> I have added a handler entry in httpd.conf
>
> 
>   SetHandler perl-script
>   PerlHandler Demo
> 
>
> and I have printed a string inside the handler thats it.
> When I do GET on the URI I get the following error.
>
> 
> An Error Occurred
> 
> An Error Occurred
> 405 Method Not Allowed
> 
> 
>
>
>
> Why isnt the handler being called. The module: Demo.pm is placed in more
> than one @INC paths of perl.
>
> Waiting for help
>
>
> Riz
>
>
>
>
>
> - Original Message -
> From: "Francesc Guasch Ortiz" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, March 20, 2002 1:07 PM
> Subject: Re: apache dies silently at start with perl-5.6.1 rpm
>
>
> > Kurt Hansen escribió:
> > >
> > > Did you see this message from the Mason list? If so, did this solution
> not work
> > > for you?
> >
> > I installed an old Data::Dumper: Data-Dumper-2.101
> > Right now I have a compiled perl-5.6.1 and these apache-1.3.22-2 rpm.
> >
> > Now I can start apache with the mason handler, but as soon
> > as I add some DBI module in the handler.pl, it doesn't work:
> >
> > {  package HTML::Mason::Commands;
> > use DBI;
> > }
> >
> >
> > --
> > frankie
>




RE: apache dies silently at start with perl-5.6.1 rpm

2002-03-19 Thread Stathy G. Touloumis

One of the most common issues is that mod_perl is installed as a DSO and not
built statically into Apache.  mod_perl is usually installed this way with
rpm packages.

> I'm testing the latest perl rpms from redhat updates:
>   perl-5.6.1-26.72.3
>   mod_perl-1.26-2
>
> I'm using HTML::Mason.
>
> When I start apache it just dies silently without complaining
> and I got nothing in the logs.
>
> I even tried to remove the former perl and modules. I rpmed -e
> a lot of things. Then I removed the perl5 dirs and I installed
> perl and modules. That didn't worked.
>
> When I asked in the Mason list I was told it was a modperl issue.
>
> How can I debug what's happening ?
>
> I've also noticed the cpan binaries aren't seeing well the
> modules installed. When I do
> cpan> install Bundle::CPAN
>
> it starts downloading the perl-5.6.1 sources.
>
> I made sure there are no other perl file binaries nor cpan
> from other installations.




RE: Mapping files

2002-03-14 Thread Stathy G. Touloumis

Ok, I found an interim solution for my file mapping issue the problem I am
running into now is that get/post data associated with the request is lost .
. .

Is this covered in the mod_perl cookbook?

> > I am trying to map a uri to a file based on certain factors.  I
> would like
> > to have this done after the 'Trans' phase when certain information is
> > available.  I noticed when the original file mapping does not
> exist (what
> > apache maps in it's 'Trans' phase) the 'content_type' method
> does not return
> > a value.
>
>
> it shouldn't.  mod_mime needs the filename the URI maps to in
> order to determine
> the MIME type.
>
>
> I actually found an initial answer after digging through the docs.  After
> mapping the file I can create a new sub-request via lookup_file($filename)
> and take appropriate action.  So far so good . . .




RE: Mapping files

2002-03-13 Thread Stathy G. Touloumis

Well, I was able to do it nicely with a sub-request after calling
'lookup_filename'.  I will still be picking up a copy of the cookbook though
: )

> > I am trying to map a uri to a file based on certain factors.  I
> would like
> > to have this done after the 'Trans' phase when certain information is
> > available.  I noticed when the original file mapping does not
> exist (what
> > apache maps in it's 'Trans' phase) the 'content_type' method
> does not return
> > a value.
>
>
> it shouldn't.  mod_mime needs the filename the URI maps to in
> order to determine
> the MIME type.




RE: Mapping files

2002-03-13 Thread Stathy G. Touloumis

> Dumb first try suggestion...

: )

> Write your own super-short Trans handlers that stores the pre-mapped value
> in pnotes.

I actually found an initial answer after digging through the docs.  After
mapping the file I can create a new sub-request via lookup_file($filename)
and take appropriate action.  So far so good . . .




Mapping files

2002-03-13 Thread Stathy G. Touloumis

Hi,

I am trying to map a uri to a file based on certain factors.  I would like
to have this done after the 'Trans' phase when certain information is
available.  I noticed when the original file mapping does not exist (what
apache maps in it's 'Trans' phase) the 'content_type' method does not return
a value.  Also, even after remapping the file and changing the status a
'file not found' error is printed in the error logs.  Any pointers as to
what I might be doing wrong?

Thanks,




RE: Apache->print Timeout

2002-03-13 Thread Stathy G. Touloumis

Yeah that's what the Eagle book says.  I was surprised initially because our
timeout's are set to 10min. and the process seemed to end prematurely
(before 10min).

Thanks,

> > Do you know if this setting taken from the Apache conf
> directive 'Timeout'?
>
> $r->server->timeout directly gets/sets the value for the httpd.conf
> Timeout directive for the server in question - see Chapter 4 in the
> cookbook ;)
>
> I don't have a copy of the Eagle book in front of me, and we don't
> talk about these methods explicitly, but IIRC they manipulate Apache's
> internal timeouts, which are based on the Timeout setting.




RE: Apache->print Timeout

2002-03-13 Thread Stathy G. Touloumis

Thanks for the response,

Do you know if this setting taken from the Apache conf directive 'Timeout'?

Thanks ,

> -Original Message-
> From: Geoffrey Young [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, March 13, 2002 10:41 AM
> To: Stathy G. Touloumis
> Cc: [EMAIL PROTECTED]
> Subject: Re: Apache->print Timeout
>
>
> "Stathy G. Touloumis" wrote:
> >
> > Does anyone know how to set the time out value for
> Apache::print to a higher
> > value if possible or how to avoid a timeout??  I am performing an import
> > into a database that can vary in time (1min - 10min) and I
> would need to be
> > able to handle this situation.  Would it be better to spawn a
> subprocess and
> > have the client refresh to monitor the result (like
> Apache::UploadMeter)?
> >
> > [Wed Mar 13 10:28:41 2002] [info] [client 192.168.6.22] mod_perl:
> > Apache->print timed out
>
> look at $r->reset_timeout and kin in the eagle book.  you can also set
> the value of Timeout for the server dynamically using
> $r->server->timeout.
>
> HTH
>
> --Geoff
>




Apache->print Timeout

2002-03-13 Thread Stathy G. Touloumis

Does anyone know how to set the time out value for Apache::print to a higher
value if possible or how to avoid a timeout??  I am performing an import
into a database that can vary in time (1min - 10min) and I would need to be
able to handle this situation.  Would it be better to spawn a subprocess and
have the client refresh to monitor the result (like Apache::UploadMeter)?

[Wed Mar 13 10:28:41 2002] [info] [client 192.168.6.22] mod_perl:
Apache->print timed out





RE: here is a good modperl question on perlmonk

2002-03-06 Thread Stathy G. Touloumis

Unfortunately, this may also allow the developer to potentially change
code/configuration that you do not want changed.

> True...but I'm thinking full control to the developer. Developer can now
> mis-configure httpd.conf as much as he/she wants and all the paths;
> virtual or not are consistant, instead of a dev path vs
> production path
>
> I had a chance to work with Interwoven TeamSite and this very issue or
> virtual path was a pain, I had to add aditional checks in teh code to deal
> with that




RE: How to do connection pooling

2002-02-28 Thread Stathy G. Touloumis

Are you perhaps referring to KeepAlive of the TCP/IP client connection?

> >How can I maintain the connections in perl? For this I want to use 
> >connection pooling to contol the traffic of my site. How can I 
> do this in 
> >perl? Can anybody help me in this regard? If possible please give the 
> >steps included in this.
> 
> Is Apache::DBI what you need? If not, why?  It is in fact not about 
> controlling traffic, its about reusing database connections to 
> sve the time 
> needed for a connect.




XML::Twig

2002-02-28 Thread Stathy G. Touloumis

Hi,

Has anyone experienced problems when using the XML::Twig with mod_perl?
Everything works fine outside a mod_perl environment but when attempting to
perform the same functionality in mod_perl the child process seg faults even
when using 'safe_parse' which is supposed to wrap the parsing in an 'eval'
and return an error code instead of dying.

Thanks,




RE: Deleting a PerlSetVar variable

2002-02-26 Thread Stathy G. Touloumis

See chapter 8 of the Eagle book (Apache Modules in Perl/C) for complete
coverage of hooking into the apache configuration.  It really allows you to
do some pretty nifty stuff and would easily allow you to perform what you
want.  At first it seems overkill to know but once you do it opens many
doors for configuring and maintaining your apps IMHO.

There will be some code changes for accessing your configuration directives
but not anything more complex than accessing via PerlSetVar.

> What you have suggested can solve the problem... i'm however, preferably
> looking at deleting a set var via my apache config file, and don't have
> a '$r' /request_object available there.
>
> Doug et al, can i please suggest the addition of a:
>
>   * PerlDelVar or PerlUnsetVar
>
> to delete/unset a variable in the apache config file.
> I would make the changes and send in a patch, but i don't under the code
> (with my limited knowledge of C) well enough to do that.
>
> cheers,
>
> simran.
>
>
> On Tue, 2002-02-26 at 00:03, Geoffrey Young wrote:
> > simran wrote:
> > >
> > > Hi All,
> > >
> > > I could not find references on how to delete a varaible once set via
> > > PerlSetVar.
> > >
> > > I am setting a global 'PerlSetVar AuthNameExpires +24h' variable in my
> > > httpd.conf and want to be able to set it back to "expire at end of
> > > session" for some virtual hosts.
> > >
> > > If i could delete that variable, i could achieve that as per the spec,
> > > if the browser is not given a expiry time, the cookies lasts only for
> > > the session, however i so far have not been able to figure out how to
> > > delete a variable once set - anyone... ???
> > >
> >
> > you can use the Apache::Table interface for deleting (or setting or
> > manipulating) PerlSetVar
> >
> > $r->dir_config->unset('AuthNameExpires');
> >
> > see the latter part of recipe 3.14 in the cookbook for some additional
> > details on using the Apache::Table interface for dir_config, as well
> > as the Apache::Table manpage...
> >
> > HTH
> >
> > --Geoff
> >
>




RE: [Samba authorization]

2002-02-19 Thread Stathy G. Touloumis

You should probably contact the maintainers of Apache::AuthSmb and
kindly ask them to look into the problem : )  If I had some Sparcs lying
around
I would be willing to look into it but I don't ; )

> Please, let's continue discussing my problem. Remind you, that I
> installed mod_perl, Authen-Smb-0.91 and Apache-AuthenSmb-0.60 for
> authorization in apache against NT server. And I get this error in
> apache error.log file:
> "Undefined subroutine &Apache::AuthenSmb::handler called".
> In discussion we stopped at the point that I have wrong Smb.so file,
> because when I put "PerlModule Apache::AuthenSmb" in my httpd.conf file
> I get
> --
> Syntax error on line 346 of /usr/local/apache/conf/httpd.conf:
> Can't load
> '/usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/auto/Authen/Smb/Smb.so'
> for
> module Authen::Smb: ld.so.1: /usr/local/apache/bin/httpd: fatal:
> relocation error: file
> /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/auto/Authen/Smb/Smb.so:
> symbol main: referenced symbol not found at
> /usr/local/lib/perl5/5.6.1/sun4-solaris/DynaLoader.pm line 206.
>  at /usr/local/lib/perl5/site_perl/5.6.1/Apache/AuthenSmb.pm line 5
> Compilation failed in require at
> /usr/local/lib/perl5/site_perl/5.6.1/Apache/AuthenSmb.pm line 5.
> BEGIN failed--compilation aborted at
> /usr/local/lib/perl5/site_perl/5.6.1/Apache/AuthenSmb.pm line 5.
> Compilation failed in require at (eval 3) line 3.
> --
> when making 'apachectl configtest'. I tried to reinstall AuthenSmb with
> its default options (default Makefile.PL), - no success.
> Maybe I must install it with some different from default options? Who
> knows what are such options? What is configurable there? Or what may be
> done with my Smb.so in oder Authen:Smb to understand it?
>




RE: Multiple authentication methods

2002-02-13 Thread Stathy G. Touloumis

File::Spec is in included with the standard perl mods I believe
so dependencies shouldn't be a problem.

> I see. You're right, this is actually much nicer!
> 
> Sorry for the misinformation. On debian it return : also. I made a 
> mistake checking it.
> 
> But with the suggested code by Per it works just fine:
> 
> sub load {
>  my $module=@_[0];
>  $module = File::Spec->catfile(split /::/, $module);
>  $module .= '.pm';
> 
>  eval { require $module; };
> 
>  return $@ ? 1 : 0;
> }
> 
> Of course one has to put a use File::Spec at the beginning and a Per 
> Finar Ellefsen




RE: Multiple authentication methods

2002-02-13 Thread Stathy G. Touloumis

Cool . . .

Thanks for the tip : )

> > > The easiest thing would be to use Config, and do:
> > >
> > >   $module =~ s[::][$Config{'path_sep'}]g;
> > >
> > > Right?
> >
> >Maybe not : )  When checking on 2 linux systems I got a path seperator of
> >':'.  Can you let me know if you get similar results?
> >
>
> I'm getting the same problem here. It seems like
> $Config{path_sep} has been
> misunderstood: it gives ':' on Unix and ';' on Windows, so I believe it
> means the separator between different items in your PATH
> (/usr/bin:/usr/local/bin etc..).
>
> I think what you need is File::Spec.
>
> Use this instead:
> $module = File::Spec->catfile(split /::/, $module);
>
> That'll be portable.




RE: Multiple authentication methods

2002-02-13 Thread Stathy G. Touloumis

Interesting, one system is RedHat 7.2 and Suse 7.3 (custom built perl) that
returns
a  ':' for $Config{'path_sep'}

> It returns a arrayref, as far as I experienced. Well I'm really new to
> mod_perl
> and my eagle book waits still in  the library to be bought... But why is
> this
> version not nice?

It's fine but I have become much more impressed with the mod_perl
configuration features.  It provides a much cleaner interface for specifying
directives.

THIS :


AuthName Test
AuthType Basic
   # These are AuthenSmb specific
PerlSetVar myPDC SAMBA
PerlSetVar myDOMAIN ARBEITSGRUPPE
  # With PerlAddVar you pass an array
PerlAddVar AuthModules Apache::AuthSybase
PerlAddVar AuthModules Apache::AuthenSmb
PerlAuthenHandler Apache::AuthMulti
require valid-user


VS :


AuthName Test
AuthType Basic
# Now an actual apache conf
myPDC SAMBA
myDOMAIN ARBEITSGRUPPE
# No need to specify twice
AuthModules Apache::AuthSybase Apache::AuthenSmb

PerlAuthenHandler Apache::AuthMulti
require valid-user


Of course there will be some minor changes in the module
and in the Makefile.PL





RE: Multiple authentication methods

2002-02-13 Thread Stathy G. Touloumis

> The easiest thing would be to use Config, and do:
>
>   $module =~ s[::][$Config{'path_sep'}]g;
>
> Right?

Maybe not : )  When checking on 2 linux systems I got a path seperator of
':'.  Can you let me know if you get similar results?

Thanks,







RE: Multiple authentication methods

2002-02-13 Thread Stathy G. Touloumis



> > I would suggest changing the PerlSetVar variables
> > to actual apache configuration directives which would change this :
> >
> > my @auth_modules=$r->dir_config->get("AuthModules");
> >
> > I don't have an immediate patch for this but have done it before.
> > If you would like me to work on this code no prob, otherwise check
> > the eagle book for some samples if unfamiliar.
>
> *nod*  I'm not sure that the syntax would work; $r->dir_config()
> would probably return an arrayref, and such; this needs to be
> tested.

You can specify anything for a directive as you can for dir_config() yet
it is more extensible : Syntax checking, ability to set in '.htaccess' files
and of course everybodies favorite . . . it's faster ; )

Doesn't need to be implemented now but just a thought . . .

> I stole that almost whole hog from Template/Config.pm, lines
> 68-78.  Take it up with Andy. ;)
>
> The easiest thing would be to use Config, and do:
>
>   $module =~ s[::][$Config{'path_sep'}]g;
>
> Right?

Anything other than hardcoding and this is fine by me.
Although should probably compile once :
s[::][$Config{'path_sep'}]go;





RE: Multiple authentication methods

2002-02-13 Thread Stathy G. Touloumis

Some more fixes ; )

I would suggest changing the PerlSetVar variables
to actual apache configuration directives which would change this :

my @auth_modules=$r->dir_config->get("AuthModules");

I don't have an immediate patch for this but have done it before.
If you would like me to work on this code no prob, otherwise check
the eagle book for some samples if unfamiliar.

Also,

THIS :

my $handler = \&{"$am\::handler"};
if ($handler->($r) == OK) {
  $r->warn("$am return OK");
return OK;

TO :

## 'or next' can be changed
my $handler = $am->can('handler') or next;
if ($handler->($r) == OK) {
  $r->warn("$am return OK");
  return OK;
}

And I would consider changing this :

$module  =~ s[::][/]g;

to be more portable.  I am working on another class for runtime management
of classes that should address this but won't be on CPAN for a few days.

> -
>
> package Apache::AuthMulti;
>
> # Stathy G. Touloumis
> # Marcel M. Weber
> # Darren Chamberlain
> #
> # Version 0.1.0 / 2002.02.13 / Marcel M. Weber
>
> use strict;
> use Apache::Constants qw(:common);
>
> sub handler {
>  my $r = shift;
>  my($res, $sent_pw) = $r->get_basic_auth_pw;
>  return $res if $res != OK;
>
>  my @auth_modules=$r->dir_config->get("AuthModules");
>
>  for my $am (@auth_modules)
>  {
>  load($am);
>  if ($@){
>  $r->log_reason("Error loading module '$am':$@");
>  next;
>  }
>
>  my $handler = \&{"$am\::handler"};
>  if ($handler->($r) == OK) {
>  $r->warn("$am return OK");
>  return OK;
>  }
>
>  $r->log_reason("$am not OK");
>  }
>
>  $r->note_basic_auth_failure;
>  $r->log_reason("none of the handlers could authenticate this
> user");
>  return AUTH_REQUIRED;
> }
>
> sub load {
>  my $module=@_[0];
>  $module  =~ s[::][/]g;
>  $module .= '.pm';
>
>  eval { require $module; };
>
>  return $@ ? 1 : 0;
> }
>
> 1;
> __END__
>
>
> ---
>
> In the httpd.conf you have to put something like this:
>
> 
> AuthName Test
> AuthType Basic
># These are AuthenSmb specific
> PerlSetVar myPDC SAMBA
> PerlSetVar myDOMAIN ARBEITSGRUPPE
>   # With PerlAddVar you pass an array
> PerlAddVar AuthModules Apache::AuthSybase
> PerlAddVar AuthModules Apache::AuthenSmb
> PerlAuthenHandler Apache::AuthMulti
> require valid-user
> 
>
> ---
>
> Works perfect...
>
> Why not submitting this somewhere? I think this could be usefull for
> quite a lot of people. I think this is cool, as you do not have to worry
> wether the module returns DECLINED or AUTH_REQUIRED.
>
> Marcel
>
>
> Am Mittwoch den, 13. Februar 2002, um 15:02, schrieb darren chamberlain:
>
> > Quoting Marcel Weber <[EMAIL PROTECTED]> [12 Feb-02 16:15]:
> >> I don't get the point why it did not work the other way round,
> >> but now everything is just fine now :
> >
> > Make it a little more generic:
> >
> > package Apache::MultiAuthen;
> >
> > use strict;
> > use Apache::Constants qw(:common);
> >
> > sub handler {
> > my $r = shift;
> > my($res, $sent_pw) = $r->get_basic_auth_pw;
> > return $res if $res != OK;
> >
> > # Tweak this; unsure about dir_config returning an array
> > my @auth_modules = $r->dir_config("AuthModules");
> >
> > for my $am (@auth_modules) {
> > load($am);
> >
> > if ($@) {
> > $r->log("Error loading module '$am': $@");
> > next;
> > }
> >
> > my $handler = \&{"$am\::handler"};
> > if ($handler->($r) == OK) {
> > $r->log_reason("$am return OK");
> > return OK
> > }
> >
> > $r->log_reason("$am not OK");
> > }
> >
> > $r->note_basic_auth_failure;
> > return AUTH_REQUIRED;
> > }
> >
> > sub load {
> > my $module = @_;
> > $module  =~ s[::][/]g;
> > $module .= '.pm';
> >
> > eval { require $module; };
> >
> > return $@ ? 1 : 0;
> > }
> >
> > 1;
> >
> > __END__
> >
> > (darren)
> >
> > --
> > Never attribute to malice that which is adequately explained by
> > incompetence.
> > -- Napolean Bonaparte
> >
> >
> ---
>
> PGP / GPG Key:http://www.ncpro.com/GPG/mmweber-at-ncpro-com.asc
>




RE: Multiple authentication methods

2002-02-13 Thread Stathy G. Touloumis

He wants to check a 'handler' return value.

> shouldn't stacked handlers be the right solution here?  are stacked auth
> handlers not allowed or something?
> 
> aaron
> 
> On Wed, 2002-02-13 at 09:02, darren chamberlain wrote:
> > Quoting Marcel Weber <[EMAIL PROTECTED]> [12 Feb-02 16:15]:
> > > I don't get the point why it did not work the other way round,
> > > but now everything is just fine now :
> > 
> > Make it a little more generic:
> > 
> > package Apache::MultiAuthen;
> > 
> > use strict;
> > use Apache::Constants qw(:common);
> > 
> > sub handler {
> > my $r = shift;
> > my($res, $sent_pw) = $r->get_basic_auth_pw;
> > return $res if $res != OK;
> > 
> > # Tweak this; unsure about dir_config returning an array
> > my @auth_modules = $r->dir_config("AuthModules");
> > 
> > for my $am (@auth_modules) {
> > load($am);
> > 
> > if ($@) {
> > $r->log("Error loading module '$am': $@");
> > next;
> > }
> > 
> > my $handler = \&{"$am\::handler"};
> > if ($handler->($r) == OK) {
> > $r->log_reason("$am return OK");
> > return OK
> > }
> > 
> > $r->log_reason("$am not OK");
> > }
> > 
> > $r->note_basic_auth_failure;
> > return AUTH_REQUIRED;
> > }
> > 
> > sub load {
> > my $module = @_;
> > $module  =~ s[::][/]g;
> > $module .= '.pm';
> > 
> > eval { require $module; };
> > 
> > return $@ ? 1 : 0;
> > }
> > 
> > 1;
> > 
> > __END__
> > 
> > (darren)
> > 
> > -- 
> > Never attribute to malice that which is adequately explained by
> > incompetence.
> > -- Napolean Bonaparte
> -- 
> aaron ross . alias intelligence, inc
>  email . [EMAIL PROTECTED]
>  phone . 215 545 6428
> 



RE: mod_perl + UNIVERSAL

2002-02-12 Thread Stathy G. Touloumis

: ) As with any application that depends on the requirements.

> > There really is no reason to cleanup the globals since they are still
> > referenced and in memory.  Perhaps you can consider an 
> interface around your
> > code which can handle the cleanup and such of any variables.
> > 
> > You could also set a 'cleanup' handler to 'unload' the module from the
> > process when it is completed or even 'undef' specific 
> variables.  That way
> > you can clear out the namespace and then other scripts calling the same
> > named module but from a different path can actually load it.
> 
> Of course all of this tends to go in the opposite direction from that
> in which mod_perl tries to go: the idea is to do as little processing as
> possible (particularly things like compiling modules) for each request.




RE: mod_perl + UNIVERSAL

2002-02-12 Thread Stathy G. Touloumis


> > * Global variables should be reinitialized on each request. Or at least
> > if we want them to be persistent we do not want them to be shared with
> > different scripts on different virtual hosts!

Try looking into the way mod_perl hooks into the apache configuration. This
may work for setting site wide constants globals depending on how you use
them.  You can then set different values for virtual hosts or even allow
directives to be set in '.htaccess' files.

> > * Perl garbage collector should be smarter (okay, that may not be a
> > mod_perl issue). C geeks out there, ain't it possible to compile a
> > version of Perl with a better GC?

There really is no reason to cleanup the globals since they are still
referenced and in memory.  Perhaps you can consider an interface around your
code which can handle the cleanup and such of any variables.

You could also set a 'cleanup' handler to 'unload' the module from the
process when it is completed or even 'undef' specific variables.  That way
you can clear out the namespace and then other scripts calling the same
named module but from a different path can actually load it.






RE: Multiple authentication methods

2002-02-12 Thread Stathy G. Touloumis

That is odd, I would check the interface for the authentication modules and
be sure that they are being used properly.  It may help to also put in some
debug/trace statements to figure out where things are failing or not working
as expected : )

> This way, I do not get any failure messages, but the
> authenication does not
> work at all. Say, it does not matter wat password your typing in, you get
> always authenticated. Even when one auf the handlers logs a violation and
> return AUTH_REQUIRED / DECLINED.
>
> package Apache::AuthenIntra;
>
> use strict;
> use Apache::AuthenSmb;
> use Apache::AuthSybase;
> use Apache::Constants;
>
> sub handler {
> my $r = shift;
> my($res, $sent_pw) = $r->get_basic_auth_pw;
> return $res if $res != OK;
>
> if (  Apache::AuthenSmb::handler($r) == Apache::Constants::OK ) {
> return Apache::Constants::OK;
> } elsif ( Apache::AuthSybase::handler($r) ==
> Apache::Constants::OK )
> {
> return Apache::Constants::OK;
> }
> $r->note_basic_auth_failure;
> return Apache::Constant::AUTH_REQUIRED;
> }
>
> Marcel
>
>
> -Ursprüngliche Nachricht-
> Von: Stathy G. Touloumis [mailto:[EMAIL PROTECTED]]
> Gesendet: Dienstag, 12. Februar 2002 18:32
> An: Marcel Weber; [EMAIL PROTECTED]
> Betreff: RE: Multiple authentication methods
>
>
> > The get_handlers code is out of AuthenSmb as I do not have the slightest
> > idea of how to get the results of the called function.
> Hmmm, It would seem that it would be better to call the function directly
> from your handler.  I am not sure how the AuthenSmb handlers should be
> called but you should get the idea.
>
> sub handler {
>   my $r = shift;
>   my($res, $sent_pw) = $r->get_basic_auth_pw;
>   return $res if $res != OK;
>
>   if ( Apache::AuthSybase->handler($r) == Apache::Constants::OK ) {
> return Apache::Constants::OK;
>
>   } elsif ( Apache::AuthenSmb->handler($r) == Apache::Constants::OK ) {
> return Apache::Constants::OK;
>
>   } else {
> return Apache::Constant::DECLINED;
>
>   }
>
>
> }
>
> > I get just as far, as I can authenticate via AuthSybase, but the second
> > method is never executed. Well, probably some expirienced perl
> coder would
> > laugh at me...
>
> He he, we all had to start from the beginning ; )
>
>
> > Hmm, I fiddled a bit around whith this code but, it does not
> > really work the
> > way I want it to.
> >
> > This is what I coded:
> >
> > sub handler {
> > my $r = shift;
> > my($res, $sent_pw) = $r->get_basic_auth_pw;
> > return $res if $res != OK;
> >
> > $r->push_handlers( PerlAuthenHandler=> Apache::AuthSybase );
> > if (@{ $r->get_handlers("PerlAuthenHandler") || []}) {
> > return OK;
> > }
> > $r->push_handlers( PerlAuthenHandler=> Apache::AuthenSmb );
> > if (@{ $r->get_handlers("PerlAuthenHandler") || []}) {
> > return OK;
> > }
> > return DECLINED;
> > }
> >
> > The get_handlers code is out of AuthenSmb as I do not have the slightest
> > idea of how to get the results of the called function.
> >
> > What the code should do is: Call AuthSybase, check return value, if OK
> > return OK, else call AuthenSMB, return return value.
> >
>
>




RE: Multiple authentication methods

2002-02-12 Thread Stathy G. Touloumis

> I also tried something like this at first. But I get this error message in
> my apache/error.log
>
>
> [Tue Feb 12 20:20:59 2002] [error] Can't locate object method
> "handler" via
> package "Apache::AuthenS
> mb" (perhaps you forgot to load "Apache::AuthenSmb"?) at
> /usr/share/perl5/Apache/AuthenIntra.pm line
>  13.

Try calling it via Apache::AuthenSmb::handler($r) instead.  You will
probably want to do the same with Apache::AuthSybase::handler($r) as well.

> resp. vice versa, when the AuthSybase method is first. Perhaps it is my
> mod_perl installation. It is a stock Debian Woody installation.
>
> Marcel
>
>
> -Ursprüngliche Nachricht-
> Von: Stathy G. Touloumis [mailto:[EMAIL PROTECTED]]
> Gesendet: Dienstag, 12. Februar 2002 18:32
> An: Marcel Weber; [EMAIL PROTECTED]
> Betreff: RE: Multiple authentication methods
>
>
> > The get_handlers code is out of AuthenSmb as I do not have the slightest
> > idea of how to get the results of the called function.
> Hmmm, It would seem that it would be better to call the function directly
> from your handler.  I am not sure how the AuthenSmb handlers should be
> called but you should get the idea.
>
> sub handler {
>   my $r = shift;
>   my($res, $sent_pw) = $r->get_basic_auth_pw;
>   return $res if $res != OK;
>
>   if ( Apache::AuthSybase->handler($r) == Apache::Constants::OK ) {
> return Apache::Constants::OK;
>
>   } elsif ( Apache::AuthenSmb->handler($r) == Apache::Constants::OK ) {
> return Apache::Constants::OK;
>
>   } else {
> return Apache::Constant::DECLINED;
>
>   }
>
>
> }
>
> > I get just as far, as I can authenticate via AuthSybase, but the second
> > method is never executed. Well, probably some expirienced perl
> coder would
> > laugh at me...
>
> He he, we all had to start from the beginning ; )
>
>
> > Hmm, I fiddled a bit around whith this code but, it does not
> > really work the
> > way I want it to.
> >
> > This is what I coded:
> >
> > sub handler {
> > my $r = shift;
> > my($res, $sent_pw) = $r->get_basic_auth_pw;
> > return $res if $res != OK;
> >
> > $r->push_handlers( PerlAuthenHandler=> Apache::AuthSybase );
> > if (@{ $r->get_handlers("PerlAuthenHandler") || []}) {
> > return OK;
> > }
> > $r->push_handlers( PerlAuthenHandler=> Apache::AuthenSmb );
> > if (@{ $r->get_handlers("PerlAuthenHandler") || []}) {
> > return OK;
> > }
> > return DECLINED;
> > }
> >
> > The get_handlers code is out of AuthenSmb as I do not have the slightest
> > idea of how to get the results of the called function.
> >
> > What the code should do is: Call AuthSybase, check return value, if OK
> > return OK, else call AuthenSMB, return return value.
> >
>
>




RE: Multiple authentication methods

2002-02-12 Thread Stathy G. Touloumis

> The get_handlers code is out of AuthenSmb as I do not have the slightest
> idea of how to get the results of the called function.
Hmmm, It would seem that it would be better to call the function directly
from your handler.  I am not sure how the AuthenSmb handlers should be
called but you should get the idea.

sub handler {
  my $r = shift;
  my($res, $sent_pw) = $r->get_basic_auth_pw;
  return $res if $res != OK;

  if ( Apache::AuthSybase->handler($r) == Apache::Constants::OK ) {
return Apache::Constants::OK;

  } elsif ( Apache::AuthenSmb->handler($r) == Apache::Constants::OK ) {
return Apache::Constants::OK;

  } else {
return Apache::Constant::DECLINED;

  }


}

> I get just as far, as I can authenticate via AuthSybase, but the second
> method is never executed. Well, probably some expirienced perl coder would
> laugh at me...

He he, we all had to start from the beginning ; )


> Hmm, I fiddled a bit around whith this code but, it does not
> really work the
> way I want it to.
>
> This is what I coded:
>
> sub handler {
> my $r = shift;
> my($res, $sent_pw) = $r->get_basic_auth_pw;
> return $res if $res != OK;
>
> $r->push_handlers( PerlAuthenHandler=> Apache::AuthSybase );
> if (@{ $r->get_handlers("PerlAuthenHandler") || []}) {
> return OK;
> }
> $r->push_handlers( PerlAuthenHandler=> Apache::AuthenSmb );
> if (@{ $r->get_handlers("PerlAuthenHandler") || []}) {
> return OK;
> }
> return DECLINED;
> }
>
> The get_handlers code is out of AuthenSmb as I do not have the slightest
> idea of how to get the results of the called function.
>
> What the code should do is: Call AuthSybase, check return value, if OK
> return OK, else call AuthenSMB, return return value.
>




RE: [Fwd: Samba authorization]

2002-02-12 Thread Stathy G. Touloumis

It seems that the problem does not reside with Smb.pm but with the shared
object file Smb.so




RE: [?] Same Named Modules, Different Paths

2002-02-06 Thread Stathy G. Touloumis

Yeah, this is an ideal way to go.  Althought, depending to what degree you
can trust your developers (contractors, etc.) and how much your sys admins
want to admin it may or may not be a good fit.

> > We have a similar issue here but it is designed more for development of
> > modules/code by multiple developers.
>
> If each of your developers runs her own copy of Apache, each copy
> listening to a different port, you can make the namespace collision
> problems go away.  Use a common httpd.conf for all developers with a
> small section specifically for each one, and start Apache separately
> for each developer with '-Ddeveloperid'.  You can trade off between
> the isolation of multiple copies of the complete site(s) on the one
> machine, and the fun of sharing some of the code/data.  I'd keep it
> all separate, discs are cheap enough.
>
> 
>   User ged
>   Port 8011
>   ErrorLog /home/ged/apache/error_log
>   PidFile /tmp/ged.pid
>   LockFile /tmp/...
>   DocumentRoot ...
> 
>
> 
>   User stas
>   Port 8012
>   ErrorLog /home/stas/apache/error_log
>   PidFile /tmp/stas.pid
>   LockFile /tmp/...
>   DocumentRoot ...
> 





RE: Apache::DBI

2002-02-06 Thread Stathy G. Touloumis

> I'm not sure what you mean, really, but perhaps you mean
> dbi_connect_method?

Did you mean specifying this argument like so ?

DBI->connect( $driver, $u, $p, { dbi_connect_method=> 'connect' } );

I will see if this is what I am looking for.  Thanks for the reference : )



RE: Apache::DBI

2002-02-06 Thread Stathy G. Touloumis

> dbi_connect_method?
>
> from man DBI:
>
> The "dbi_connect_method" attribute can be used to specify which driver
> method should be called to establish
> the connection. The only useful values are 'connect',
> 'connect_cached', or some specialized case like
> 'Apache::DBI::connect' (which is automatically the default when
> running within Apache).
>
> so, basically you can create a connection under Apache::DBI that is
> _not_ cached using 'connect'.

Is that using DBI->connect or Apache::DBI->connect . . .

My understanding is that using Apache::DBI pretty much overrides the
functionality of DBI->connect and returns an existing database handle if it
exists (based on parameters passed to method).

I want to be able to return a cached database handle from a method unless a
certain argument is passed.  If this argument is present I would like to
return an independent database handle for perhaps performing transactions.





Apache::DBI

2002-02-06 Thread Stathy G. Touloumis

I thought I saw a posting on how to retrieve an independent database handle
from Apache::DBI  using a certain method call (instead of from the shared
$dbh for the child).  Does anyone know where this documentation may reside
(If it is possible).


Thanks,




RE: mod_perl "version" for Tomcat

2002-02-06 Thread Stathy G. Touloumis

Hmmm, from what I've read of Tomcat it is recommended to use it in
conjuction with apache and just proxy specific requests to Tomcat.

> > Why would you need mod_perl with Tomcat?  You can use
> > Tomcat with Apache using mod_jk, and get the best of
> > both worlds.
>
> presumably so that he doesn't have to port his cgi programs
> to servlets.
>
> i'm pretty sure tomcat has the capability to execute cgi
> programs, but that doesn't buy you the acceleration you get
> with mod_perl.
>
> it's probably worth the original poster's time to figure out
> how to get apache working with ssl so he can continue to use
> mod_perl. his only other realistic choice is using something
> like xml-rpc (or maybe even http) from tomcat to a (non-ssl)
> backend apache/mod_perl.
>




RE: [?] Same Named Modules, Different Paths

2002-02-06 Thread Stathy G. Touloumis

We have a similar issue here but it is designed more for development of
modules/code by multiple developers.  This is managed through virtual hosts
and although we do not have our production server the same as development we
are able to view the production code through the development box.  The
development server is significantly slower due to the need to load/unload
modules dynamically as well as perform cleanup but it is not really
noticeable.  Typically there is not a need to work on many modules per
developer change so dynamic loading does not occur often.  We have also
incorporated Mason and template-toolkit into the same architecture
(development/production paths).  Our team is not large nor do we expect it
to grow much (<10) so this may not be applicable for some environments.

I am not sure how your handlers are setup to be executed but for us we have
handlers which can be dynamically called depending on the environment that
you are in (dev,stage,prod).  For development this specific handler can
check if there is a module being developed for that virtual host (developer
change) and take appropriate action (prepend specific path to @INC, cleanup
symbol table/ %INC, load new module) and a cleanup handler which checks to
see if a module was loaded and if so perform cleanup (unload, @INC back,
clean symbol table/%INC and reload non-developer module version).

If you are mostly interested in loading modules specific to the environment
it may be easier to have them on seperate boxes but I think it would be wise
to be sure and manage the code through CVS or some other change management
system as well.

Things are working out well so far : )

> I have a problem, and I have a poor solution; I would like to see if I
> can do even better. My problem is that I have a set of scripts and
> modules that are duplicated on the same Apache server setup. One tree is
> for debugging and developing, the other is the main release site. These
> are managed through cvs. The issue I ran into was that the debug scripts
> would request debug modules, but get the same-named release module if it
> was already loaded in the same Apache process (and vice versa).
>
> Here what my old (buggy under mod_perl) include stuff was like:
>
> use lib "../lib";
> use MyModule;
>
> Here is what I had to do to force correct module loading (mostly stolen
> from the great mod_perl guide):
>
> %INC = (); # Possibly unnecessary
> do 'FindBin.pm';
> unshift @INC, "$FindBin::Bin"; # There are also modules in the same dir
> as the script
> unshift @INC, "$FindBin::Bin/../lib/";
>
> require MyModule;
> import MyModule;
>
>
> So I'm loosing all of that slick compile-time speed savings and clean
> code just so I can have two source trees on the same server. One obvious
> answer is to move the devel tree off of the same server as the release
> tree. I will eventually do that, but it would be cool to see a solution
> that works with my current setup. Is there maybe a way to do tricks to
> modules like Apache::Registry does to scripts by automagically
> prepending the directory name behind the scenes? Any other ideas or
> places to RTFM?
>
> Thanks,
>
> John Heitmann
>
>




Re: Beginner's FixupHandler question

2002-01-08 Thread Stathy G. Touloumis


>I've just started learning modperl and I started with a simple module
>for apache httpd 1.3.22.
>This simple module (see below) sets & gets a cookie at every request.
>I thought it wasn't too difficult. I put it into the fixup phase (any
>problem with it?).
>First it seemed to work, but when I put a 'print STDERR' line in it, I
>saw that my script ran many times on one request.

What is your interpretation of 'one' request?  Remember, when requesting a 
url there may be 'many' requests that go along with it for loading images 
and other media.

If you don't want to set/get cookie for every request try filtering based 
on $r->content_type.  But, your handler will still be called for every 
request : )


-- There is always somebody better than you . . .
-- Until you realize this you can never be the best.

Stathy G. Touloumis
Coder




make failure for Apache::Request

2002-01-06 Thread Stathy G. Touloumis

Hi,

Here is my perl version info :
stathy@server:~/.cpan/build/libapreq-0.33> perl -V
Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration:
Platform:
osname=linux, osvers=2.4.10-smp, archname=i686-linux-thread
uname='linux app-server 2.4.10-smp #1 smp tue dec 11 09:35:51 cst 2001
i686 unknown '
config_args=''
hint=recommended, useposix=true, d_sigaction=define
usethreads=define use5005threads=define useithreads=undef
usemultiplicity=undef
useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
Compiler:
cc='cc', ccflags
='-D_REENTRANT -fno-strict-aliasing -I/usr/local/include -I/home/stathy/loca
l/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-O2 -march=i686',
cppflags='-D_REENTRANT -fno-strict-aliasing -I/usr/local/include -I/home/sta
thy/local/include'
ccversion='', gccversion='2.95.3 20010315 (SuSE)', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
alignbytes=4, usemymalloc=n, prototype=define
Linker and Libraries:
ld='cc', ldflags ='-L/usr/local/lib -L/home/stathy/local/lib'
libpth=/usr/local/lib /lib /usr/lib /home/stathy/local/lib
libs=-lbind -lnsl -lndbm -lgdbm -ldb -ldl -lm -lpthread -lc -lcrypt -lutil
perllibs=-lbind -lnsl -ldl -lm -lpthread -lc -lcrypt -lutil
libc=, so=so, useshrplib=false, libperl=libperl.a
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
cccdlflags='-fpic',
lddlflags='-shared -L/usr/local/lib -L/home/stathy/local/lib'

Characteristics of this binary (from libperl):
Compile-time options: USE_THREADS USE_LARGE_FILES PERL_IMPLICIT_CONTEXT
Built under linux
Compiled at Dec 15 2001 11:06:44
@INC:
/home/stathy/local/lib/perl5/5.6.1/i686-linux-thread
/home/stathy/local/lib/perl5/5.6.1
/home/stathy/local/lib/site_perl/i686-linux-thread
/home/stathy/local/lib/site_perl
/home/stathy/local/lib/site_perl

Here is the compiler command and error for 'request.c' :
make[1]: Entering directory `/home/stathy/.cpan/build/libapreq-0.33/Request'
cc -c -I../c -I/home/stathy/local/lib/site_perl/i686-linux-thread/auto/Apach
e/include -I/home/stathy/local/lib/site_perl/i686-linux-thread/auto/Apache/i
nclude/modules/perl -I/home/stathy/local/lib/site_perl/i686-linux-thread/aut
o/Apache/include/include -I/home/stathy/local/lib/site_perl/i686-linux-threa
d/auto/Apache/include/regex -I/home/stathy/local/lib/site_perl/i686-linux-th
read/auto/Apache/include/os/unix -D_REENTRANT -fno-strict-aliasing -I/usr/lo
cal/include -I/home/stathy/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_
BITS=64 -O2 -march=i686 -DVERSION=\"0.33\" -DXS_VERSION=\"0.33\" -fpic -I/
home/stathy/local/lib/perl5/5.6.1/i686-linux-thread/CORE Request.c
Request.xs: In function `upload_hook':
Request.xs:230: `thr' undeclared (first use in this function)
Request.xs:230: (Each undeclared identifier is reported only once
Request.xs:230: for each function it appears in.)
make[1]: *** [Request.o] Error 1
make[1]: Leaving directory `/home/stathy/.cpan/build/libapreq-0.33/Request'
make: *** [subdirs] Error 2

Any ideas would be appreciated : )





Re: Invalid command 'PerlHandler' is caused by Y2k?

2000-01-03 Thread Stathy G. Touloumis


>If I comment these lines out,  I got some errors with  PerlModules such as 
>PerlModule Apache::DBI,
>PerlModule Apache::SSI etc when I started the web server. I cannot 
>run  "PerlHandler Apache::Registry" any more.
>
>I tried all possible ways I could. Is it any easy fix for the "Y2K 
>problem"? or I have to do from scratch??
>Thanks a lot for the help!

Did this run smooth before Y2K?  Is mod_perl being loaded dynamically?


--
   Stathy Touloumis, CTO - JASKE.COM 'innovative I/net'
 JASKE.COM, Inc.
3555 W. Peterson Ave. Chicago  IL  60659
  Office - 773.478.9877 Fax - 773.588.5015
__
[EMAIL PROTECTED] - [EMAIL PROTECTED]



Re: RegistryLoader and multiple virtualhosts

1999-12-30 Thread Stathy G. Touloumis


>Is there a way to RegistryLoader a single instance of a script
>/cgi-bin/admin.cgi
>and have this instance work across ALL virtual hosts.
>
>simply loading
>$r->handler("/cgi-bin/admin.cgi",
>"/home/jter/public_html/cgi-bin/admin.cgi");

Where are you calling the above?  If they are the same script try using:


$PerlRequire= '/cgi-bin/admin.cgi';


in your main servers config.



Re: Fwd:

1999-12-30 Thread Stathy G. Touloumis

You should check out HTML::Mason if you are trying to embed and create 
components in html pages.

> > 
> > 
> > Bidder Registration
> > 
> >
> > 
> >
> > [+
> >   use TEST1;
> >   &TEST;
> > +]
> >
> > 
> > 
> > 
> >
> > where
> >
> > TEST1.pm contains the following:
> > ###
> > ### Date: 12/29/99 Ver: 0.1 ###
> > ###
> > sub TEST {
> > print "Hi There \n";
> > } # sub TEST
> > 1;



--
   Stathy Touloumis, CTO - JASKE.COM 'innovative I/net'
 JASKE.COM, Inc.
3555 W. Peterson Ave. Chicago  IL  60659
  Office - 773.478.9877 Fax - 773.588.5015
__
[EMAIL PROTECTED] - [EMAIL PROTECTED]



Re: Not able to read directives/Static vs. Dynamic ?!?!?

1999-12-28 Thread Stathy G. Touloumis


>Monika might have forgotten to mention that you need to add an
>AddModule mod_perl.c directive in your httpd.conf for perl directives to
>work. She figured that out when we ran into this before.

Funny : )  30 minutes after posting I figured that out.  I realized that 
there was a clearmodule directive which slipped me. After adding the 
addmodule directive everything worked like a charm.

Thanks,


--
   Stathy Touloumis, CTO - JASKE.COM 'innovative I/net'
 JASKE.COM, Inc.
3555 W. Peterson Ave. Chicago  IL  60659
  Office - 773.478.9877 Fax - 773.588.5015
__
[EMAIL PROTECTED] - [EMAIL PROTECTED]



Not able to read directives/Static vs. Dynamic ?!?!?

1999-12-28 Thread Stathy G. Touloumis

Hi,

Tried to get HTML::Mason working with mod_perl and had some trouble.  Went 
to the mason-list archives and found a solution: build apache with mod_perl 
static and not as a shared library.

I did that and all seemed well except when trying to start apache with 
mod_perl directives in the configuration apache does not recognize them and 
returns an error that the directives are not defined.

Went to the archives and found another person with the same problem but no 
reply.  Seems that if all the modules are statically built everything works 
fine.  I guess I will try this but am hoping there is another solution.

When running 'httpd -l' it does indeed show mod_perl built in.  Here are 
the commands used when building mod_perl and apache (did not have run the 
command as shown.  Listed like this for ease of reading).


__mop_perl-conf__
perl Makefile.PL
APACHE_SRC=../apache_1.3.9/src
DO_HTTPD=1
USE_APACI=1
PREP_HTTPD=1
EVERYTHING=1
cd ../apache_1.3.9/src
make

Not sure if the make is necessary here but that's what it said in the 
docs.  Also tried it without the make here and still did not work.

__apache-conf__
./configure
--prefix=/usr/local/httpd
--bindir=/usr/bin
--sbindir=/usr/sbin
--datadir=/usr/local/httpd
--sysconfdir=/etc/httpd
--mandir=/usr/man
--logfiledir=/var/log
--localstatedir=/var
--libexecdir=/usr/lib/apache
--proxycachedir=/var/cache/httpd
--enable-module=all
--enable-shared=max
--activate-module=src/modules/perl/libperl.a
--enable-suexec
--suexec-caller=wwwrun
--suexec-userdir=public_html
--suexec-uidmin=100
--suexec-gidmin=100
--suexec-safepath="/bin:/usr/bin"


Any help or direction is greatly appreciated.

Thanks,

--
   Stathy Touloumis, CTO - JASKE.COM 'innovative I/net'
 JASKE.COM, Inc.
3555 W. Peterson Ave. Chicago  IL  60659
  Office - 773.478.9877 Fax - 773.588.5015
__
[EMAIL PROTECTED] - [EMAIL PROTECTED]