cvs commit: modperl-2.0/lib/ModPerl BuildOptions.pm

2002-05-21 Thread dougm

dougm   02/05/21 09:48:29

  Modified:lib/Apache Build.pm
   lib/ModPerl BuildOptions.pm
  Log:
  allow MP_AP_PREFIX to be a source tree directory
  
  Revision  ChangesPath
  1.87  +10 -9 modperl-2.0/lib/Apache/Build.pm
  
  Index: Build.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/Apache/Build.pm,v
  retrieving revision 1.86
  retrieving revision 1.87
  diff -u -r1.86 -r1.87
  --- Build.pm  21 May 2002 16:19:51 -  1.86
  +++ Build.pm  21 May 2002 16:48:29 -  1.87
   -65,10 +65,6 
   return include/ directory not found in $prefix;
   }
   
  -if (-e $prefix/CHANGES) {
  -return $prefix is a build directory (need an install directory);
  -}
  -
   return '';
   }
   
   -556,7 +552,7 
   
   return $self-{dir} if $self-{dir};
   
  -if(IS_MOD_PERL_BUILD) {
  +if (IS_MOD_PERL_BUILD) {
   my $build = $self-build_config;
   
   if ($dir = $build-{'dir'}) {
   -566,6 +562,8 
   }
   }
   
  +$dir ||= $self-{MP_AP_PREFIX};
  +
   # we not longer install Apache headers, so dont bother looking in INC
   # might end up finding 1.x headers anyhow
   #unless ($dir and -d $dir) {
   -1051,10 +1049,13 
   
   push inc, $self-mp_include_dir;
   
  -my $ainc = $self-apxs('-q' = 'INCLUDEDIR');
  -if (-d $ainc) {
  -push inc, $ainc;
  -return \@inc;
  +my $prefix = $self-{MP_AP_PREFIX};
  +if (-d $prefix and not -e $prefix/CHANGES) {
  +my $ainc = $self-apxs('-q' = 'INCLUDEDIR');
  +if (-d $ainc) {
  +push inc, $ainc;
  +return \@inc;
  +}
   }
   
   for ($src/modules/perl, $src/include,
  
  
  
  1.16  +1 -1  modperl-2.0/lib/ModPerl/BuildOptions.pm
  
  Index: BuildOptions.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/ModPerl/BuildOptions.pm,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- BuildOptions.pm   21 May 2002 16:19:51 -  1.15
  +++ BuildOptions.pm   21 May 2002 16:48:29 -  1.16
   -164,7 +164,7 
   OPTIONS_FILE Read options from given file
   STATIC_EXTS  Build Apache::*.xs as static extensions
   APXSPath to apxs
  -AP_PREFIXApache installation prefix
  +AP_PREFIXApache installation or source tree prefix
   XS_GLUE_DIR Directories containing extension glue
   INCLUDE_DIR Add directories to search for header files
   GENERATE_XS Generate XS code based on httpd version
  
  
  



cvs commit: modperl-2.0/lib/Apache Build.pm

2002-05-21 Thread dougm

dougm   02/05/21 09:49:53

  Modified:lib/Apache Build.pm
  Log:
  dont bother looking for the ssl includes, we dont use them
  
  Revision  ChangesPath
  1.88  +0 -7  modperl-2.0/lib/Apache/Build.pm
  
  Index: Build.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/Apache/Build.pm,v
  retrieving revision 1.87
  retrieving revision 1.88
  diff -u -r1.87 -r1.88
  --- Build.pm  21 May 2002 16:48:29 -  1.87
  +++ Build.pm  21 May 2002 16:49:53 -  1.88
   -1066,13 +1066,6 
 push inc, $_ if -d $_;
 }
   
  -my $ssl_dir = $src/../ssl/include;
  -unless (-d $ssl_dir) {
  -my $build = $self-build_config;
  -$ssl_dir = join '/', $self-{MP_SSL_BASE} || '', 'include';
  -}
  -push inc, $ssl_dir if -d $ssl_dir;
  -
   return \@inc;
   }
   
  
  
  



cvs commit: modperl-2.0/lib/Apache Build.pm

2002-05-21 Thread dougm

dougm   02/05/21 18:59:00

  Modified:.Makefile.PL
   lib/Apache Build.pm
  Log:
  make it possible to change the name of src/modules/perl/Makefile
  in case static build requires a src/modules/perl/Makefile.in
  
  Revision  ChangesPath
  1.82  +12 -8 modperl-2.0/Makefile.PL
  
  Index: Makefile.PL
  ===
  RCS file: /home/cvs/modperl-2.0/Makefile.PL,v
  retrieving revision 1.81
  retrieving revision 1.82
  diff -u -r1.81 -r1.82
  --- Makefile.PL   21 May 2002 16:19:51 -  1.81
  +++ Makefile.PL   22 May 2002 01:58:59 -  1.82
   -23,6 +23,7 
   use File::Spec::Functions;
   use DirHandle ();
   use File::Copy 'cp';
  +use File::Basename 'basename';
   
   use Apache::Build ();
   use Apache::TestReportPerl ();
   -70,11 +71,14 
   VERSION = $VERSION,
   DIR = get_dirs_with_makefile(remote_makefile_dirs),
   macro = {
  -MODPERL_SRC   = $code-path,
  -PERL  = $build-perl_config('perlpath'),
  -MOD_INSTALL   = ModPerl::MM::mod_install(),
  -APACHE_PREFIX = $build-apxs('-q' = 'prefix'),
  -APACHE_LIBDIR = $build-apxs('-q' = 'libexecdir'),
  +MODPERL_SRC  = $code-path,
  +MODPERL_MAKEFILE = basename($build-default_file('makefile')),
  +MAKE_F   = '$(MAKE) ' . (WIN32 ? '/f' : '-f'),
  +MODPERL_LIBMAKE  = '$(MAKE) -f $(MODPERL_MAKEFILE)',
  +PERL = $build-perl_config('perlpath'),
  +MOD_INSTALL  = ModPerl::MM::mod_install(),
  +APACHE_PREFIX= $build-apxs('-q' = 'prefix'),
  +APACHE_LIBDIR= $build-apxs('-q' = 'libexecdir'),
   },
   clean = {
   FILES = { clean_files() },
   -390,13 +394,13 
$(SHELL) build/make_etags
   
   modperl_lib:
  - cd $(MODPERL_SRC)  $(MAKE)
  + cd $(MODPERL_SRC)  $(MODPERL_LIBMAKE)
   
   modperl_lib_install:
  - cd $(MODPERL_SRC)  $(MAKE) install
  + cd $(MODPERL_SRC)  $(MODPERL_LIBMAKE) install
   
   modperl_src_clean:
  - cd $(MODPERL_SRC)  $(MAKE) clean
  + cd $(MODPERL_SRC)  $(MODPERL_LIBMAKE) clean
   
   EOF
   
  
  
  
  1.91  +6 -3  modperl-2.0/lib/Apache/Build.pm
  
  Index: Build.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/Apache/Build.pm,v
  retrieving revision 1.90
  retrieving revision 1.91
  diff -u -r1.90 -r1.91
  --- Build.pm  21 May 2002 17:42:39 -  1.90
  +++ Build.pm  22 May 2002 01:58:59 -  1.91
   -9,6 +9,7 
   use Config;
   use Cwd ();
   use File::Spec ();
  +use File::Basename;
   use ExtUtils::Embed ();
   use ModPerl::Code ();
   use ModPerl::BuildOptions ();
   -450,7 +451,7 
   my %default_files = (
   'build_config' = 'lib/Apache/BuildConfig.pm',
   'ldopts' = 'src/modules/perl/ldopts',
  -'makefile' = 'src/modules/perl/Makefile',
  +'makefile' = 'src/modules/perl/Makefile.modperl',
   );
   
   sub clean_files {
   -908,6 +909,8 
   
   print $fh noedit_warning_hash();
   
  +print $fh $self-canon_make_attr('makefile', basename $mf);
  +
   $self-make_tools($fh);
   
   print $fh $self-canon_make_attr('ap_libs', $self-apache_libs);
   -1006,8 +1009,8 
$(MODPERL_CLEAN_FILES) \
$(MODPERL_XS_CLEAN_FILES)
   
  -$(MODPERL_OBJS): $(MODPERL_H_FILES) Makefile
  -$(MODPERL_PIC_OBJS): $(MODPERL_H_FILES) Makefile
  +$(MODPERL_OBJS): $(MODPERL_H_FILES) $(MODPERL_MAKEFILE)
  +$(MODPERL_PIC_OBJS): $(MODPERL_H_FILES) $(MODPERL_MAKEFILE)
   $(MODPERL_LIB): $(MODPERL_LIBPERL)
   
   $(MODPERL_LIBNAME)$(MODPERL_LIB_EXT): $(MODPERL_OBJS)
  
  
  



cvs commit: modperl-2.0/ModPerl-Registry/lib/ModPerl RegistryBB.pm Registry.pm

2002-05-21 Thread stas

stas02/05/21 22:41:48

  Modified:ModPerl-Registry/lib/ModPerl RegistryBB.pm Registry.pm
  Log:
  the pod part moves into its own file
  
  Revision  ChangesPath
  1.2   +0 -14 modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryBB.pm
  
  Index: RegistryBB.pm
  ===
  RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryBB.pm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RegistryBB.pm 9 Oct 2001 12:47:38 -   1.1
  +++ RegistryBB.pm 22 May 2002 05:41:48 -  1.2
   -24,17 +24,3 
   1;
   __END__
   
  -
  -=head1 NAME
  -
  -ModPerl::RegistryBB - 
  -
  -=head1 SYNOPSIS
  -
  -=head1 DESCRIPTION
  -
  -CModPerl::RegistryBB uses all the defaults, which do the very minimum
  -to compile the file once and run it many times.
  -
  -=cut
  -
  
  
  
  1.2   +1 -1  modperl-2.0/ModPerl-Registry/lib/ModPerl/Registry.pm
  
  Index: Registry.pm
  ===
  RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/Registry.pm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Registry.pm   9 Oct 2001 12:47:38 -   1.1
  +++ Registry.pm   22 May 2002 05:41:48 -  1.2
   -61,7 +61,7 
   #
   
   # META: if the ISA search results are cached on the first lookup, may
  -# be need to alias only the those that aren't the defaults?
  +# be we need to alias only those methods that override the defaults?
   
   
   1;
  
  
  



RE: mod_perl2: nmake test crashes apache

2002-05-21 Thread Alessandro Forghieri

Greetings.
[...]
 
 do you have a simple test case to reproduce the problem?
  

No, I do not. I hope I will be able get/build/test the latest CVS this week,
and perhaps I'll be able to work on making the problem
reproducible/debuggable which may well mean
I'll have to build a debugperl.

Some facts of the threads allocation are making me curious though
(euphemistic to say I don't really understand them). I am running a test
with a counter:

[...]
  foreach my $count (0..20) {
  $r-puts(lib$count/b/li\n);
  sleep(1);
  }
[...]

which I alias to two handlers (say /count1/ and /count2/).

If I then call it from the same browser in three separate frames like this:

| Frame 1  | Frame 2  | Frame 3
| htpp://localhost/count1/ | htpp://localhost/count2/ |
htpp://localhost/count1/ 

The execution order turns out to be: 1+2 and *then* 3. It looks like a
thread is allocated to this (client,handler) pair, so Frame 1 and 3 are
running in the same thread, separate from the thread that's running 2.

Is this reading correct, and is this behavior amenable to configuration?
(And is this a modperl question or an Apache question?)

  iib) I then set out to build a debug version. That ain't 
 easy I finally
 
 this has been fixed in cvs, MP_DEBUG=1 should do the right things now.
 

Great - I'll try it soon.

Cheers,
alf



Re: Memory Leaks

2002-05-21 Thread F . Xavier Noria

On Mon, 20 May 2002 16:23:40 -0500
Gregory Matthews [EMAIL PROTECTED] wrote:

: Unfortunately, we only have one machine.  If we did employ the cron job as 
: a clean-up utility once per day, wouldn't the potential impact of a site 
: being unavailable only be for a few seconds (until Apache restarted)?

... provided one is not using memory as unique storage for sessions or
some other data maybe?

-- fxn




What causes memory leaks during graceful restarts?

2002-05-21 Thread Dan Wilga

All this talk about memory leakage has got me to wondering more about 
a problem I've noticed with mod_perl ever since I started using it: 
the more times you gracefully restart, the more memory you lose.

This doesn't seem to be a result of the type of leakage that's being 
discussed in the other thread (which refers more to leakage and 
growth as the child runs normally) but is on such a large scale that 
I can only conclude that it's much more fundamental.

For example, here's what an httpd process looks like having just 
restarted it from scratch:

httpd 9063  0.0  6.6 19212 17020 ?   S11:26   0:00 
/usr/sbin/httpd -DSSL

and here's what happens after one graceful restart:

httpd 9092  0.0  9.2 25836 23644 ?   S11:27   0:00 
/usr/sbin/httpd -DSSL

Where did those 6.5 Mb go? This is without making any requests from 
the server, so my mod_perl code isn't even being run, beyond 
initialization. (I use a PerlRequire to load a bunch of libraries at 
startup.)

Are there any FAQs that address the reason for such large leakage? Or 
is this just an unavoidable problem with graceful restarts?


Dan Wilga [EMAIL PROTECTED]
Web Technology Specialist http://www.mtholyoke.edu
Mount Holyoke CollegeTel: 413-538-3027
South Hadley, MA  01075   Who left the cake out in the rain?




Re: Apache::GTopLimit

2002-05-21 Thread Perrin Harkins

Stas Bekman wrote:
 Hmm, when a new process starts it shares *everything* with the parent. 
 Why do you say that it's not?

It doesn't share everything with the parent.  As soon as it forks there 
is unshared memory, and after the first request it handles there is 
usually more.

Over time, the average amount of shared memory among child processes 
seems to gradually decrease.  Restarting fixes this.

- Perrin




Re: Apache::GTopLimit

2002-05-21 Thread Stas Bekman

Perrin Harkins wrote:
 Stas Bekman wrote:
 
 Hmm, when a new process starts it shares *everything* with the parent. 
 Why do you say that it's not?
 
 
 It doesn't share everything with the parent.  As soon as it forks there 
 is unshared memory, and after the first request it handles there is 
 usually more.
 
 Over time, the average amount of shared memory among child processes 
 seems to gradually decrease.  Restarting fixes this.

What you are saying is that when the server is started afresh, the newly 
started child processes share more memory with the parent, than newly 
started child processes some time later. Am I correct?

__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com




Re: What causes memory leaks during graceful restarts?

2002-05-21 Thread Doug MacEachern

what version of perl?  what modperl Makefile.PL options?

if you're using modperl as a dso, you'll need at least perl 5.6.1 and 
modperl-1.26 to prevent this leakage on restarts.






Getting mod_perl to work under Win2k

2002-05-21 Thread Michael Lawrie

Hello,
I've spent several days working on this problem, reading various FAQ and
whatnot and finally decided to try this email list, hoping that I might find
an answer here.

I'm running Win2KPro and Apache 1.3.23
I downloaded mod_perl2.ppd, and installed the *.so file in the default modules
directory for my web server.

I edited the httpd.conf file to include the following line:
LoadModule perl_module modules/mod_perl.so

When I attempt to start httpd I get this message:
Syntax Error on line 193 of c:/apache/apache/conf/httpd.conf
Can not load c:/apache/apache/modules/mod_perl.so into server: (126) The
specified module could not be found.

Is there something I've missed?

Thanks!
Michael




Re: Apache::GTopLimit

2002-05-21 Thread Perrin Harkins

Stas Bekman wrote:
 What you are saying is that when the server is started afresh, the newly 
 started child processes share more memory with the parent, than newly 
 started child processes some time later. Am I correct?

Yes, exactly.




Re: Getting mod_perl to work under Win2k

2002-05-21 Thread Peter Rothermel

Michael Lawrie wrote:

 Hello,
 I've spent several days working on this problem, reading various FAQ and
 whatnot and finally decided to try this email list, hoping that I might find
 an answer here.

 I'm running Win2KPro and Apache 1.3.23
 I downloaded mod_perl2.ppd, and installed the *.so file in the default modules
 directory for my web server.

 I edited the httpd.conf file to include the following line:
 LoadModule perl_module modules/mod_perl.so

 When I attempt to start httpd I get this message:
 Syntax Error on line 193 of c:/apache/apache/conf/httpd.conf
 Can not load c:/apache/apache/modules/mod_perl.so into server: (126) The
 specified module could not be found.

 Is there something I've missed?

Looks like your PATH env variable needs to be modified to include
your Perl executable.  Make sure you are getting the correct the
with a perl -V from the command prompt.

-pete



 Thanks!
 Michael



Re: Getting mod_perl to work under Win2k

2002-05-21 Thread Per Einar Ellefsen

At 19:51 21.05.2002, Michael Lawrie wrote:
Hello,
I've spent several days working on this problem, reading various FAQ and
whatnot and finally decided to try this email list, hoping that I might find
an answer here.

I'm running Win2KPro and Apache 1.3.23
I downloaded mod_perl2.ppd, and installed the *.so file in the default modules
directory for my web server.

mod_perl 2 doesn't work with Apache 1.x.x
Apache 2.x doesn't work with mod_perl 1.xx

You'll need to get the mod_perl.ppd, like:
  ppm install http://theoryx5.uwinnipeg.ca/ppmpackages/mod_perl.ppd

It should run an auto-install script at the end which puts mod_perl.so in 
the right location.


-- 
Per Einar Ellefsen
[EMAIL PROTECTED]





Re: Getting mod_perl to work under Win2k

2002-05-21 Thread Randy Kobes

On Tue, 21 May 2002, Michael Lawrie wrote:

 Hello,
 I've spent several days working on this problem, reading various FAQ and
 whatnot and finally decided to try this email list, hoping that I might find
 an answer here.

 I'm running Win2KPro and Apache 1.3.23
 I downloaded mod_perl2.ppd, and installed the *.so file in the default modules
 directory for my web server.

 I edited the httpd.conf file to include the following line:
 LoadModule perl_module modules/mod_perl.so

 When I attempt to start httpd I get this message:
 Syntax Error on line 193 of c:/apache/apache/conf/httpd.conf
 Can not load c:/apache/apache/modules/mod_perl.so into server: (126) The
 specified module could not be found.

 Is there something I've missed?

To use mod_perl-2, you'll need to get Apache2 (which is now
at 2.0.36) - in general you can't mix Apache-1 and Apache-2
modules. See http://theoryx5.uwinnipeg.ca/win32_apache2.html
for a discussion on how to get mod_perl-2 set up and initially
configured on Win32.

best regards,
randy kobes




Re: What causes memory leaks during graceful restarts?

2002-05-21 Thread Dan Wilga

At 10:34 AM -0700 5/21/02, Doug MacEachern wrote:
what version of perl?  what modperl Makefile.PL options?

if you're using modperl as a dso, you'll need at least perl 5.6.1 and
modperl-1.26 to prevent this leakage on restarts.

I am using Perl 5.6.1, modperl 1.25, and yes it's a DSO. It's compiled with:

   USE_APACI=1 SSL_BASE=/usr/local/ssl DO_HTTPD=1

So I guess the solution is to go to 1.26 or newer; I'll try that 
later in the week.


Dan Wilga [EMAIL PROTECTED]
Web Technology Specialist http://www.mtholyoke.edu
Mount Holyoke CollegeTel: 413-538-3027
South Hadley, MA  01075Got Perl?




Re: What causes memory leaks during graceful restarts?

2002-05-21 Thread Drew Taylor

At 02:15 PM 5/21/02 -0400, Dan Wilga wrote:

I am using Perl 5.6.1, modperl 1.25, and yes it's a DSO. It's compiled with:

   USE_APACI=1 SSL_BASE=/usr/local/ssl DO_HTTPD=1

So I guess the solution is to go to 1.26 or newer; I'll try that later in 
the week.

Or to just compile mod_perl statically. Unless you need the ability to 
dynamically add in mod_perl, static is better. I'm sure the guide has all 
kinds of info about the tradeoffs of DSO vs. static.


==
Drew Taylor  |  Freelance web development using
http://www.drewtaylor.com/   |  perl/mod_perl/MySQL/postgresql/DBI
mailto:[EMAIL PROTECTED]   |  Email jobs at drewtaylor.com
--
Speakeasy.net: A DSL provider with a clue. Sign up today.
http://www.speakeasy.net/refer/29655
==




Re: Monitoring the processes

2002-05-21 Thread F . Xavier Noria

On Mon, 20 May 2002 15:50:35 -0500
Gregory Matthews [EMAIL PROTECTED] wrote:

: Thanks to everyone for the great input on Memory Leaks.  Now that I have a 
: good starting point for tracking down the problem, when I TEST for leaks, 
: or simply check for a continued increase in server memory usage, how do I 
: go about monitoring the processes growth?

I have not used it, but it seems Apache::Status can help, see the
documentation about the option StatusTerseSizeMainSummary.

-- fxn




Re: Apache::GTopLimit

2002-05-21 Thread Gregory Matthews

Stas:

Since you wrote the script, do you recommend some good default settings in 
GTopLimit to start with, i.e.,

use Apache::GTopLimit;

Apache::GTopLimit-set_max_size(1);
Apache::GTopLimit-set_min_shared_size(4000);
Apache::GTopLimit-set_max_unshared_size(6000);

$Apache::GTopLimit::CHECK_EVERY_N_REQUESTS = 2;

I would like to start with recommended defaults and tweak if necessary from 
there.

Thanks.

Gregory











At 01:33 AM 5/22/2002 +0800, you wrote:
Perrin Harkins wrote:
Stas Bekman wrote:

Hmm, when a new process starts it shares *everything* with the parent. 
Why do you say that it's not?

It doesn't share everything with the parent.  As soon as it forks there 
is unshared memory, and after the first request it handles there is 
usually more.
Over time, the average amount of shared memory among child processes 
seems to gradually decrease.  Restarting fixes this.

What you are saying is that when the server is started afresh, the newly 
started child processes share more memory with the parent, than newly 
started child processes some time later. Am I correct?

__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com






Re: Apache::GTopLimit

2002-05-21 Thread Stas Bekman

Perrin Harkins wrote:
 Stas Bekman wrote:
 
 What you are saying is that when the server is started afresh, the 
 newly started child processes share more memory with the parent, than 
 newly started child processes some time later. Am I correct?

 Yes, exactly.

Any ideas why?

I always do a full restart, so I've never noticed the problem.

__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com




Re: Apache::GTopLimit

2002-05-21 Thread Stas Bekman

Gregory Matthews wrote:
 Stas:
 
 Since you wrote the script, do you recommend some good default settings 
 in GTopLimit to start with, i.e.,

Not really. It all depends on how many modules do you use and how big 
they are when compiled. I repeat many times in the guide, that all the 
examples are only examples. pretty much each setup is unique and there 
is no one-fit all setting.

 use Apache::GTopLimit;
 
 Apache::GTopLimit-set_max_size(1);
 Apache::GTopLimit-set_min_shared_size(4000);
 Apache::GTopLimit-set_max_unshared_size(6000);

Use Apache::VMonitor and it'll give you a good idea what are the 
settings that you want. Since it shows you the shared and max sizes.

 $Apache::GTopLimit::CHECK_EVERY_N_REQUESTS = 2;

This one is easy. If your processes are losing the shared memory slowly, 
raise this number, so less checks will be made. Otherwise keep it small. 
Again work with Apache::VMonitor and you will figure out the perfect setup.

 I would like to start with recommended defaults and tweak if necessary 
 from there.

See above.


__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com




Re: Apache::GTopLimit

2002-05-21 Thread Perrin Harkins

Stas Bekman wrote:
 Perrin Harkins wrote:
 
 Stas Bekman wrote:

 What you are saying is that when the server is started afresh, the 
 newly started child processes share more memory with the parent, than 
 newly started child processes some time later. Am I correct?


 Yes, exactly.
 
 
 Any ideas why?

Not really.  I thought maybe it was because of something changing in the 
parent process, but that doesn't seem possible.

There was a long thread a little while back about turning swap off and 
on again to solve this.  I've never tried that.  I think restarting 
every 24 hours is a good idea anyway, because I've seen strange things 
happen now and then when a server is up for a long time.

- Perrin




Re: Apache::GTopLimit

2002-05-21 Thread Stas Bekman

Perrin Harkins wrote:
 Stas Bekman wrote:
 
 Perrin Harkins wrote:

 Stas Bekman wrote:

 What you are saying is that when the server is started afresh, the 
 newly started child processes share more memory with the parent, 
 than newly started child processes some time later. Am I correct?

 Any ideas why?
 
 
 Not really.  I thought maybe it was because of something changing in the 
 parent process, but that doesn't seem possible.
 
 There was a long thread a little while back about turning swap off and 
 on again to solve this.  I've never tried that.  I think restarting 
 every 24 hours is a good idea anyway, because I've seen strange things 
 happen now and then when a server is up for a long time.

But that's unrelated to whether you kill the processes or not. Has 
anyone seen a similar behavior as described at the top of this post, 
when you have no swapping at all?

  I think restarting
  every 24 hours is a good idea anyway, because I've seen strange things
  happen now and then when a server is up for a long time.

It probably depends on what you do. I've restarted my production servers 
once in a few months, when something was going wrong. But as I said it 
depends on what do you do with mod_perl.

__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com




Storing blessed objects via Apache::Session

2002-05-21 Thread c.w.huling


I was attempting to store a blessed object via Apache::Session, but
when the session is returned, the hash is empty.  I did some google
searching and ran across a similar question:

http://www.geocrawler.com/archives/3/182/2000/5/0/3823715/

I have not found any other information, and was curious if there was
something special that had to be done for this to work?

Any and all help would be most appreciated!

I have the latest Apache::Session-1.54.

-- 
C Wayne Huling [EMAIL PROTECTED]



mod_perl via ssl?

2002-05-21 Thread Chris Garrigues

[ Apologies if you get this twice. ]

I've been lurking on this list for a while but hadn't actually been running 
mod_perl.  I'm now trying to get it working on my system, but have hit a 
wall that I'm sure someone can tell me how to get around.

I'm using the Mandrake RPMs for apache and mod_ssl:

apache-conf-1.3.23-4mdk
apache-1.3.23-4mdk
apache-devel-1.3.23-4mdk
apache-modules-1.3.23-4mdk
apache-mod_perl-1.3.23_1.26-5mdk
apache-common-1.3.23-4mdk
libopenssl0-0.9.6c-2mdk
openssl-0.9.6b-10
mod_ssl-2.8.7-2mdk
openssl-devel-0.9.6b-10

I just updated to this version and think I now have my conf files correct in the 
new architecture although I haven't actually run anything under mod_perl yet.

My question is that all my CGIs that I want to convert to mod_perl run under 
SSL, but I can't figure out how to enable SSL in the httpd-perl server.

Am I missing something simple?

Chris

-- 
Chris Garrigues http://www.DeepEddy.Com/~cwg/
virCIO  http://www.virCIO.Com
716 Congress, Suite 200
Austin, TX  78701   +1 512 374 0500

  My email address is an experiment in SPAM elimination.  For an
  explanation of what we're doing, see http://www.DeepEddy.Com/tms.html 

The Greatest tragedy in mankind's entire history may be the
  hijacking of morality by religion.  However valuable -- even
  necessary -- that may have been in enforcing good behavior on
  primitive peoples, their association is now counterproductive.
  Yet at the very moment when they should be decoupled,
  sanctimonious nitwits are calling for a return to morals based
  on superstition.
--- Arthur C. Clarke





msg27591/pgp0.pgp
Description: PGP signature


GTop

2002-05-21 Thread Gregory Matthews

I am trying to install GTop in order to install GTopLimit and am getting 
the following error on make:

glob failed (child exited with status 2) at Makefile.PL line 242.
glob failed (child exited with status 2) at Makefile.PL line 242.
Note (probably harmless): No library found for -lgtop
Note (probably harmless): No library found for -lgtop_sysdeps
Note (probably harmless): No library found for -lgtop_common
Note (probably harmless): No library found for -lglib
Can't exec glib-config: No such file or directory at (eval 18) line 12.
Note (probably harmless): No library found for -lgtop
Note (probably harmless): No library found for -lgtop_sysdeps
Note (probably harmless): No library found for -lgtop_common
Note (probably harmless): No library found for -lglib
Writing Makefile for GTop::Server
Writing Makefile for GTop
  make
Skip blib/lib/GTop.pod (unchanged)
Skip blib/lib/GTop.pm (unchanged)
/usr/bin/perl -I/usr/libdata/perl/5.00503/mach -I/usr/libdata/perl/5.00503 
/usr/libdata/perl/5.00503/ExtUtils/xsubpp  -typemap 
/usr/libdata/perl/5.00503/ExtUtils/typemap -typemap typemap.gtop -typemap 
typemap -typemap typemap GTop.xs xstmp.c  mv xstmp.c GTop.c
cc -c-DVERSION=\0.10\  -DXS_VERSION=\0.10\ -DPIC -fpic 
-I/usr/libdata/perl/5.00503/mach/CORE  GTop.c
GTop.xs:5: glib.h: No such file or directory
GTop.xs:6: glibtop.h: No such file or directory
GTop.xs:7: glibtop/open.h: No such file or directory
GTop.xs:8: glibtop/close.h: No such file or directory
GTop.xs:9: glibtop/xmalloc.h: No such file or directory
GTop.xs:10: glibtop/parameter.h: No such file or directory
GTop.xs:11: glibtop/union.h: No such file or directory
GTop.xs:12: glibtop/sysdeps.h: No such file or directory
*** Error code 1

I am on a Unix machine running FreeBSD.  Any ideas?  I saw that Stas had a 
similar problem a couple of year ago or so when trying to install the same 
thing.

Gregory





Strange subrequest dir_config issue

2002-05-21 Thread Matt Sergeant

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

This is just a heads up on something I've not seen documented in either the 
Eagle book or in the Cookbook (at least not that I can find).

If you create a subrequest via $r-lookup_file(), the per_dir_config entry 
doesn't seem to be created. If you use $r-lookup_uri(), it's fine. This can 
be an issue for people with complex applications and configurations trying to 
find out why $sub-dir_config() might not be returning what they expect.

Took me a while to figure this one out - just thought others might like to 
know.

- -- 
:-get a SMart net/:-
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE86ryEVBc71ct6OywRAkdkAKDR4kAQWpcy0voSgDfnN+Emo843vQCdGh4n
BswYva0r+TTJiSlN8xG0KCg=
=+DU7
-END PGP SIGNATURE-



Re: Storing blessed objects via Apache::Session

2002-05-21 Thread Chris Winters

On Tue, 2002-05-21 at 16:16, [EMAIL PROTECTED] wrote:
 I was attempting to store a blessed object via Apache::Session, but
 when the session is returned, the hash is empty.  I did some google
 searching and ran across a similar question:
 
 http://www.geocrawler.com/archives/3/182/2000/5/0/3823715/
 
 I have not found any other information, and was curious if there was
 something special that had to be done for this to work?
 
 Any and all help would be most appreciated!
 
 I have the latest Apache::Session-1.54.

Nothing special should be required -- I've done this with no problem
using recent versions -- 1.50+ -- of Apache::Session. The only way it
might be a problem is if you're trying to save a special resource in
the session -- database handle, socket connection, etc.

Are you sure basic sessions are working ok?

Chris

-- 
Chris Winters ([EMAIL PROTECTED])
Building enterprise-capable snack solutions since 1988.




mod_perl via ssl?

2002-05-21 Thread Chris Garrigues

I've been lurking on this list for a while but hadn't actually been running 
mod_perl.  I'm now trying to get it working on my system, but have hit a 
wall that I'm sure someone can tell me how to get around.

I'm using the Mandrake RPMs for apache and mod_ssl:

apache-conf-1.3.23-4mdk
apache-1.3.23-4mdk
apache-devel-1.3.23-4mdk
apache-modules-1.3.23-4mdk
apache-mod_perl-1.3.23_1.26-5mdk
apache-common-1.3.23-4mdk
libopenssl0-0.9.6c-2mdk
openssl-0.9.6b-10
mod_ssl-2.8.7-2mdk
openssl-devel-0.9.6b-10

I just updated to this version and think I now have my conf files correct in the 
new architecture although I haven't actually run anything under mod_perl yet.

My question is that all my CGIs that I want to convert to mod_perl run under 
SSL, but I can't figure out how to enable SSL in the httpd-perl server.

Am I missing something simple?

Chris

-- 
Chris Garrigues http://www.DeepEddy.Com/~cwg/
virCIO  http://www.virCIO.Com
716 Congress, Suite 200
Austin, TX  78701   +1 512 374 0500

  My email address is an experiment in SPAM elimination.  For an
  explanation of what we're doing, see http://www.DeepEddy.Com/tms.html 

The Greatest tragedy in mankind's entire history may be the
  hijacking of morality by religion.  However valuable -- even
  necessary -- that may have been in enforcing good behavior on
  primitive peoples, their association is now counterproductive.
  Yet at the very moment when they should be decoupled,
  sanctimonious nitwits are calling for a return to morals based
  on superstition.
--- Arthur C. Clarke





msg27595/pgp0.pgp
Description: PGP signature


Re: mod_perl via ssl?

2002-05-21 Thread Stephen Reppucci


You need to specify a command line option of -DSSL when you start
the server. If you're using the stock apachectl, it's usually
'./apachectl start_ssl'

Not that this question is on topic...

On Tue, 21 May 2002, Chris Garrigues wrote:

 I've been lurking on this list for a while but hadn't actually been running
 mod_perl.  I'm now trying to get it working on my system, but have hit a
 wall that I'm sure someone can tell me how to get around.

 I'm using the Mandrake RPMs for apache and mod_ssl:

 apache-conf-1.3.23-4mdk
 apache-1.3.23-4mdk
 apache-devel-1.3.23-4mdk
 apache-modules-1.3.23-4mdk
 apache-mod_perl-1.3.23_1.26-5mdk
 apache-common-1.3.23-4mdk
 libopenssl0-0.9.6c-2mdk
 openssl-0.9.6b-10
 mod_ssl-2.8.7-2mdk
 openssl-devel-0.9.6b-10

 I just updated to this version and think I now have my conf files correct in the
 new architecture although I haven't actually run anything under mod_perl yet.

 My question is that all my CGIs that I want to convert to mod_perl run under
 SSL, but I can't figure out how to enable SSL in the httpd-perl server.

 Am I missing something simple?

 Chris



-- 
Steve Reppucci   [EMAIL PROTECTED] |
Logical Choice Software  http://logsoft.com/ |
=-=-=-=-=-=-=-=-=-=-  My God!  What have I done?  -=-=-=-=-=-=-=-=-=-=




#perl SSI directive not recognised

2002-05-21 Thread Alan Burlison

I'm sure this is a FAQ, but I can't find it anywhere, and the mail
archives seem to be down.

I am trying to get the following SSI directive to work:

!--#perl sub=MySSI::my_status--

and I get the following error in the server log:

unknown directive perl in parsed doc /var/apache/htdocs/index.html

I know that I have SSI set up OK because if I replace the above with

!--#echo var=DATE_LOCAL--

I see the date as expected.  The /perl-status pages show that the MySSI
module is loaded, and that the PerlSSI directive is enabled.  I've
carefully read through the example in the eagle book, and I can't spot
what is wrong.  Can someone spare me a clue?

Thanks,

-- 
Alan Burlison
--
$ head -1 /dev/bollocks
risk manage three-tier high-volume price performance



compile errors

2002-05-21 Thread m31

Hi,  I'm trying to upgrade to and compile mod_perl1.26 and seem to be 
getting errors. I am working on OSX 10.1.4 (Darwin 5.4), Perl/5.6.0, 
mod_perl/1.25, apache/1.3.23.

I run `perl Makefile.pl NO_HTTPD=1` and get the following errors:
/usr/bin/perl t/TEST 0
Can't locate object method new via package URI::URL at 
../blib/lib/Apache/test.pm line 252.
make: *** [run_tests] Error 255

Is mod_perl1.26 able to compile under osx 10.1.4? Can someone help?




GTop

2002-05-21 Thread Gregory Matthews

When trying to install GTop, I received the following

Note (probably harmless): No library found for -lgtop
Note (probably harmless): No library found for -lgtop_sysdeps
Note (probably harmless): No library found for -lgtop_common
Note (probably harmless): No library found for -lglib
Can't exec glib-config: No such file or directory at (eval 18) line 12.
Note (probably harmless): No library found for -lgtop
Note (probably harmless): No library found for -lgtop_sysdeps
Note (probably harmless): No library found for -lgtop_common
Note (probably harmless): No library found for -lglib
Writing Makefile for GTop::Server
Writing Makefile for GTop

My glib-config directory is /usr/local/bin and the name of the actual file 
is glib12-config.

How can I tell GTop where this file is and what the actual file name is? 
Don't ask me why my server named it that way, but when doing ### a %locate 
glib command, I get (you'll see the glib12-config file down towards the 
bottom):

/compat/linux/usr/bin/glibcbug
/compat/linux/usr/doc/glib-1.2.6
/compat/linux/usr/doc/glib-1.2.6/AUTHORS
/compat/linux/usr/doc/glib-1.2.6/COPYING
/compat/linux/usr/doc/glib-1.2.6/ChangeLog
/compat/linux/usr/doc/glib-1.2.6/NEWS
/compat/linux/usr/doc/glib-1.2.6/README
/compat/linux/usr/doc/glibc-2.1.2
/compat/linux/usr/doc/glibc-2.1.2/BUGS
/compat/linux/usr/doc/glibc-2.1.2/ChangeLog.1.gz
/compat/linux/usr/doc/glibc-2.1.2/ChangeLog.2.gz
/compat/linux/usr/doc/glibc-2.1.2/ChangeLog.3.gz
/compat/linux/usr/doc/glibc-2.1.2/ChangeLog.4.gz
/compat/linux/usr/doc/glibc-2.1.2/ChangeLog.5.gz
/compat/linux/usr/doc/glibc-2.1.2/ChangeLog.6.gz
/compat/linux/usr/doc/glibc-2.1.2/ChangeLog.7.gz
/compat/linux/usr/doc/glibc-2.1.2/ChangeLog.8.gz
/compat/linux/usr/doc/glibc-2.1.2/ChangeLog.9.gz
/compat/linux/usr/doc/glibc-2.1.2/ChangeLog.gz
/compat/linux/usr/doc/glibc-2.1.2/ChangeLog.threads.gz
/compat/linux/usr/doc/glibc-2.1.2/Changes.threads
/compat/linux/usr/doc/glibc-2.1.2/FAQ
/compat/linux/usr/doc/glibc-2.1.2/FAQ-threads.html
/compat/linux/usr/doc/glibc-2.1.2/INSTALL
/compat/linux/usr/doc/glibc-2.1.2/NEWS
/compat/linux/usr/doc/glibc-2.1.2/NOTES
/compat/linux/usr/doc/glibc-2.1.2/PROJECTS
/compat/linux/usr/doc/glibc-2.1.2/README
/compat/linux/usr/doc/glibc-2.1.2/README.crypt
/compat/linux/usr/doc/glibc-2.1.2/README.db2
/compat/linux/usr/doc/glibc-2.1.2/README.db2.mutex
/compat/linux/usr/doc/glibc-2.1.2/README.hesiod
/compat/linux/usr/doc/glibc-2.1.2/README.libm
/compat/linux/usr/doc/glibc-2.1.2/README.template
/compat/linux/usr/doc/glibc-2.1.2/README.threads
/compat/linux/usr/doc/glibc-2.1.2/README.timezone
/compat/linux/usr/doc/glibc-2.1.2/README.utmpd
/compat/linux/usr/doc/glibc-2.1.2/examples.threads
/compat/linux/usr/doc/glibc-2.1.2/examples.threads/Makefile
/compat/linux/usr/doc/glibc-2.1.2/examples.threads/ex1.c
/compat/linux/usr/doc/glibc-2.1.2/examples.threads/ex2.c
/compat/linux/usr/doc/glibc-2.1.2/examples.threads/ex3.c
/compat/linux/usr/doc/glibc-2.1.2/examples.threads/ex4.c
/compat/linux/usr/doc/glibc-2.1.2/examples.threads/ex5.c
/compat/linux/usr/doc/glibc-2.1.2/examples.threads/ex6.c
/compat/linux/usr/lib/libglib-1.2.so.0
/compat/linux/usr/lib/libglib-1.2.so.0.0.6
/usr/local/bin/glib12-config
/usr/local/include/glib12
/usr/local/include/glib12/glib.h
/usr/local/include/glib12/glibconfig.h
/usr/local/include/glib12/gmodule.h
/usr/local/include/jpeglib.h
/usr/local/info/glib.info
/usr/local/lib/libglib12.a
/usr/local/lib/libglib12.so
/usr/local/lib/libglib12.so.3
/usr/local/man/man1/glib12-config.1.gz
/usr/local/share/aclocal/glib.m4
/var/db/pkg/glib-1.2.8
/var/db/pkg/glib-1.2.8/+COMMENT
/var/db/pkg/glib-1.2.8/+CONTENTS
/var/db/pkg/glib-1.2.8/+DESC
/var/db/pkg/glib-1.2.8/+REQUIRED_BY





Re: GTop

2002-05-21 Thread Perrin Harkins

If you're not able to resolve your difficulties with GTop, try
Apache::SizeLimit instead.  It fully supports FreeBSD.  You just need to
install the BSD::Resource module, which is useful to have anyway.

- Perrin




Re: What causes memory leaks during graceful restarts?

2002-05-21 Thread Doug MacEachern

On Tue, 21 May 2002, Dan Wilga wrote:
 
 I am using Perl 5.6.1, modperl 1.25, and yes it's a DSO. It's compiled with:

with 1.25, you can also set the PERL_DESTRUCT_LEVEL environment variable 
to 2, either before starting the server:

export PERL_DESTRUCT_LEVEL=2
apachectl start

or using PerlSetEnv in httpd.conf

the fix in modperl-1.26 is simply to use that value by default.





RE: mod_perl2: nmake test crashes apache

2002-05-21 Thread Doug MacEachern

On Tue, 21 May 2002, Alessandro Forghieri wrote:

 The execution order turns out to be: 1+2 and *then* 3. It looks like a
 thread is allocated to this (client,handler) pair, so Frame 1 and 3 are
 running in the same thread, separate from the thread that's running 2.

there should never be multiple requests being served concurrently by the 
same thread.  if this is happening, this is a major bug in the winnt mpm.
the same thread may handle request #1, then #3 when it is done serving #1, 
but not both at the same time.




Re: Storing blessed objects via Apache::Session

2002-05-21 Thread Chris Winters

On Tue, 2002-05-21 at 19:19, [EMAIL PROTECTED] wrote:
 Chris Winters writes:
  Nothing special should be required -- I've done this with no problem
  using recent versions -- 1.50+ -- of Apache::Session. The only way it
  might be a problem is if you're trying to save a special resource in
  the session -- database handle, socket connection, etc.
  
  Are you sure basic sessions are working ok?
 
 Yes, the basic functions work, but I do have a DBH inside the object.  

That might be it. To test just do something like:

 $session{foo} = bless( { hey = 'there' }, 'My::Class' );

save it, fetch it and see what happens when you do a 'ref
$session{foo}'.

You might want to either rethink having the database handle in the
object -- retrieving it from a common central location, for instance --
or create a simple function to copy the object without database handle
and set it into the session.

Chris

-- 
Chris Winters ([EMAIL PROTECTED])
Building enterprise-capable snack solutions since 1988.




Re: #perl SSI directive not recognised

2002-05-21 Thread Doug MacEachern

the #perl directive is disabled if modperl is built as dso, Makefile.PL 
prints a message about this.  won't be an issue with 2.0 thanks to apr 
optional functions.  but in 1.x, the modperl .so cannot resolve symbols 
from mod_include.so.  at least, it can't on all platforms and can't if one 
were to disable LoadModule of mod_include.so






Re: GTop

2002-05-21 Thread Gregory Matthews

Thanks Perrin.  I've wasted so much time today trying to figure out what 
was going on with my glib installation.

I guess your suggestion might be the better solution anyhow as I sure don't 
want to run into installation problems for my customers down the road!

I also suppose that this means that I will be unable to use the VMonitor 
module.  Back to top!

Thanks again.

Gregory

At 10:00 PM 5/21/2002 -0400, you wrote:
If you're not able to resolve your difficulties with GTop, try
Apache::SizeLimit instead.  It fully supports FreeBSD.  You just need to
install the BSD::Resource module, which is useful to have anyway.

- Perrin





compile time errors

2002-05-21 Thread m31

I'm sorry (i wass in a rush), the errors come up when I run make test, 
the `perl Makefile.pl` works fine. (on OSX 10.1.4 (Darwin 5.4), 
Perl/5.6.0, mod_perl/1.25, apache/1.3.23)

$ make test
...some more stuff

/usr/bin/perl t/TEST 0
Can't locate object method new via package URI::URL at 
../blib/lib/Apache/test.pm line 252.
make: *** [run_tests] Error 255


Is mod_perl1.26 able to compile under osx 10.1.4? Can someone help?




Perl written in mod_perl

2002-05-21 Thread Gregory Matthews

Here's an odd question for you.  Why is it when I go to places like 
cgi-resources.com and other cgi repositories, mod_perl applications are far 
and few between...commercially that is?

All I see are common cgi scripts written in plain perl.

Does it have anything to do with the configurability tasks involved on the 
customers box, i.e., once the sale is made?

If this is the wrong place for a question like this, I apologize.  Just 
curious.

Gregory





Image::Size, TT, and mod_perl Question

2002-05-21 Thread Mike Melillo



I posed this question to the Template Toolkit list and got no response,
so I figured I'd give this list a shot...


-

Hello, below is some code I have in a mod_perl handler that checks to
see if an uploaded image is less than 300 pixels tall or wide.
Everything seems to be working except the fact that the template is not
returning with the proper values processed.  Below is the code and the
err_log output when I output an image that is too wide.


[snip] 
my $upload = $r-upload;
my $type= $upload-type;
my $fh  = $upload-fh;
my $username= $r-param('username');


my ($x, $y) = imgsize($fh);
print STDERR Dumper($x);
print STDERR Dumper($y);

unless ($x  300) {
print STDERR the greater than works\n;
 # This checks to make sure the image isnt more than 300 x 300
 my %vars = {TOO_WIDE = 1};
 my $config = {
INCLUDE_PATH = '/moc/html/templates',
POST_CHOMP = 1,
EVAL_PERL = 1,
 };

 my $template = Template-new($config) || die New Template Failed:
$!\n;

#the process method prints the template out to the browser via
$r
$template-process('pic_upload.tt2', \%vars, $r) || do {
  $r-log_reason($template-error());
  return SERVER_ERROR;
};
return OK;

} # end of X/Y coordinate if

[snip]

The err_log output:

$VAR1 = 310;
$VAR1 = 72;
the greater than works

[end of err_log]

The problem is the template pic_upload.tt2 has this in it:

[% IF TOO_WIDE %]
font color=redYour File was too big.  Make it under 30K/fontp [%
END %]

But that isn't showing up.  I do the almost identical thing immediately
after this if clauses to check if the file's type is a jpeg.  That
works, so I don't understand what I pasted in wrong, or forgot to paste
in.

Mike







Re: Image::Size, TT, and mod_perl Question

2002-05-21 Thread Perrin Harkins

  my %vars = {TOO_WIDE = 1};

That isn't doing what you think it's doing.  Try this:

my $vars = { 'TOO_WIDE' = 1 };



Re: Perl written in mod_perl

2002-05-21 Thread Peter J. Schoenster

On 21 May 2002 at 22:23, Gregory Matthews wrote:

 Here's an odd question for you.  Why is it when I go to places like
 cgi-resources.com and other cgi repositories, mod_perl applications
 are far and few between...commercially that is?
 
 All I see are common cgi scripts written in plain perl.
 
 Does it have anything to do with the configurability tasks involved on
 the customers box, i.e., once the sale is made?
 
 If this is the wrong place for a question like this, I apologize. 
 Just curious.

I think it's a good question.  Unlike I reckon most people on this 
list, I live in a virtual world.  I started my first programming job 
at an ad agency and even the site we did for FedEx went on a virtual 
server.  I think the vast majority of people out there are also 
running virtual servers.  Only recently did the company we host at 
offer mod_perl as an option.  

But then to offer an application for the public at large (not just to 
mod_perl developers)  to download and install ... well, that's 
another beast. Always best to look at those with some expertise. 
Extropia for example. I downloaded their ProjectTracker and it was a 
cgi installation (and made extremely easy to install). I didn't look 
but I bet I could turn it into a handler. I took their experience and 
turned my image gallery application into a cgi application. Anyone 
who knows can turn the cgi handlers into mod_perl handlers otherwise 
it will work in standard cgi environment or under Apache::Registry. 
Even so, when helping people (and usually people for whom an ftp gui 
is tech) install cgi applications on virtual servers is rarely 
simple. 

Even today I cannot run most of the large scale mod_perl applications 
as I'm still using virtual servers and most of the mod_perl apps 
require a greater degree of control than I have. 

PHP on the other hand, it's everywhere. I have a link to a PHP image 
gallery on my site that is quite nice. I offer it as an alternative 
to my application . It can be installed from the web browser. I have 
installed Perl cgi applications where that was been done as well. I 
cannot imagine doing that for mod_perl applications though.

In short, mod_perl applications using handlers has a very dedicated 
and passionate but limited audience imho.


Peter
-- http://www.readbrazil.com/
Answering Your Questions About Brazil




Trouble installing mod_perl module files

2002-05-21 Thread Vicki Brown

I just installed Apache 1.3.22 (that's what's in the FreeBSD ports
collection).  We were previously running 1.3.14

I installed mod_perl-1.26 into this with

 perl Makefile.PL \
APACHE_SRC=/usr/ports/www/apache13/work/apache_1.3.22/src \
DO_HTTPD=1 \
USE_APACI=1 \
PREP_HTTPD=1 \
EVERYTHING=1
  make
  make install

Then I (re)built and (re)installed Apache. When I finished, I ran
/usr/local/apache/bin/apachectl configtest and I get

 Syntax error on line 207 of /usr/local/apache/conf/httpd.conf:
 Cannot load /usr/local/apache/libexec/apache/mod_mmap_static.so into server:
 Cannot open /usr/local/apache/libexec/apache/mod_mmap_static.so

It's true; there are no modules in /usr/local/apache/libexec/ - nothing much
is
in that directory. I've rebuild and re-installed both mod_perl and apache to
no avail.

The LoadModule lines are being added to httpd.conf

  LoadModule mmap_static_module libexec/apache/mod_mmap_static.so
  ...

  ClearModuleList
  AddModule mod_mmap_static.c
  ...

But the files aren't being installed into libexec/

Do I have to move the files manually?!
Am I doing something / not doing something that should be obvious?
-- 
- Vicki

Vicki Brown ZZZ  Journeyman Sourceror:
P.O. Box 1269  zz  |\ _,,,---,,_Scripts  Philtres
San Bruno, CA   zz /,`.-'`'-.  ;-;;,_ Perl, Unix, MacOS
94066 USA |,4-  ) )-,_. ,\ ( `'-'
mailto:[EMAIL PROTECTED]  '---''(_/--'  `-'\_)  http://www.cfcl.com/~vlb



Re: compile time errors

2002-05-21 Thread Jie Gao

On Tue, 21 May 2002, m31 wrote:

 I'm sorry (i wass in a rush), the errors come up when I run make test,
 the `perl Makefile.pl` works fine. (on OSX 10.1.4 (Darwin 5.4),
 Perl/5.6.0, mod_perl/1.25, apache/1.3.23)

 $ make test
 ...some more stuff
 
 /usr/bin/perl t/TEST 0
 Can't locate object method new via package URI::URL at
 ../blib/lib/Apache/test.pm line 252.
 make: *** [run_tests] Error 255

http://groups.yahoo.com/group/modperl/message/42895




Jie




Re: Setting require in Authentication handler?

2002-05-21 Thread Todd Chapman


I need to decide who has access based on the URI. I guess this means I
can't use Apache's Basic auth module, since I can't dynamically set
require. Does the cookbook have a code sample of checking the password for
basic authentication?

-Todd

On Mon, 20 May 2002, Geoffrey Young wrote:

 
 
 Todd Chapman wrote:
 
  Can dir_config be used to set 'require' in an authentication handler?
 
 
 no.  dir_config() provides access to a mod_perl specific table of variables, not 
generic 
 Apache configuration directives.
 
 there is no API for setting the Require directive - it needs to be in your 
httpd.conf.
 
 
  I would then return DECLINED do that Apache's Basic auth handler would do
  the heavy lifting of checking the password.
 
 if you're looking to do conditional authentication what you really need to do is a 
bit 
 backward - turn on all authentication hooks using the Require directive then use 
your 
 handler to return OK when you don't want Apache to check the password.  See recipe 
13.5 in 
 the cookbook for more information.
 
 the Satisfy any Apache directive may be able to help as well if you're using 
host-based 
 criteria to determine whether you want to require a login.
 
 HTH
 
 --Geoff
 




Re: Setting require in Authentication handler?

2002-05-21 Thread Todd Chapman


That makes sense. I can't use mod_auth because I can't set Require. I'm
using Basic authentication and text based password files. Unfortunately, I
can't find an Apache::Auth* module that handles basic authentication
against text files. Did I miss it somewhere?

Thanks.

-Todd

On Mon, 20 May 2002, Geoffrey Young wrote:

 
 
  Does the cookbook have a code sample of checking the password for
  basic authentication?
 
 
 well, not via .htpasswd files, no.  in general, it doesn't make much sense to use 
mod_perl 
 to duplicate the same things that Apache already does for you, since the Apache code 
is 
 faster, has had more eyeballs looking at it for longer, etc.  in that sense you 
wouldn't 
 want to write your own routine to just check a flat file.  where mod_perl really 
shines 
 wrt authentication is with all the other things Perl does well, such as using DBI to 
 authenticate against a database, or working with other schemes like SMB or Radius - 
see 
 the 25+ Apache::Auth* modules on CPAN for just about anything you could think of.
 
 however, we do describe how to use the mod_perl API to interact with Apache the same 
way 
 mod_auth does using $r-get_basic_auth_pw() and $r-not_basic_auth_failure() in a 
few 
 different ways.  you will also find those two methods in the eagle book if you have 
it.
 
 make sense?
 
 --Geoff
 
 
 




Re: Setting require in Authentication handler?

2002-05-21 Thread Todd Chapman



On Mon, 20 May 2002, Geoffrey Young wrote:

 
 
 Todd Chapman wrote:
 
  That makes sense. I can't use mod_auth because I can't set Require. 
 
 
 well, if you're saying that you don't have the ability to set the Require directive 
at all 
 (as in you don't have access to edit httpd.conf), then you can't run any 
authentication 
 handler - mod_auth, mod_perl, or otherwise.  Apache core requires the Require 
directive to 
 be set to something before it will even try to run the authen/authz phases of the 
request.
 
 so, you may be out of luck and need to resort to the CGI tricks of yore where 
everything 
 is clumped in the content-generation phase (and of which I'm not that familiar).

I can set Require, but I will have to ignore it's value since the realm, 
password file, and require are decided based on the URI.

 
  I'm
  using Basic authentication and text based password files. Unfortunately, I
  can't find an Apache::Auth* module that handles basic authentication
  against text files. Did I miss it somewhere?
 
 
 I'm not sure, but it may not exist for the reason I stated eariler about mod_perl 
not 
 duplicating default Apache behavior.  IIRC, there is one that authenticates against 
 /etc/passwd, so maybe you can use that as an example of flat file based processing.
 
 in general, though, the steps are pretty much the same no matter which 
authentication 
 method you choose.  see
 
http://www.modperlcookbook.org/code/ch13/Cookbook/Authenticate.pm
 
 for an example - all you need to do is replace the authenticate_user() subroutine 
with 
 calls that validate the user based on your own criteria.
 

Thanks. Sounds like we need an Apache::AuthBasicFile since mod_auth
doesn't allow Require to be set dynamically.

-Todd

 HTH
 
 --Geoff
 
 
 
 




Re: Trouble installing mod_perl module files

2002-05-21 Thread Jie Gao

On Tue, 21 May 2002, Vicki Brown wrote:

 I just installed Apache 1.3.22 (that's what's in the FreeBSD ports
 collection).  We were previously running 1.3.14

 I installed mod_perl-1.26 into this with

  perl Makefile.PL \
 APACHE_SRC=/usr/ports/www/apache13/work/apache_1.3.22/src \
 DO_HTTPD=1 \
 USE_APACI=1 \
 PREP_HTTPD=1 \
 EVERYTHING=1
   make
   make install

 Then I (re)built and (re)installed Apache. When I finished, I ran
 /usr/local/apache/bin/apachectl configtest and I get

  Syntax error on line 207 of /usr/local/apache/conf/httpd.conf:
  Cannot load /usr/local/apache/libexec/apache/mod_mmap_static.so into server:
  Cannot open /usr/local/apache/libexec/apache/mod_mmap_static.so

 It's true; there are no modules in /usr/local/apache/libexec/ - nothing much
 is
 in that directory. I've rebuild and re-installed both mod_perl and apache to
 no avail.

 The LoadModule lines are being added to httpd.conf

   LoadModule mmap_static_module libexec/apache/mod_mmap_static.so
   ...

   ClearModuleList
   AddModule mod_mmap_static.c

You need to configure Apache to build those modules, either statically or
as dso, with:

--enable-module=NAME
--enable-shared=NAME

Read the file INSTALL in the Apache distribution.

Regards,




Jie




Re: GTop

2002-05-21 Thread Stas Bekman

Gregory Matthews wrote:
 When trying to install GTop, I received the following
 
 Note (probably harmless): No library found for -lgtop
 Note (probably harmless): No library found for -lgtop_sysdeps
 Note (probably harmless): No library found for -lgtop_common
 Note (probably harmless): No library found for -lglib
 Can't exec glib-config: No such file or directory at (eval 18) line 12.
 Note (probably harmless): No library found for -lgtop
 Note (probably harmless): No library found for -lgtop_sysdeps
 Note (probably harmless): No library found for -lgtop_common
 Note (probably harmless): No library found for -lglib

You have to install first the development libraries (including glib-config).

Either fetch them from 
http://fr.rpmfind.net/linux/rpm2html/search.php?query=libgtop
if you on linux, or try the source:
ftp://ftp.gnome.org/pub/GNOME/stable/sources/gtop/

__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com




Apache::AuthCookieDBI not sending cookies?

2002-05-21 Thread Brian Reichert

I've pawed though the archives, to no avail...

I've almost, but not quite, have Apache::AuthCookieDBI working for
me.

The symptom I'm seeing (to my eye) is that my browser is never
getting cookies sent back to it, even if I hand login.pl a valid
user/password.  (So I infer from the final error message; see below.)

Details of my setup:

  Apache::AuthCookieDBI 1.18

  $ httpd -v
  Server version: Apache/1.3.12 Cobalt (Unix) (please don't laugh)
  Server built:   May 25 2001 17:23:24

In my httpd.conf:

  Files *.pl
SetHandler perl-script
PerlHandler Apache::Registry
Options ExecCGI
PerlSendHeader On
  /Files
  
  PerlSetVar CredTestDBI_DSN DBI:mysql:database=devel_db
  PerlSetVar CredTestDBI_User 
  PerlSetVar CredTestDBI_Password xx
  PerlSetVar CredTestDBI_UsersTable cred_test_user
  PerlSetVar CredTestDBI_GroupsTable cred_test_group
  PerlSetVar CredTestDBI_SecretKeyFile /home/sites/siteNN/cred_auth.key
  
  PerlSetVar CredTestPath /
  PerlSetVar CredTestLoginScript /cgi-bin/login.pl
  
  PerlSetVar AuthCookieDebug 3
  
  PerlModule Apache::AuthCookieDBI
  
  Location /credentials/private
AuthType Apache::AuthCookieDBI
AuthName CredTest
PerlAuthenHandler Apache::AuthCookieDBI-authenticate
PerlAuthzHandler Apache::AuthCookieDBI-authorize
require valid-user
  /Location
  
  Files LOGIN
  AuthType Apache::AuthCookieDBI
AuthName CredTest
SetHandler perl-script
PerlHandler Apache::AuthCookieDBI-login
  /Files

When I make a request for /credentials/private/index.html, I indeed
get the login page.  My (slightly sanitized) web log shows:

  [Wed May 22 01:15:59 2002] [error] auth_type Apache::AuthCookieDBI
  [Wed May 22 01:15:59 2002] [error] auth_name CredTest
  [Wed May 22 01:15:59 2002] [error] ses_key_cookie 
  [Wed May 22 01:15:59 2002] [error] uri /credentials/private/index.html

I then fill in the fields, and hit 'submit':

  [Wed May 22 01:16:03 2002] [error] Converting POST - GET

Now, my browser's connection hangs for a few minutes, ultimately
yielding no data.  If I get impatient, and terminate things
browser-side; my web log then shows:

  [Wed May 22 01:16:26 2002] [error] credential_0 foo
  [Wed May 22 01:16:26 2002] [error] credential_1 bar
  [Wed May 22 01:16:26 2002] [error] access to /LOGIN failed for
  NNN.NNN.NNN.NNN, reason: Apache::AuthCookieDBI: didn't have the
  secret key for auth realm CredTest
  [Wed May 22 01:16:26 2002] [error] ses_key bad

I get these same result with two different browsers, and using the
example login.pl programs that come with Apache::AuthCookieDBI and
Apache::AuthCookie.

Does anyone have any insight on what I'm _supposed_ to be seeing?

-- 
Brian 'you Bastard' Reichert[EMAIL PROTECTED]
37 Crystal Ave. #303Daytime number: (603) 434-6842
Derry NH 03038-1713 USA Intel architecture: the left-hand path