Re: httpd.conf - caching

2001-08-27 Thread Nick Tonkin


On Sun, 26 Aug 2001, allan wrote:

 im a bit confused – or perhaps bewildered about finally having installed
 mod_perl on mac osX.

Well, that's to be expected. It's a bit confusing first time through.

 these questions should apply cross platform 
 
 1) 
 yesterday im quite sure my httpd.conf file was /usr/local/apache/conf/httpd.conf.
 today (after having played around) it suddenly appears to be /etc/httpd/httpd.conf
 

You don't say how you played around ... sounds like you installed apache
in two different locations. In any case, this isn't a mod_perl issue at
all ...


 can this be?
 can i actually tell the sever somehow to use the one in
 /usr/local/apache/conf where the other conf files are.
 

httpd -f /path/to/your/httpd.conf

(Again, a very basic apache question. You really need to read the docs for
apache. If you keep asking questions like this folks are going to quickly
tire of helping you!)

 
 the only reason i discovered this was because i wanted to change the
 number of child processes to only one. which brings me to:
 
 2)
 im experiencing some heavy modoule-caching annoyance i guess. if i run the
 simple hello.pm (see below) and make a very small change - the change
 might take effect immidiately in the browser but more frequently it will
 show a cached version of the page. 
 (i noticed a pattern in my access_log that the last number-field on the
 lines would be the same if the page didnt change)
 

Do you know why you are running mod_perl with your apache? The
modoule-caching annoyance you speak of is the basic reason for the
existence of mod_perl ... the idea is that the perl code in your module
only gets compiled once rather than every time a user requests the URI.

If you change the code in the module you won't see the changes until a new
child process is spawned and compiles the new code (depending on your
config maybe not even then ...) 

Most static sites don't need mod_perl ... if you are just installing
apache for the first time maybe you should become familiar with running a
webserver before you move on to mod_perlifying it ... ?



 i have read a little about this problem but dont understand the soloution(s).

you can run httpd in single-process mode as you say, or you can look at
Apache::Reload ... this forces your code to be recompiled every time it
has changed (at the cost of checking out whether it has in fact changed,
every request). Try perldoc Apache::Reload ...

 for instance what is the exact procedure for httpd -x?
 is it like this command:
 
 [localhost:/usr/local/apache/sbin] aju% httpd -x

Well, actually it's httpd -X ...

 
 this command will do nothing on my system, not even complain.

You should not see anything at the command line. The daemon is running, in
single-process mode, still attached to the terminal in which you started
it, waiting for a request. This again is very basic apache operation. Have
you read the docs that come with your apache?


 if i manually configure my httpd.conf file to only one server-child i
 sometimes get two children?
 

One parent, one child, probably.

 also there are some talk about global variables, but looking at the code
 i dont see any?
 

There are quite a lot of talk about global variables, actually. It's a
pretty big deal with this stuff. You need to go to the mod_perl guide, and
spend _SEVERAL HOURS_ reading it and playing with your installation. If
you devote the necessary time to educating yourself, you'll figure most
of it out, and you can bring your tough questions to this list.

 allan

Good luck,

Nick




mod_perl memory consumption

2001-08-27 Thread Miroslav Madzarevic

BlankI wrote a program that converts 5 gigs of emails stored in mysql to
phisical messages on disk (resulting in approximately 10 gigs). The program
consumes way to much memory although I've wrote it in a very clean way (use
strict, no globals, use of udef $var; to help free memory). I start it
telneting to :80 and through time process takes from 15 megs to more than
100 megs and only about 20% of messages are converted so far. The program
uses vpopmail.pm and should run approximately one day. Maybe it would be
faster if I used Apache::FakeRequest or something similar eleminating use of
mod_perl (plain cgi) ? I'm using HTML::Mason.

Why is the memory consumption so high ? According to my calculations it
should take less than 100 kilobytes.


Regards,
Mire
--
perl -Mstrict -e 'print pack(h*, d69627560496e616d656e236f6d6),\n'
OPTIMISED FOR HUMAN OPTICAL NERVE
BEST VIEWED WITH A MONITOR grin




build problem on Solaris (fwd)

2001-08-27 Thread Stas Bekman


Zhong Quan, please re-read
http://perl.apache.org/guide/help.html#Contacting_me, you should post
questions to the list and not directly to me.

Let's see if anybody using Solaris knows about this problem.

-- Forwarded message --
Date: Mon, 27 Aug 2001 17:19:00 +0800
From: Mao, Zhong Quan (James) [EMAIL PROTECTED]
To: '[EMAIL PROTECTED]' [EMAIL PROTECTED]
Cc: Mao, Zhong Quan (James) [EMAIL PROTECTED]
Subject: mod_perl guide corrections.

Thank  you for your very good web site and document for mod_perl.  But when
I install it,some errors  occured.
The following is the error message:

** A test compilation with your Makefile configuration
** failed.  The below error output from the compilation
** test will give you an idea what is failing. Note that
** Apache requires an ANSI C Compiler, such as gcc.

 Error Output for sanity check 
cd ..; gcc  -DSOLARIS2=260 -DMOD_PERL -DUSE_PERL_SSI  -DUSE_EXPAT
-I./lib/expat-lite -DNO_DL_NEEDED `perl -MExtUtils::Embed -e ccopts` -I.
-I/opt/exp/perl/lib/5.00503/sun4-solaris/CORE-o helpers/dummy
helpers/dummy.c  `perl -MExtUtils::Embed -e ldopts` -lsocket -lnsl
/opt/exp/perl/lib/5.00503/sun4-solaris/auto/DynaLoader/DynaLoader.a
-L/opt/exp/perl/lib/5.00503/sun4-solaris/CORE -lperl -lsocket -lnsl -ldl -lm
-lc -lcrypt
Undefined   first referenced
 symbol in file
_delete /usr/lib/libgen.so.1
_insert /usr/lib/libgen.so.1
ld: fatal: Symbol referencing errors. No output written to helpers/dummy
*** Error code 1
make: Fatal error: Command failed for target `dummy'
= End of Error Report =

 Aborting!

Can you tell me what's the problem? Thanks!

James mao




Re: httpd.conf - caching

2001-08-27 Thread i49242

nick
thanks for the reply, and pointers - i guess i have completely lost overview 
thru the installation mist om mac osX. most of my questions were indeed more 
apache than mod_perl.

 Do you know why you are running mod_perl with your apache? 

to be honest, not entirely :-)

 The modoule-caching annoyance you speak of is the basic reason for the
 existence of mod_perl ... the idea is that the perl code in your module
 only gets compiled once rather than every time a user requests the URI.

true, but if it *never* gets recompiled there are reasons to worry.

 There are quite a lot of talk about global variables, actually. It's a
 pretty big deal with this stuff. You need to go to the mod_perl guide,
 and
 spend _SEVERAL HOURS_ reading it and playing with your installation. If
 you devote the necessary time to educating yourself, you'll figure most
 of it out, and you can bring your tough questions to this list.

well to me this is a tough situation and i have spend _SEVERAL HOURS_ reading 
it. anyway thanks again - i figure my real problem is, as you mention yourself, 
in understanding apache before mod_perl.

allan



Need help with Apache::AuthDBI

2001-08-27 Thread Medi Montaseri



Hi, 

I am having problem getting Apache::AuthDBI working. It seems like its 
allowing user access anywaysie I have tried it with valid user and
invalid username, 
valid password and invalid password and in all cases it lets you
inhere is some supporting data 

I have the following Apache and mod_perl version... 

[Sun Aug 26 19:56:44 2001] [notice] Apache/1.3.12 (Unix)  (Red
Hat/Linux) mod_ssl/2.6.6
OpenSSL/0.9.5a mod_perl/1.24 configured -- resuming normal operations 
  

I also have the following virtual host definition in my httpd.conf. Note
I'm simply requiring a 
startup.pl file. 


Hi, 

I am having problem getting Apache::AuthDBI working. It seems like its 
allowing user access anywaysie I have tried it with valid user and
invalid username, 
valid password and invalid password and in all cases it lets you
inhere is some supporting data 

I have the following Apache and mod_perl version... 

[Sun Aug 26 19:56:44 2001] [notice] Apache/1.3.12 (Unix)  (Red
Hat/Linux) mod_ssl/2.6.6
OpenSSL/0.9.5a mod_perl/1.24 configured -- resuming normal operations 
  

I also have the following virtual host definition in my httpd.conf. Note
I'm simply requiring a 
startup.pl file. 

VirtualHost xx.xx.xx.xx 
ServerName www.joe.com 
ServerAdmin [EMAIL PROTECTED] 
DocumentRoot /web/joe 
ErrorLog /etc/httpd/logs/joe/error_log 
TransferLog /etc/httpd/logs/joe/access_log 
Directory /web/joe  
PerlRequire /web/joe/mod_perl/startup.pl 
Options Indexes Includes FollowSymLinks ExecCGI 
AddHandler cgi-script .cgi 
AllowOverride All 
/Directory 
ScriptAlias /cgi-bin/ /web/joe/cgi-bin/ 
/VirtualHost 

I also have a statup.pl file that reads 

#!/usr/bin/perl 
use Apache::DBI; 
use Apache::AuthDBI; 
use Carp; 

warn(in startup); 
$Apache::DBI::DEBUG = 2; 
$Apache::AuthDBI::DEBUG = 2; 

And finally I have a .htaccess that reads 


Hi, 

I am having problem getting Apache::AuthDBI working. It seems like its 
allowing user access anywaysie I have tried it with valid user and
invalid username, 
valid password and invalid password and in all cases it lets you
inhere is some supporting data 

I have the following Apache and mod_perl version... 

[Sun Aug 26 19:56:44 2001] [notice] Apache/1.3.12 (Unix)  (Red
Hat/Linux) mod_ssl/2.6.6
OpenSSL/0.9.5a mod_perl/1.24 configured -- resuming normal operations 
  

I also have the following virtual host definition in my httpd.conf. Note
I'm simply requiring a 
startup.pl file. 

VirtualHost xx.xx.xx.xx 
ServerName www.joe.com 
ServerAdmin [EMAIL PROTECTED] 
DocumentRoot /web/joe 
ErrorLog /etc/httpd/logs/joe/error_log 
TransferLog /etc/httpd/logs/joe/access_log 
Directory /web/joe  
PerlRequire /web/joe/mod_perl/startup.pl 
Options Indexes Includes FollowSymLinks ExecCGI 
AddHandler cgi-script .cgi 
AllowOverride All 
/Directory 
ScriptAlias /cgi-bin/ /web/joe/cgi-bin/ 
/VirtualHost 

I also have a statup.pl file that reads 

#!/usr/bin/perl 
use Apache::DBI; 
use Apache::AuthDBI; 
use Carp; 

warn(in startup); 
$Apache::DBI::DEBUG = 2; 
$Apache::AuthDBI::DEBUG = 2; 

And finally I have a .htaccess that reads 

AuthName DBI 
AuthType Basic 

PerlAuthenHandler Apache::AuthDBI::authen 
PerlAuthzHandler Apache::AuthDBI::authz 

PerlSetVar Auth_DBI_data_source  dbi:informix:joe@docware 
PerlSetVar Auth_DBI_username  
PerlSetVar Auth_DBI_password  
PerlSetVar Auth_DBI_pwd_table users 
PerlSetVar Auth_DBI_uid_field user_name 
PerlSetVar Auth_DBI_grp_whereclause  and user_passwd =
$ENV{REMOTE_PASSWD} 
PerlSetVar Auth_DBI_pwd_field user_passwd 
PerlSetVar Auth_DBI_grp_field user_name 

PerlSetVar Auth_DBI_encrypted off 
PerlSetVar Auth_DBI_uidcasesensitive  off 
PerlSetVar Auth_DBI_authoritative on 

require valid-user 

And the error log shows 

 31496 Apache::AuthDBI::authen passwd not found in cache 
== 
31496 Apache::AuthDBI::authz  request type = initial main 
31496 Apache::AuthDBI::authz  user sent = medi 
31496 Apache::AuthDBI::authz  requirements: valid-user=1 user=
group= 
31496 Apache::AuthDBI::authz  user_result = OK: valid-user 
31496 Apache::AuthDBI::authz  return OK 
  

I have followed step by step instructions of Apache::AuthDBI and I can not
get this thing to 
workperhaps I'm overlooking something 

From my understanding of Authentication and Authorization, it looks like
in spite of 
Auth_DBI_authoritative being set, the authorization (or authentication) is
not doing its job 
of rejectting and returning an OK 

Can someone help please... 

-- 
-
Medi Montaseri   [EMAIL PROTECTED]
Unix Distributed Systems EngineerHTTP://www.CyberShell.com
CyberShell Engineering
-




Re: URI::URL - problem in LWP 5.53_95 with mod_perl

2001-08-27 Thread Mike808

___cliff rayman___ wrote:
 i did not use CPAN.pm to install software on this particular
 machine.  my mod_perl builds are always by hand.
 
 i did understand exactly why this happened.  i should have made
 that more clear in my first e-mail.  i made the patch that i did, so
 i would not have the same problem with any other software.

You are correct. I interviewed the sysadmin that called me for help with this
building mod_perl, and he fessed up to FTP'ing into CPAN and just grabbing
the latest version - i.e. the 5.53_95 tarball. He didn't use CPAN.pm
after all.

I couldn't get CPAN.pm to fetch the dev tarball either. I just figured he
was too new to Perl and Solaris (a former MCSE) to grab a tarball and
install. Turns out, he was too new. He just didn't know about CPAN.pm!

Anyway, I missed your (Cliff's) one-line patch to LWP::UserAgent.pm and
thought it was the more extensive earlier patch. My vote is for Cliff's
patch to just 'use URI::URL;' in LWP::UserAgent.pm.

If you don't feel like patching, remember to export 
PERL_HTTP_URI_CLASS=URI::URL instead.

Mike808/
 
 Stas Bekman wrote:
  What version of CPAN.pm are you using? CPAN.pm never picks distros with
  '_' in the version part. I've just performed checking I've got
  5.53.tar.gz.

Then you shouldn't be having the missing URI::URL problem in mod_perl.
Or has the real 5.53 been fubar'd since April or so, and nobody noticed
until now?

Mike808/
-- 
perl -le $_='7284254074:0930970:H4012816';tr[0-][ BOPEN!SMUT];print



cvs commit: modperl-2.0/src/modules/perl modperl_bucket.c

2001-08-27 Thread dougm

dougm   01/08/27 10:14:48

  Modified:src/modules/perl modperl_bucket.c
  Log:
  adjust to bucket/sms changes
  
  Revision  ChangesPath
  1.6   +18 -11modperl-2.0/src/modules/perl/modperl_bucket.c
  
  Index: modperl_bucket.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_bucket.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- modperl_bucket.c  2001/08/21 16:46:56 1.5
  +++ modperl_bucket.c  2001/08/27 17:14:48 1.6
  @@ -9,6 +9,7 @@
   apr_bucket_refcount refcount;
   SV *sv;
   PerlInterpreter *perl;
  +apr_sms_t *sms;
   } modperl_bucket_sv_t;
   
   static apr_status_t
  @@ -44,14 +45,9 @@
   
   SvREFCNT_dec(svbucket-sv);
   
  -safefree(svbucket);
  +apr_sms_free(svbucket-sms, svbucket);
   }
   
  -static void modperl_bucket_sv_free(void *e)
  -{
  -Safefree(e);
  -}
  -
   static const apr_bucket_type_t modperl_bucket_sv_type = {
   mod_perl SV bucket, 4,
   modperl_bucket_sv_destroy,
  @@ -68,8 +64,11 @@
   {
   modperl_bucket_sv_t *svbucket; 
   
  -Newz(0, svbucket, 1, modperl_bucket_sv_t);
  +svbucket = (modperl_bucket_sv_t *)apr_sms_malloc(bucket-sms,
  + sizeof(*svbucket));
   
  +svbucket-sms = bucket-sms;
  +
   bucket = apr_bucket_shared_make(bucket, svbucket, offset, offset+len);
   
   /* XXX: need to deal with PerlInterpScope */
  @@ -79,7 +78,7 @@
   svbucket-sv = sv;
   
   if (!bucket) {
  -Safefree(svbucket);
  +apr_sms_free(svbucket-sms, svbucket);
   return NULL;
   }
   
  @@ -88,8 +87,6 @@
   MP_TRACE_f(MP_FUNC, sv=0x%lx, refcnt=%d\n,
  (unsigned long)sv, SvREFCNT(sv));
   
  -bucket-free = modperl_bucket_sv_free;
  -
   bucket-type = modperl_bucket_sv_type;
   
   return bucket;
  @@ -97,7 +94,17 @@
   
   apr_bucket *modperl_bucket_sv_create(pTHX_ SV *sv, int offset, int len)
   {
  -apr_bucket *bucket = (apr_bucket *)safemalloc(sizeof(*bucket));
  +apr_sms_t *sms;
  +apr_bucket *bucket;
  +
  +if (!apr_bucket_global_sms) {
  +apr_sms_std_create(apr_bucket_global_sms);
  +}
  +
  +sms = apr_bucket_global_sms;
  +bucket = (apr_bucket *)apr_sms_malloc(sms, sizeof(*bucket));
   APR_BUCKET_INIT(bucket);
  +bucket-sms = sms;
  +
   return modperl_bucket_sv_make(aTHX_ bucket, sv, offset, len);
   }