Re: apache fails to work with mod_perl .. (old PerlRequireconf/startup.pl + more info)

2000-10-14 Thread Roderick A. Anderson

On Sat, 14 Oct 2000 [EMAIL PROTECTED] wrote:

 I have been chasing down the same problem on RH7. So far I have
 found that I _can_ build it if I use the perl binary that comes
 with RH7. So I am hunting down differences between the RH7 build of perl
 and a stock build. (RedHat did NOT build perl on this kernel?!!)
 Will update when I get a good total build from source.

I'm hoping you don't monitor some of the list is do so this isn't a - I'm
already aware - idea.  As I usnderstand it RHL 7.0 shipped with some
experimental libraries and an experimental version of the c compiler
instead of the stable vesion.
   Could this be some of the problem?

 Rant RedHat really sux sometimes.  /Rant

I concure.  This is why I'm not touching the 7.0 release.  Had big plans
but then the bug reports started appearing.  Heck last 'update' I did on
my home system was from 5.2 to 6.1 ... after 6.2 was out!  Didn't do any
6.x stuff at work until 6.1 was out. :-)


Good luck,
Rod
--
Roderick A. Anderson
[EMAIL PROTECTED]   Altoplanos Information Systems, Inc.
Voice: 208.765.6149212 S. 11th Street, Suite 5
FAX: 208.664.5299  Coeur d'Alene, ID 83814




newbie needin help

2000-10-14 Thread jason

Hey folks,

I have apache_1.3.12 running on freebsd 4.1 and I have an application
that I want to run with mod_perl. Ususally I take the easy way out and
run my perl cgi's with speedycgi. I believe it operates (or I may be
totally wrong) in the same fashion as mod_perl except that its a lot
easier to implement. Anyway, the script im trying to use is web-ftp
(www.web-ftp.org) and of course because it relies on perl a lot, its
horribly slow. I want to try to get it to work with mod_perl and have
read through the http://perl.apache.org/tuning/ but am still not sure
what the basic commands I need in my httpd.conf are. It looks like I
need a separate directory to store cgi's that I want to run mod_perl'd
but im not sure. 

What I have gathered is that I need to 
1. put this in my httpd.conf
 # put mod_perl programs here
 # startup.perl loads all functions that we want to use within mod_perl
 Perlrequire /usr/local/apache/perl/startup.perl
 Directory /usr/local/apahce/cgi-bin/webftp
   AllowOverride None
   Options ExecCGI
   SetHandler perl-script
   PerlHandler Apache::Registry
   PerlSendHeader On
 /Directory

2. then create a file called startup.perl in /usr/local/apache/perl/

I assume this is the startup.perl file

 #! /usr/local/bin/perl
 use strict;
 
 # load up necessary perl function modules to be able to call from
Perl-SSI
 # files.  These objects are reloaded upon server restart (SIGHUP or
SIGUSR1)
 # if PerlFreshRestart is "On" in httpd.conf (as of mod_perl 1.03).
 
 # only library-type routines should go in this directory.
 
 use lib "/usr/local/apache/perl";
 
 # make sure we are in a sane environment.
 $ENV{GATEWAY_INTERFACE} =~ /^CGI-Perl/ or die "GATEWAY_INTERFACE not
Perl!";
 
 use Apache::Registry ();   # for things in the "/programs" URL
 
 # pull in things we will use in most requests so it is read and
compiled
 # exactly once
 use CGI (); CGI-compile(':all');
 use CGI::Carp ();
 use DBI ();
 use DBD::mysql ();

 1;


and is this it? do I have to modify my webftp.cgi program in any way?

regards,
Jason



undefined subroutine.....called at /dev/null line 21

2000-10-14 Thread Christopher Lee

Hi,

Im running apache1.3.12/modperl1.24 (static compiled) on redhat6 and I'm 
getting some strange errors like above, I also get:

-
Database handler destroyed withouth explicit disconnect at /dev/null line 21
-

and I get both errors without the /dev/null bit on the end!

I'm sure this bug is in my perl code, but (you saw that coming, right? :) 
 I only get this bug either

1. on every other restart of httpd, sometimes depending on the first url
   requested

or 2. every other request to the same url

or 3. for the first X calls to the server then every other request!

all three server_errors occur with the same code, which confuses me 
more than the /dev/null error. I'm thinking this is a config error, but I have
no idea why...

The config and code...(abridged version, the full version can be 
temporarily found at http://compsoc.net/~chris/modperl.html if necessary)


ServerType standalone
ServerRoot "/usr/local/apache"
Timeout 30
KeepAlive Off
MaxKeepAliveRequests 100
KeepAliveTimeout 15
MinSpareServers 1
MaxSpareServers 20
StartServers 1
MaxClients 40
MaxRequestsPerChild 100
PerlRequire conf/BV.pl
Location /b   
SetHandler perl-script
perlhandler BV
/Location
Location /login
SetHandler perl-script
perlhandler BV::Login
/Location
Location /loginscreen
SetHandler perl-script
perlhandler BV::LoginScreen
/Location
DocumentRoot /home/chris/system/public_html

--
package BV;

use Apache::Constants qw/:common/;
use BV::Config;
use BV::Common;
use DBI;
use strict;
use vars qw($BV_CONF);

sub handler {
my $r=shift;

if (!$r) 
{
Apache-error("undefined request passed to BV::handler");
return OK;
}

my $V=bless {r=$r},"BV";
my @args;

($V-{Location}, $V-{Handler}, $V-{Username}, $V-{UrlSession}, $V-{Command},@args) 
= split(m(/),$r-path_info);

$V-{args}=\@args;

if($V-{Handler} eq "kill")
{
$V-kill_login($V-{UrlSession});
return OK;
}


$V-{UrlPrefix}=$BV_CONF-{DomainName}.
$BV_CONF-{Location}.
$BV_CONF-{Handler};
$V-{UrlPrefix}.=$V-{Username};


$V-{ip}=$r-connection-remote_ip;
$V-{Session}=check_cookie($V-{r});

($V-{dbh}=DBI-connect($BV_CONF-{DatabaseName},$BV_CONF-{DatabaseUser},$BV_CONF-{DatabasePass}))
 or return undef;

if(!defined($V-{Session})) 
{
$V-{Session}=$V-{UrlSession};
$V-{UrlPrefix}=$V-{Session};
}

else {$V-{UrlPrefix}.="x"; }

if($V-{Command} eq "session") 
{return redirect($V-{r},"$V-{UrlPrefix}"."/top"); }


dont_cache($r,"text/html");
$V-{r}-print("test test test");
$V-{dbh}-disconnect;
return OK;
}

sub kill_login{
my ($V,$s) = @_;
my $u=$V-{Username};
my $dbh;
if(!($dbh=DBI-connect($BV_CONF-{DatabaseName},$BV_CONF-{DatabaseUser},$BV_CONF-{DatabasePass})))
{
Log("No handle in kill_login");
return undef;
}

$dbh-do("DELETE FROM sessions WHERE username='$u' AND session_id='$s'");
Log("DELETE FROM sessions WHERE username=$u AND session_id=$s");
$dbh-disconnect;
redirect($V-{r},"$BV_CONF-{DomainName}$BV_CONF-{LoginScreenUrl}");
}

1;


There is more but I'll spare you the download just in case...

please help.I'm going mad...
--

Christopher Lee.

http://compsoc.net/~chris




Re: can't build with 1.3.14 apache?

2000-10-14 Thread Rick Myers

On Oct 14, 2000 at 12:06:29 -0700, [EMAIL PROTECTED] twiddled the keys to 
say:

 Try the patch to apache-1.3.14/src/include/httpd.h below. Worked for me. 

I had the same problem last night. As it turned out, the current cvs
modperl version fixed it. (Hint: It's in Makefile.PL)

Hello again bleeding edge. :)

Rick Myers[EMAIL PROTECTED]

The Feynman Problem   1) Write down the problem.
Solving Algorithm 2) Think real hard.
  3) Write down the answer.



Re: PerlLogHandler not being run ?

2000-10-14 Thread Patrick

On Sat, Sep 30, 2000 at 07:47:06PM +0200, Patrick took time to write:
 I've put :
 PerlLogHandler My::Handler
 in apache's httpd.conf
 but it is not runned by Apache !

(answering to myself)
For everyone insterested, here is my solution : I don't understand
the problem, but using a -push_handler() in my TransHandler to set up
my PerlLogHandler works.

That's very strange. At least it works, but I really don't know why
Apache didn't like my PerlLogHandler directive.

Regards,

-- 
Patrick.
``C'est un monde qui n'a pas les moyens de ne plus avoir mal.''