Re: Touble getting apache going...

2001-09-11 Thread Remco Schaar


sorry, forgot the list...

On Tue, 11 Sep 01:54 Tim J Spriggs wrote:
 I am running Debian Linux(Woody) and installed apache-perl and all of the
 supporting libraries. Whenever Apache is run I get the error message:
 
 
 ---
 [Mon Sep 10 16:50:03 2001] [error] Can't locate Apache.pm in @INC (@INC
 contains: /usr/local/lib/perl/5.6.1 /usr/local/share/perl/5.6.1
 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.6.1 /usr/share/perl/5.6.1
 /usr/local/lib/site_perl /usr/lib/perl5/5.6 /usr/lib/perl5/5.005 .
 /etc/apache/ /etc/apache/lib/perl) at (eval 1) line 3.
 ---

This is a Debian bug. There are allready several bugs reported (you might
want to check http://bugs.debian.org/libapache-mod-perl). This is the
result of Debian testing/unstable distribution transition from perl-5.6.0
to perl-5.6.1.

The file you are looking for is still in /usr/lib/perl/5.6.0, while
/usr/lib/perl/5.6.1 is in your path. There are two quite easy solutions:
- Add /usr/lib/perl/5.6.0 to your path, or (TMTOWTDI)
- Create symlinks from /usr/lib/perl/5.6.1/Apache.pm to
/usr/lib/perl/5.6.0/Apache.pm, and all mod_perl stuff etc...

Of course some things might break, but I only ran into trouble using the
XML::Parser (still have to report/test that one, tough). Don't forget about
your solution when the package is upgraded...

 If I goto the /usr/share/perl/5.6.1/CGI where Apache.pm is located and
 try to start apache it simply says apache cannot be started and in the
 logfile it says:

If you read the file yourself, you notice this is some CGI::Apache
backward-compatible file of some sort... the Apache.pm you need is in one
of the above mentioned directory.

 ---
 Apache.pm failed to load!.
 ---
 
 Thank you in advance for any help given.
 
 -Tim([EMAIL PROTECTED])

Bye, 
Remco





Re: Another Perl/Apache question

2001-08-30 Thread Remco Schaar

On Wed, 29 Aug 2001, Mathew Benson wrote:

Hi,

   I know you helped me before, but I had to rebuild my server and now I'm 
 having the same problem as before.  I changed my ServerName directive to the 
 correct IP address (I don't have a DNS name).  These are the only other 
 changes I made to httpd.conf:
 
 # FOR MOD_PERL:
 PerlModule Apache::Registry
 KeepAlive Off
 
 Alias /dm/ /var/www/html/dm/
 Location /dm
 SetHandler perl-script
 PerlHandler Apache::Registry
 Options ExecCGI
 allow from all
 PerlSendHeader On
 /Location
 
 Redirect /demarc http://10.1.6.42/dm/demarc

Looks quite sound to me...

   I originally tried making the changes you suggested before, but that 
 didn't do anything. The source code still came straight through.

Which source code shows up? Your DirectoryIndex script, or another
file? (I suppose a perl-source, not the html-source, otherwise you need
to check mime-types)

   I know  the perl script works, because I can run it from the
 console. After playing with things I was able to get the browser to sit
 there for a few seconds, and display a server error message.

According to their documentation I skimmed, using mod_perl is
optional. Perhaps you might want to run it on plain mod_cgi to test it all
out? Once it runs through the web, then throw in mod_perl again.

What modifications did you made, what were the resulting http-errors, and
what was the error.log telling you when you were playing around?

   I've since learned that the documentation from the www.demarc.org site on 
 installing the software is lacking and very problematic.  One change I had 
 to make was to the base html directory.  Their instructions say that it 
 would be /usr/local/www/, but on my machine it was /var/www/html/.

You could try a grep on their code to check for the /local/www/ path, they
could have some nasty hard-coded ones (they probably won't be the
first)...

   The strangest thing is when I tried to hit http://10.1.6.42/demarc, I got 
 a bunch of pop ups saying something about the server sending a certificate.  
 I was browsing the page from my Linux box and the text is very small and 
 hard to read, so I just kept clicking Ok and Next.  It finally redirected to 
 http://10.1.6.42/dm/demarc, but wound up with the same server error.  I 
 didn't setup https, so I don't understand why it would have sent the browser 
 a certificate.

What is the result when you requested the document directly (like with
telnet or a lwp-request). This should turn out to be a redirect
response. Try every followiung request manually in the same, since
brwosers might do _lot's_ of things you hardly notice.

   Any help would be much appreciated.  I'm helping somebody else install the 
 same software, so I imagine he's going to run into same problem and I'd like 
 to be able help him through it.

Bye,
Remco


P.S: Please use the mod_perl maillinglist as addressee or at least as
CC, since more people will read it and can be able to help you solve
your problem, thus including more expertism. This might lead to faster /
better help.









Re: Perl/Apache question

2001-08-26 Thread Remco Schaar

On Sun, 26 Aug 2001, Mathew Benson wrote:

Hi,

   I sincerely appologize if this question is in the wrong mailing list.  But 
 I'm not really sure where it belongs.
   I installed Demarc and Snort.  Demarc is a Perl script, which does work 
 when executed from the console.  But when hit from the web, it just returns 
 the source code.  How do I configure Apache so it executes the Perl script 
 instead of sending the contents of the script?

You probably misconfigured. What you might need is to add a handler to run
this script. The easiest way will be something like:
AddHandler perl-script .pl
PerlHandler +Apache::Registry
or some modification hereof. You may need more, depending on your
current configuration. Check the guide:
http://perl.apache.org/guide
for all information you need.

Bye,
Remco




Re: Perl/Apache question

2001-08-26 Thread Remco Schaar

On Sun, 26 Aug 2001, Ged Haywood wrote:

 Hi there,

hi,

 On Sun, 26 Aug 2001, Remco Schaar wrote:
 
  On Sun, 26 Aug 2001, Mathew Benson wrote:
  
 I sincerely appologize if this question is in the wrong mailing list.
 But I'm not really sure where it belongs.
 I installed Demarc and Snort.  [snip]
  
  You probably misconfigured. What you might need is to add a handler to run
  this script. The easiest way will be something like:
  AddHandler perl-script .pl
  PerlHandler +Apache::Registry
  or some modification hereof. You may need more, depending on your
  current configuration. Check the guide:
  http://perl.apache.org/guide
 
 This of course assumes Mr. Benson is using mod_perl.
 
 Is he?

Oh, you're right... But testing that is in the guide as well :-)

 73,
 Ged.

Bye,
remco




Re: How do I STOP Apache::CodeRed sending me messages

2001-08-19 Thread Remco Schaar

On Sun, 19 Aug 2001, Robert wrote:

Hi,

 I configured Apache::CodeRed to send me messages with each email and so on -
 
 How do I stop it from doikn that? I changed the CodeRed.pm file, but it's
 being ignored?

Have you reloaded the code ? Since it is a module it will not be reloaded
until your apache restarts/reloads, unless you used Apachje::Reload for
this...

Otherwise, use procmail :-)

 Thanks
 Robert

Bye,
Remco




Re: How do I really get the URI requested by the browser?

2001-08-18 Thread Remco Schaar

On Sat, 18 Aug 2001, Joachim Zobel wrote:

 Hi.

Hi,

 I want to get the URI requested by the browser just as $REQUST_URI gives it 
 to me inside a content handler. This is needed in other handlers, so I can 
 not use %ENV. I am also not shure, when subprocess_env is initialized.
 
 Unfortunaltely $r-uri() does not return the URI requested by the browser 
 if I do a sequence of rewrites and subrequests as I do, so I can not use it.
 
 So how do I get it?

Perhaps the

   $r-the_request
   The request line sent by the client, handy for
   logging, etc.

can be usefull, but you might have to parse a little bit to retrieve only
the uri...

 Thanx,
 Joachim
 --
 ... ein Geschlecht erfinderischer Zwerge, die fuer alles gemietet werden
 koennen.- Bertolt Brecht - Leben des Galilei
 

bye,
remco




Re: Problem with use getting the wrong file

2001-08-16 Thread Remco Schaar

On Thu, 16 Aug 2001, Philip Mak wrote:

Hi,

 I have two mod_perl programs on my site. One is in the directory inr2,
 and the other is in the directory otherinr2.
 
 These mod_perl programs have exactly the same code. Both of them do:
 use cfg;
 
 where cfg.pm is a file that's in both inr2 and otherinr2, but it's
 different in these directories.
 
 But the code in otherinr2 is getting the cfg.pm from inr2 since they
 have the same filename and relative paths. How can I make the use
 command not act braindead about this? Is there a CPAN module that I can
 import to overload the use command with something that takes the full
 pathname into account perhaps?

try a
do 'cfg.pm';
to force the compile

otherwise you might want to take a look at Apache::Reload on CPAN.

remco




Re: Problems running modperl under apache

2001-08-06 Thread Remco Schaar

On Mon, 6 Aug 2001, Mark Vazquez wrote:

Hi,

 Recently i transfered over my company's existing websiste from winnt 4
 server with iis 4 to redhat 7.0 with apache 1.3.12/mod_perl 1.24.  The
 majority of the site is done in perl and there are perl scripts in almost
 every directory. But apache cant seem to run them, my main site page is a
 perl file (index.pl) and it just gives me an ok error saying that there
 could be misconfiguration error.  Besides having to go into the perl scrips
 themselves and editing them,  is there anything that im missing?Btw... the
 perl scripts make references to sub routines located in a .lib file that
 placed in to my /usr/local/lib/perl5/site_perl diretory, but mod_perl still
 gives me errors saying that the subroutines are undefined. I have mod_perl
 configured this way:
 
 ifModule mod_perl.c
 Directory /var/www
SetHandler perl-script

This will set mod_perl to handle all requests within the dir... AFAIK
this disables your DirectoryIndex directive. You probably want the
AddHandler perl-script .pl
to handle all .pl files instead, with a DirectoryIndex index.pl in front.

See:
http://httpd.apache.org/docs/mod/mod_mime.html#addhandler

PerlHandler Apache::Registry
PerlSendHeader On
Options +ExecCGI
 /Directory
 
 Alias /cgi-bin /var/www/cgi-bin
 Location /cgi-bin
SetHandler perl-script

idem dito

PerlHandler Apache::Registry
PerlSendHeader On
Options +ExecCGI
 /Location
 
 Files *.pl
SetHandler perl-script

and one more :-)

PerlHandler Apache::Registry
 ###   PerlSendHeader On  --this doesnt work under the Files directive i
 guess

I thought this would just work...

Options +ExecCGI
 /Files
 

Hope this helps,
Remco




Re: PHP4 causes DBI connections to fail silently in mod_perl

2001-05-07 Thread Remco Schaar

On Sun, 6 May 2001, Matt Sergeant wrote:

Hi everyone,

 On Sun, 6 May 2001, Rodney Broom wrote:

  Hi all,
 
 I may be wrong, but isn't this the issue where you have to compile PHP4
 *without* the MySQL libraries. MySQL still works from PHP4, provided you
 have the MySQL libs on your machine somewhere else.
 
 I think there's an FAQ about this on the PHP4 site.

AFAIK: there is a warning in the configure-script of php4 as well. It 
tells you to use your local mysql-includes when using other modules, like
mod_perl...

Greetings,
Remco Schaar




Re: [OT] writing code (was: Apache growing (memory))

2001-04-25 Thread Remco Schaar

On Wed, 25 Apr 2001, G.W. Haywood wrote:

 Hi all,

Hi again,
 
 On Wed, 25 Apr 2001, Remco Schaar wrote:
 
  It is very hard to write perfect code,
 
 True, but it's not hard to write code that doesn't leak memory.
 
 void *p = NULL;
 ...
 ...
 if( p ) { exit(POINTER_ERROR); }
 void *p = malloc(n);
 ...
 ...
 free( p );
 p = NULL;
 ...
 ...

Of course I did not refer to hello world, but more complex program that
generate new code which is executed etc... I was not even thinking about
starting a discussion or flame war about code correctness :-)

 By which I mean that I use a certain set of pointers for memory
 allocation and nothing else.  The pointers are declared and
 initialized to NULL in the same statement.  Whenever I free some
 memory I set the pointer which was used to point to it back to NULL.
 Whenever I use a pointer for memory I first check that its value is
 NULL.  Then if I try to use it when it's already being used for
 something else my program tells me in a fairly unceremonious fashion.

Ok, but this requires all programmers to write clean and _consequent_ 
code, with all proper checks and a well-thought design 
and... and... and... Theory is great, but in practice, this seems to
happen only with small groups/projects and then even rarely (all
software-enginering literature will confirm this, sadly). Certainly with
continuous running programs (as apache/mod_perl), even the smallest
mistake or misplacement in freeing memory (or not-freeing on purpose) will
cause growth of memory consumption per request.

 This is one of a number of defensive techniques I've developed over
 the years.  It's better to wrap this kind of stuff in a library of
 defensive memory management routines (I expect you can buy one:) as
 there's less room for errors and it saves a lot of typing.
 
 Just my $0.02.

Go, and tell those guys in redmond... please :-)))

 Geoff, I expect this will turn out to be one of those threads...

No intensions !-)

 73,
 Ged.

Bye,
Remco






Re: Apache growing (memory)

2001-04-25 Thread Remco Schaar

On 25 Apr 2001, Joe Schaefer wrote:

 Kurt George Gjerde [EMAIL PROTECTED] writes:

Hi,

 Even if your script were coded perfectly, it is still possible for this
 to happen in modperl.

 Personally, I would consider an average growth rate of only .5kB/hit 
 absolutely wonderful :)

As far I ever monitored memory usage, apache itself seems to leak some
memory itself as well...
This was when using apache 1.3.9 (debian/potato), and took up to a couple
hunderds of bytes every requests (thus growing a mem-page (4k) every dozen
or so requests per process) serving just static files. It is very hard to
write perfect code, and some work arounds or often the best 
solution... You can consider limiting MaxRequestPerChild in combination
with Apache::GTopLimit, or whatever limits the apache-docs, mod_perl guide
or CPAN modules propose.

Bye,
Remco