mod_perl and GD.pm segfault

2003-09-03 Thread Jason
Embedded Perl version v5.8.0 for Apache/1.3.27 (Unix) PHP/4.3.2 mod_perl/1.28 
mod_ssl/2.8.14 OpenSSL/0.9.6b

I am trying to use a simple script that will display an jpeg or png image using GD.pm 
(readily available from CPAN)

I am getting
[Wed Sep  3 10:41:37 2003] [notice] child pid 832 exit signal Segmentation fault (11)
This happens only when the script is loaded in mod_perl... In normal perl/apache it 
works without the segfault Any Ideas as to
why?

I have traced the segfault down to the line
print $img->png();

I have simplified my script to this, and it segfaults on the "img->png" command


#!/usr/bin/perl
use strict;
use GD;
my $img = GD::Image->new(11,12);
my $white = $img->colorAllocate(255,255,255);
my $black = $img->colorAllocate(0,0,0);
$img->rectangle(1,1,4,5,$black);
$| = 1;
print   "Content-type: image/png\n\n";
my $tmp = $img->png();
print $tmp;
exit;



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



authentication realms in http and https

2003-07-18 Thread Jason Fong
We recently upgraded our webserver from 
Apache 1.3.6 / modperl 1.19
to
Apache 1.3.27 / modperl 1.27

We use a .htaccess file in a directory to have a modperl script do
authentication for directory access (for downloading files, etc.).  It
also redirects the user from http to https if he does not come in
through https.

On our old server, the user would only see the browser's login box once
when he came in through http and was redirected to https.  On the new
server, however, the user has to login twice.  But if the user comes in
through https on the new server, there is only one login.

So my guess is that the new server is not treating an authentication
realm in http as the same as one in https.

So, my question is... Is this different treatment of the http/https
authentication realms something that changed in the newer version of
modperl (or possibly apache)?  Or is this something that can be changed
through configuration options?  (and also... is my analysis even
correct? :) )  Thanks!


-Jason Fong



How do I have a PerlAuthenHandler not popup the login box?

2003-07-17 Thread Jason Fong
I'm making a login system that uses a web form instead of the browser's
popup box to input the username/password.  My problem is that when I use
my authentication script as a PerlAuthenHandler in the .htaccess, it
insists on having the browser show the popup username/password box.  I
tried making a simple handler function that just returns OK, but I still
get the login box.

My guess is that using the PerlAuthenHandler automatically sends a
AUTH_REQUIRED to the browser so that the login box appears.

I found a solution to this by changing the PerlAuthenHandler to a
PerlAccessHandler.  Is this the correct way to avoid the login box?  Or
is there a way for a PerlAuthenHandler to not popup a login box?



Re: Apache::Cookie

2003-06-02 Thread Jason Galea
Have you consulted the documentation?

http://search.cpan.org/author/JIMW/libapreq-1.1/Cookie/Cookie.pm#value

cap wrote:
i have an application that uses CGI and sets the cookie values as a hashref.
im then attempting to retreive the values with Apache::Cookie with:
$cookies = Apache::Cookie->fetch;

$ccokies is a hashref so i should be able to get the individual values with:

$cookies->{uid};

right?  however, this doesn't appear to work.







Re: cookie setting/retieval

2003-04-01 Thread Jason Jolly
Enrico,

If I do migrate to Apache::SessionManager will this problem disappear?  I
started looking into the transformation and it appears as if it will be a
good bit of work to accomplish the entire cutover and I just want to make
for sure that it's not something I'd have to build into my app anyway.

The reason I ask is because I was having some trouble with the
configuration?  After putting the following into the httpd.conf file

## BEGIN CONFIGURATION

PerlRequire /usr/local/apache/conf/startup.pl
PerlWarnOn
PerlFreshRestart  On
PerlModule Apache::SessionManager
PerlTransHandler Apache::SessionManager
Alias /perl /usr/local/apache/cgi-bin


SetHandler  perl-script
PerlSendHeader  On
PerlHandler Apache::Registry
PerlSetVar SessionManagerTracking On
PerlSetVar SessionManagerExpire 120
PerlSetVar SessionManagerInactivity 900
PerlSetVar SessionManagerName SESSION_ID
PerlSetVar SessionManagerStore File
PerlSetVar SessionManagerStoreArgs "Directory => /tmp/sessions"
PerlSetVar SessionManagerDebug 0
Options ExecCGI
allow from all


and using the code

## BEGIN CODE
sub validate {
my $r=shift;
my $cgi=new CGI;

my $session = Apache::SessionManager::get_session($r);

if (($$session{logged_in} eq "Y")){
return $session;
}else{
print $cgi->redirect('http://' . $ENV{HTTP_HOST} .
'/perl/sess.cgi');
return $session;
}
}

I always get the error:

Can't locate object method "pnotes" via package "" at
/usr/local/lib/perl5/site_perl/5.8.0/Apache/SessionManager.pm line 202,
 line 28.


I'm sure I'm going about something wrong, but I seem to have hit a
roadblock.do I need to write my own handler for this?

thnx,

~j

- Original Message -
From: "Enrico Sorcinelli" <[EMAIL PROTECTED]>
To: "Jason Jolly" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, April 01, 2003 1:52 AM
Subject: Re: cookie setting/retieval


> On Mon, 31 Mar 2003 18:11:21 -0600
> "Jason Jolly" <[EMAIL PROTECTED]> wrote:
>
> > I'm currently in the process of writing a wrapper for a site using
Apache::Session and mod_perl.  I was having great success using the
following code to either validate a cookie which was already present or set
a new cookie if necessary:
>
> Hi Jason,
> don't reinvent the wheel! ;-)
> There's already an Apache::Session wrapper on CPAN called
Apache::SessionManager.
> Apache::SessionManager is a mod_perl module that helps session management
of a
> web application. It creates a session object and makes it available to all
> other handlers transparenlty. Also session expiration policies are
available.
>
> http://cpan.org/modules/by-module/Apache/Apache-SessionManager-0.04.tar.gz
>
> See perldoc Apache::SessionManager for more infos.
>
> by
>
> - Enrico
>


cookie setting/retieval

2003-03-31 Thread Jason Jolly



I'm currently in the process of writing a wrapper 
for a site using Apache::Session and mod_perl.  I was having great success 
using the following code to either validate a cookie which was already present 
or set a new cookie if necessary:
 
        my $r = 
Apache->request;    my $cookie = 
$r->header_in('Cookie');    my 
$cgi = new CGI;
 
    $cookie 
=~ s/SESSION_ID=(\w*)/$1/;
 
        # create the 
session from the cookie or create a new one
    my 
%session;    tie %session, 
'Apache::Session::File', $cookie, 
{    
Directory => 
'/tmp/sessions',    };
 
    my 
$session_cookie = 
"SESSION_ID=$session{_session_id};";    
$r->header_out("Set-Cookie" => $session_cookie);
 
Now...this works like a charm, passing the cookie 
and reading the sessionas long as all of the pages are on the same level of 
the tree...i.e. :
 
        http://www.yoursite.com/perl/hithere.cgi
        http://www.yoursite.com/perl/ilovecookies.cgi
    http://www.yoursite.com/perl/monkey.cgi
 
Howeveras soon as you move to anything below 
that:
 
    http://www.yoursite.com/perl/cookies/bananna.cgi
    http://www.yoursite.com/perl/cookies/arenolongercool.cgi
 
I receive the following error (from the 
error_log):
 
        "Died at 
/usr/local/lib/perl5/site_perl/5.8.0/Apache/Session/Generate/MD5.pm line 
40"
 
By using Mozilla's cookie manager I see that the 
path attribute of the cookie set in the browser is changed from:
 
    
"/perl/"
to:
    
        
"/perl/cookies/"
 
...but I can't seem to figure out why 
Apache::Session isn't using the combination of the SESSION_ID and the directory 
stated in the tie() (/tmp/sessions) to retrieve the cookie...the SESSION_ID 
hasn't changed?
 
Thnx much!
 
~j
 


Addition of directory to @INC variable via startup script/mod_perl

2003-03-24 Thread Jason Jolly



I currently have the following 
configuration in my httpd.conf file:
 
    PerlRequire 
/usr/local/apache/conf/startup.pl    Alias /perl/ 
/usr/local/apache/cgi-bin    PerlTaintCheck  
On    PerlWarn    
On    PerlFreshRestart On    
PerlTransHandler Apache::SessionManager    PerlFreshRestart 
On
 
        SetHandler  
perl-script    PerlSendHeader  On    
PerlHandler Apache::Registry    
Options 
ExecCGI    
 
And here are the contents of the startup.pl 
script:
 
    
#!/usr/bin/perl
 
    use strict;
 
    use lib 
qw(/usr/local/apache/require);    
    use 
Apache::Registry();    use CGI();    use 
CGI::Session();    use CGI::Carp();    use 
DBI();    use Net::LDAP();
 
    $ENV{MOD_PERL} or die 
"not running under mod_perl!";
 
    1;
 
When I stop/start the server and run a 
script with the following code:
 
    foreach $item (@INC) 
{    print ($item . 
"");    }
 
I only get the output:
 
    /usr/local/lib/perl5/5.8.0/sun4-solaris    
/usr/local/lib/perl5/5.8.0    
/usr/local/lib/perl5/site_perl/5.8.0/sun4-solaris    
/usr/local/lib/perl5/site_perl/5.8.0    
/usr/local/lib/perl5/site_perl    .
 
??  I can't seem to find any rhyme or 
reason why the directory "/usr/local/apache/require" isn't on the @INC 
array?
 
Any help is greatly 
appreciated.according to all documentation I can find this should actually 
work.  I'm hoping that I'm doing something terribly stupid :).
 
thnx,
 
~j

 


Re: [mp2] changing http:// to https: in TransHandler

2003-03-08 Thread Jason Galea
sorry if OT..

Hi Nick,

please tell me I'm wrong (I'll be a happy camper), but I thought that you 
couldn't use name virtual server for SSL.

Name server requires HTTP/1.1 which supplies a Host header so the server can 
tell which virtual server you want. With SSL this header is encrypted so 
apache can't read it to know which virtual server it's for.

Or does it work this way by defaulting to the first virtual server listening 
on port 443?

Or is Apache2 doing something funky to make this work?

..again, I really would like to be wrong about this. I host from home on ADSL 
and thought I'd have to pay for more IP's if I wanted to secure a section of 
my site.

J

Nick Tonkin wrote:
On Sat, 8 Mar 2003 [EMAIL PROTECTED] wrote:


Hi -

I'm not much of a mod_perl scripter (yet), but having been
totally defeated my mod_rewrite, I am trying to use mod_perl
to push clients into using https when accessing a particular
server (I am using named-based virtual hosting).
I want to do something like this (the real one will be
more complicated - but this is a baby test):
-in httpd.conf-

PerlTransHandler +MyApache::ForceSecure

-handler-

package MyApache::ForceSecure;
use strict;
use warnings;
use Apache::RequestRec ();
use Apache::Const -compile => qw(DECLINED);
sub handler
{
 my $r = shift;
 my $url = $r->url;
 if ($url =~ m{^http://bcbk}i) {
   $url =~ s/^http:/https:/i;
   $r->url ($url);
 }
 return Apache::DECLINED;
}
1;
Which is great, but there is *no* $r->url. I know there is a $r->uri, but
how can I get to the whole ball of wax: from http://...? I can't find
it in the docs.
Aloha => Beau;


Beau:

I _just_ went through this on my system. You would probably want to use
the following to change the URI as you wish:
my $uri = APR::URI->parse($r->pool, $r->construct_url);
$uri->scheme('https');
my $new_uri = $uri->unparse;
However, the overall strategy is probably not what you want, due to the
way SSL works. When a browser requests a secure connection, the SSL
connection (to the secure port) is established _before_ even the HTTP
connection. Thus it is impossible to change the scheme (http vs https)
once you have arrived at your server. The only way to do this with a Perl
handler is to generate a 302 external redirect.
mod_rewrite can be complicated, sure, but I do think it's the way to
go in this situation. You need:
- two sub-domains in DNS, let's say www.my_domain.com and secure.my_domain.com
- a sub-directory /secure in your webdocs root (or something else able to matched with 
a regex)
- the following in your httpd.conf:
Listen 80
Listen 443
NameVirtualHost 12.34.56.789:80
NameVirtualHost 12.34.56.789:443


ServerName   www.my_domain.com
RewriteEngine   on
RewriteCond  %{REQUEST_URI}  /secure/
RewriteRule  ^/(.*)$   https://secure.my_domain.com/$1 [R,L]




ServerName   secure.my_domain.com
RewriteEngine   on
RewriteCond  %{REQUEST_URI}  !/secure
RewriteRule  ^/(.*)$   http://www.my_domain.com/$1 [R,L]


This allows you to have relative links on all your pages. All links on
www.my_domain.com will point to http://www. on port 80, and all links on
secure.my_domain.com will point to https://secure. on port 443. The server
will simply rewrite and redirect all links that do not match either
/secure/ or !/secure.
Hope this helps,

- nick

PS If you have more than one domain needing to use https, you can put it
on an arbitrary port so long as you configure the server (not apache) to
listen on it, and then hard-code the port number in the mod_rewrite rule.



Re: mysql question

2003-01-23 Thread Jason Galea
you better duck dude.
"slightly" is "slightly" understating the off-topicness of your post..


Martin Moss wrote:

slightly off topic,
but is it possible to grant permissions to a user on multiple tables in one
sql statement in mysql?


From mysql.com:-


GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP
-> ON bankaccount.*
-> TO custom@localhost
-> IDENTIFIED BY 'stupid';

can I do this
ON bankaccount.*,user.*,customer.*

Marty








Re: Apache 2?

2002-11-30 Thread Jason Czerak (Jasnik)
On Tue, 2002-11-26 at 05:15, Philip Mak wrote:

Is the 'front end' and 'back end' apache servers on the 'same box'?
My problme is that I had one web server. and I did the FE and BE bit (BE
being on the loop back address). to free up some major resources since
mod_perl apache gets huges. I didn't need 20meg process serving up 2K
images :) and had about 20 to 30 smaller apache process doing the
'static' content serving.

I'm currently running Apache2 in a development enviroment. Going to be
upgradeing my web servers with 2.0. Most sites will work nicly.  

I have found that the memory resource problem doesn't excist with 2.0
when you compile with 'worker' or fully threaded.  I'm running 2
processes of apache and each of htem have like 20 threaded. performce
seems good with just running one apache server.  didn't do any real load
testing, but I'm sure 2.0 is going to blow 1.3.x away.

--
Jason



> These days, Apache 2 has become the default version of Apache.
> 
> On my site, I run a front end Apache and a back end Apache.
> 
> Front end: Apache 1.x, has mod_accel module which is like mod_proxy,
> but downloads all the data from the backend ASAP and frees it up
> immediately, so that a slow modem doesn't tie up the backend
> 
> Back end: Apache 1.x with mod_perl
> 
> Here's my question:
> 
> Is it worth upgrading to Apache 2.x for either the front end or back
> end? And does Apache 2.x's mod_proxy free up the backend ASAP now?
> 




win32 mod_perl 1 and perl 5.8

2002-11-05 Thread Jason Nicholls
G'day,

ATM we're working on a win32 platform with apache 1.3.27, Perl 5.6, and 
mod_perl 1.27_01. I was reading the OS specific documentation at:

http://perl.apache.org/docs/1.0/os/win32/multithread.html

and discovered that with this particular setup mod_perl is effectively single
threaded. The page above doesn't actually explain why but I'm assuming it's
because of threading issues with Perl 5.6?

Does anyone know if mod_perl for win32 will be updated to work with Perl 5.8
and whether this will fix the single threaded problem mentioned above?


Thanks,

Jason Nicholls
----
Jason Nichollsicq: 11745841email: <[EMAIL PROTECTED]>
http://jason.mindsocket.com.au/mobile: 0417 410 811

   pgp/gpg id: 0xC3844959  
  fingerprint: 7F7A 5846 4E94 459C 104D  A979 7079 24CF C384 4959



Re: mod_perl2: apache.pm vs apache2.pm (CGI.pm)

2002-11-01 Thread Jason Czerak
On Fri, 2002-11-01 at 17:54, [EMAIL PROTECTED] wrote:

First, make sure you have the latest version of CGI.pm from CPAN. It has
fixes in there to automatically load Apache::Compat for you. Also CGI.pm
isn't fully mod_perl2 compatable. so there is that over head
unfortunally. Right now for me, I'll deal with the extra overhead, and
with time Everything will be mod_perl2.0 aware.

DBI.pm, CGI.pm, and Text::Templates would be great if they were to port
them to work on mod_perl2 ASAP :)

--
Jason Czerak




> I've mod_perl running on several machines (apache 1.x) Today I
> installed a new system with apache2 and ran into deep troubles and
> questions:
> 
> I installed perl-5.8.0, apache 2.0.43 and mod_perl 1.99_07
> 
> I preload Apache2 and use ModPerl::Registry:
> 
> LoadModule perl_module modules/mod_perl.so
> PerlModule Apache2
> and for my perl-files:
> PerlResponseHandler ModPerl::Registry
> 
> As soon as I try to run a script under mod_perl that uses CGI.pm I get
> the problem:
> 
> [Fri Nov 01 23:27:43 2002] [error] 9558: ModPerl::Registry: Can't locate Apache.pm 
>in @INC (@INC contains: /usr/local/lib/perl5/site_perl/5.8.0/i686-linux/Apache2 
>/usr/local/lib/perl5/5.8.0/i686-linux /usr/local/lib/perl5/5.8.0 
>/usr/local/lib/perl5/site_perl/5.8.0/i686-linux /usr/local/lib/perl5/site_perl/5.8.0 
>/usr/local/lib/perl5/site_perl .) at /usr/local/lib/perl5/5.8.0/CGI.pm line 161.
> Compilation failed in require at /home/htdocs/perl/testgoldfisch.cgi line 4.
> BEGIN failed--compilation aborted at /home/htdocs/perl/testgoldfisch.cgi line 4.
> 
> Now I was starting to look around and in fact I have Apache.pm and
> Apache2.pm on my system. Apache.pm is not in @INC (its in
> /usr/local/lib/perl5/5.8.0/CGI/Apache.pm where it came from perl-insallation)
> In @INC I only have Apache2.pm, which comes from the mod_perl Installation.
> 
> Now I dont know whats going on. Maybe this both two modules have nothing in common 
>but a similar name.
> Shall I extend my @INC so that Apache.pm is in it (where is best place to change 
>@INC ?).
> 
> If I use the Compat-mode the problem vanishes. Is the CGI-module
> incompatible with mod_perl2 ? If yes, is there any alternative that
> can be used without need to rewrite all our libraries that rely on
> CGI.pm ?
> 
> thnx,
> peter
> 
> -- 
> mag. peter pilsl
> IT-Consulting
> tel: +43-699-1-3574035
> fax: +43-699-4-3574035
> [EMAIL PROTECTED]
> 




Re: Dynamlcally loading modules at run-time

2002-10-03 Thread Jason Galea


Hi Jochen,

I'd recommend having a read of this
http://perl.apache.org/docs/1.0/guide/performance.html#Sharing_Memory

Not sure how much it applies to your situation, but basically, unless the 
different modules are very large and rarely used you really want to load them 
all at server startup. That way your server processes will be sharing the 
majority of your code and memory use will be optimised increasing the number 
of server processes you'll be able to run. Loading more modules after startup 
will increase the size of each process independantly, increasing your overall 
memory use.

cheers,

J

Jochen Lillich wrote:
> Hi,
> 
> I'm writing my first mod_perl handler. I'd like to make the handler some
> kind of dispatcher that dynamically loads certain modules depending on
> the URI called:
> 
> /foo/index => require foo; $result = foo::index();
> /foo/other => require foo; $result = foo::other();
> /bar/index => require bar; $result = bar::index();
> 
> I'd like to ask for your advice there. Is this a clever way to go in
> the first place? And how would i best code this concept? Or is there a
> better way to reach a modular structure in a big web application?
> 
> Best regards,
> 
>   Jochen
> 
> .
> 




Dual Apache setups

2002-09-08 Thread Jason Czerak

I'm messing around with apache 2.0 and modperl 1.99 and Haven't been
able to come across any docs that state that I would or would not need a
dual apache setup for high load sites.

I wish to have apache 2.0 threaded. 

currently my setup is Apache 1.3.26 with mod_ssl and mod_proxy and
mod_rewrite and all other unnecessary modules not compiled in. and for
dynamic requests, it proxys them to the back end as suggested by the
mod_perl guide, very please with this performance and memory usage. Was
wondering what is the statues of such a configuration with apache 2.x.x.

--
Jason Czerak






Re: PerlChildInitHandler doesn't work inside VirtualHost?

2002-08-10 Thread Jason W. May

(I found a better way to do what I wanted, avoiding PerlChildInitHandler 
completely, but still...)

My reason for wanting PerlChildInitHandler (and PerlChildExitHandler) 
inside VirtualHost is
to be able to keep these declarations close to the PerlHandlers that 
rely on them.  I like to
put my VirtualHost conf sections inside separate Include config files so 
that I can leave the
main httpd.conf fairly static.

If ChildInitHandler is not allowed inside VirtualHost, it should 
generate an exception when
the config file is parsed.  Instead, it silently ignores the declaration.

-Jason


Cees Hek wrote:

>Quoting Jason W May <[EMAIL PROTECTED]>:
>
>  
>
>>Running mod_perl 1.26 on Apache 1.3.24.
>>
>>I've found that if I place my PerlChildInitHandler inside a VirtualHost
>>block, it is never called.
>>
>>
>
>It doesn't really make sense to put a PerlChildInitHandler inside a VirtualHost
>directive.  It is only called when the Apache Child process is created, not when
>a new request comes in.
>
>If you explain what you are trying to accomplish, maybe we can recommend a
>better Handler to tie into.
>
>Cees
>  
>




PerlChildInitHandler doesn't work inside VirtualHost?

2002-08-08 Thread Jason W May


Running mod_perl 1.26 on Apache 1.3.24.

I've found that if I place my PerlChildInitHandler inside a VirtualHost
block, it is never called.

This works:

...

PerlModule  Foo
PerlChildInitHandlerFoo::handler



...
PerlHandler MyModule
...





but this doesn't:




PerlModule  Foo
PerlChildInitHandlerFoo::handler
...
PerlHandler MyModule




I don't see why VirtualHost would make a difference for child-init 
handlers.  What else could I be doing wrong?

Thanks,
-Jason





RE: Understanding why this "fixes" my perlaccess script

2002-07-04 Thread Jason Wilkes


Levon,

Thanks for the swift reply - but nope - no different.




 --- Levon Barker <[EMAIL PROTECTED]> wrote: > Not sure
but I would try changing the query:
> 
> my $sth = $dbh->prepare("
> SELECT id from session
> WHERE field = ?
> ");
> $sth->bind_param( 1, $SessionID );
> $sth->execute;
> 
> That might help.
>   
> 
> 
> -Original Message-
> From: Jason Wilkes [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, July 04, 2002 11:46 AM
> To: [EMAIL PROTECTED]
> Subject: Understanding why this "fixes" my
> perlaccess script
> 
> 
> Hi folks,
> 
> I use the following modperl script to control page
> access, based on a sessionid held in a cookie. A
> database is queried to get the user id from the db
> based on the cookie value. (No cookie, and your
> bounced to the logon screen).
> 
> So far so good, and all works well. Except for one
> user id (actually id=333), which causes an "internal
> server error". If I put print debugging lines in -
> everything works (even for user 333). If I take them
> out again all other users work fine except 333.
> Can anybody throw any light on this??
> 
> BTW: when the "internal server error" happens there
> is
> no log of it in the error_log - although the HTTP
> response code in access_log is 333 (which I don't
> think is a valid response code).
> 
> Any thoughts would be much appreciated.
> 
> The code is: -
> 
> package My::Package;
> 
> use strict;
> use Apache::Constants qw(:common);
> use CGI::Cookie;
> use DBI;
> 
> sub handler {
> 
> open (DBG, ">>/tmp/debug.txt"); # DEBUG LINE
> 
> my $r = shift;
> my %cookies =
> CGI::Cookie->parse($r->header_in('Cookie'));
> return (FORBIDDEN) unless $cookies{'SessionID'};
> 
> my $SessionID = $cookies{'SessionID'}->value;
> 
> ...
> stuff to set up the DBI connection
> ...
> 
> my $sth = $dbh->prepare("
> SELECT id from session
> WHERE field = '$SessionID'
> ");
> $sth->execute;
> my $answer = $sth->fetchrow;
> 
> print DBG "The id is $answer\n"; # DEBUG LINE
> 
> $sth->finish;
> $dbh->disconnect;
> 
> return (FORBIDDEN) unless $answer;
> 
> close (DBG);
> 
> }
> 
> 1;
> __END__
> 
> 
> 
> 
> 
> 
> 
> __
> Do You Yahoo!?
> Everything you'll ever need on one web page
> from News and Sport to Email and Music Charts
> http://uk.my.yahoo.com 

__
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com



Understanding why this "fixes" my perlaccess script

2002-07-04 Thread Jason Wilkes

Hi folks,

I use the following modperl script to control page
access, based on a sessionid held in a cookie. A
database is queried to get the user id from the db
based on the cookie value. (No cookie, and your
bounced to the logon screen).

So far so good, and all works well. Except for one
user id (actually id=333), which causes an "internal
server error". If I put print debugging lines in -
everything works (even for user 333). If I take them
out again all other users work fine except 333.
Can anybody throw any light on this??

BTW: when the "internal server error" happens there is
no log of it in the error_log - although the HTTP
response code in access_log is 333 (which I don't
think is a valid response code).

Any thoughts would be much appreciated.

The code is: -

package My::Package;

use strict;
use Apache::Constants qw(:common);
use CGI::Cookie;
use DBI;

sub handler {

open (DBG, ">>/tmp/debug.txt"); # DEBUG LINE

my $r = shift;
my %cookies =
CGI::Cookie->parse($r->header_in('Cookie'));
return (FORBIDDEN) unless $cookies{'SessionID'};

my $SessionID = $cookies{'SessionID'}->value;

...
stuff to set up the DBI connection
...

my $sth = $dbh->prepare("
SELECT id from session
WHERE field = '$SessionID'
");
$sth->execute;
my $answer = $sth->fetchrow;

print DBG "The id is $answer\n"; # DEBUG LINE

$sth->finish;
$dbh->disconnect;

return (FORBIDDEN) unless $answer;

close (DBG);

}

1;
__END__







__
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com



Re: Memory Leaks

2002-05-20 Thread Jason

If you don't want to restart the server then don't do this instead, it should help 
prevent small leaks from being a problem.
http://httpd.apache.org/docs-2.0/mod/mpm_common.html#maxrequestsperchild


- Original Message - 
From: "Per Einar Ellefsen" <[EMAIL PROTECTED]>
To: "Gregory Matthews" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, May 20, 2002 3:30 PM
Subject: Re: Memory Leaks


> At 23:23 20.05.2002, Gregory Matthews 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)?
> 
> And if something goes wrong? You'd be having a server offline with noone 
> knowing about it.
> 
> >At 05:12 PM 5/20/2002 -0400, you wrote:
> >
> >>Like another suggestion, we have a cluster of machines and roll the
> >>restarts every hour.  Each machine is offset but 10 minutes.
> >>
> >>Gregory Matthews writes:
> >> > I too thought of setting a cron job to restart the server once per day in
> >> > order to keep the memory "fresh".
> >> >
> >> > In a production environment, are there any downsides to doing this, i.e.,
> >> > server inaccessibility, etc..?
> >> >
> >> > Thanks.
> >> >
> >> > Gregory
> >> >
> >> > At 08:25 AM 5/20/2002 -0400, you wrote:
> >> >
> >> > >It is more an issue of it being worth tracking down a small memory
> >> > >leak vs a large memory leak.  Our software still has some very small
> >> > >leaks, on the order of 10kv every hour...  it would probably take us a
> >> > >month to track down and solve all these problems.  I find it easier to
> >> > >restart the web servers daily.
> >> > >
> >> > >We did have some enourmous leaks as well, based on circular reference,
> >> > >and those ate up 1 GB of memory in about 30 minutes...  It took us
> >> > >about three weeks to find it.
> >> > >
> >> > >Gregory Matthews writes:
> >> > > > So am I being overly paranoid concerning the "leak" potential of 
> >> mod_perl
> >> > > > programming?
> >> > > >
> >> > > > If I start with "strict" code to begin with and try my best to 
> >> stay away
> >> > > > from the problems you mentioned, then any potential memory leak/drain
> >> > > > issues will be avoided?
> >> > > >
> >> > > > Keep in mind, although my application is not designed to launch 
> >> the space
> >> > > > shuttle, I do want it to be solid/stable/peformance-packed from the
> >> > > ground up.
> >> > > >
> >> > > > I will be also be using MySql with the Apache::DBI module.
> >> > > >
> >> > > > Thanks in advance.
> >> > > >
> >> > > > Gregory
> >> > > >
> >> > > >
> >> > > > At 11:34 PM 5/19/2002 -0400, you wrote:
> >> > > > > > I have a couple of questions regarding leaking memory in mod_perl:
> >> > > > > >
> >> > > > > > 1.  What are the main culprits, in order of severity, of 
> >> memory leaks,
> >> > > > >i.e.:
> >> > > > > >
> >> > > > > > a.  global variables (NOT lexically scoped via my)
> >> > > > > > b.  ...
> >> > > > > > c.  ...
> >> > > > > >
> >> > > > > > 2.  When writing code from scratch (a new application), what 
> >> is the
> >> > > > >best
> >> > > > > > way to avoid creating leaks to begin with, i.e., use strict;, 
> >> PerlWarn
> >> > > > >On,
> >> > > > > > etc.. ?
> >> > > > >
> >> > > > >There are actually not very many ways you can leak memory in Perl 
> >> (and
> >> > > > >thus mod_perl).  Most people confuse memory growth with memory 
> >> leakage.
> >> > > > >If you want to know how to avoid memory growth, look at the 
> >> performance
> >> > > > >tuning stuff in the Guide, like passing references, avoiding 
> >> slurping of
> >> > > > >large files, controlling the buffering of DBI result sets, etc.
> >> > > > >
> >> > > > >Leaks are caused by circular references, the string form of eval (at
> >> > > > >least it used to leak a little), nested closures (sometimes created
> >> > > > >accidentally with the Error module), and one or two obscure syntax
> >> > > > >problems.  I think one of them involved code like "my $x = 7 if $y;".
> >> > > > >Matt Sergeant got bitten by this in the early stages of AxKit
> >> > > > >development, and the details are in the mailing list archive.
> >> > > > >
> >> > > > >Global variables by themselves are not a source of leaks or 
> >> growth.  If
> >> > > > >you slurp a large file into a global, your process will grow, but the
> >> > > > >same is true for a lexical.
> >> > > > >
> >> > > > >- Perrin
> >> > > >
> >> > > >
> >> > >
> >> > >--
> >> > >C Wayne Huling <[EMAIL PROTECTED]>
> >> >
> >> >
> >>
> >>--
> >>C Wayne Huling <[EMAIL PROTECTED]>
> >
> >
> 
> -- 
> Per Einar Ellefsen
> [EMAIL PROTECTED]
> 




Re: Moving from CGI to mod_perl

2002-05-14 Thread Jason

Probably the BIGGEST mod_perl pitfall is variable scoping/initialization.

I recommend that you try to

use strict;

whenever possible ESPECIALLY in mod_perl.

- Original Message - 
From: "Anton Permyakov" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, May 14, 2002 12:15 AM
Subject: Moving from CGI to mod_perl


> Hi, all.
> 
> I have perl CGI-script, and i wanna run it as mod_perl script.
> 
> Is it enought to correctly edit only httpd.conf, or i've to add something
> special in my CGI-script? Maybe something like
> 
> use Apache::Registry;
> 
> or something else
> 
> Also is it needed to write some special script like startup.pl or not?
> 
> Thank you all, and sorry for this "easy question"...
> In doc i could not find "How to migrate from CGI to mod_perl" - step by step
> easy example.
> 
> Good luck,
> Anton Permyakov.




Re: Can mod_perl help me use ENV variables in httpd.conf?

2002-05-05 Thread Jason Woodward

You'll also need to use a PerlPassEnv directive prior to your  block.

For debug purposes, try adding the following inside your  block:

print join("\n", map { "$_ => $ENV{$_}" } (keys %ENV)), "\n";

OR, my personal quick-debugging catch-all:

use Data::Dumper;
print Dumper \%ENV;

You'll be able to see what is available in %ENV when running under 
mod_perl.  See also Chapter 9, page 498 of the Eagle.

jason

Ken Williams wrote:
> 
> On Wednesday, May 1, 2002, at 05:04 AM, Fran Fabrizio wrote:
> 
>>
>> I spoke too soon.
>>
>> I need:
>>
>> 
>>   push @Alias, [ qw(/cgi-bin/chimpkit/ $ENV{SERVER_ROOT}/cgi-
>> bin/chimpkit/) ];
>> 
>>
>> This does not appear to be possible because there's no way to pass in 
>> SERVER_ROOT to the apache startup.
> 
> 
> I think the problem is your Perl syntax, not the value of the variable.  
> Scalars do not interpolate in qw() constructs.  Try this instead:
> 
> 
>   push @Alias, '/cgi-bin/chimpkit/', "$ENV{SERVER_ROOT}/cgi-
> bin/chimpkit/";
> 
> 
> or even
> 
> 
>   push @Alias, '/cgi-bin/chimpkit/',
>$r->server_root_relative . '/cgi-bin/chimpkit/';
> 
> 
>  -Ken
> 





Re: Restarting named service

2002-04-19 Thread Jason Bodnar

Take it a step further, if you're using BIND 9 you can use HMAC keys to secure it.

> Abd> How can i restart the named service via mod_perl.
>   Abd> The script will be activated via a web page.
> 
>   Abd> My apache is configured to use "User: apache, Group: apache"
> 
>   Abd> Is ther any other way except usine "User root" directive in my
>   Abd> httpd.conf file
> 
> Assuming you're running a somewhat modern version of BIND and you 
> make the ndc domain socket read/writable via the user/group Apache 
> is running as, you should be able to restart the daemon without root 
> privs.
> 
> Not that you still shouldn't be weary of doing something like that,
> though.
> 
> b.
> --
> /*  Bruno Connelly, <[EMAIL PROTECTED]>  */


--
Jason Bodnar
[EMAIL PROTECTED]
http://www.shakabuku.org




Re: mod_perl Basic Authentication problem using PerlAuthenHandler

2002-04-18 Thread Jason

Thank you... cant believe I missed that...  was to excited about the ability to do my 
own auth program
I added
allow from x.x.x.x

and it worked great

Thank you.

- Original Message - 
From: "Geoffrey Young" <[EMAIL PROTECTED]>
To: "Jason" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, April 17, 2002 6:21 PM
Subject: Re: mod_perl Basic Authentication problem using PerlAuthenHandler


> 
> 
> Jason wrote:
> 
> > In httpd.conf i have
> > 
> 
> 
> [snip]
> 
> 
> > Deny from all
> > 
> 
> 
> [snip]
> 
> 
> > 
> > It warns to the log file and returns But the problem is, why does my browser 
>come up "forbidden"
> 
> I suspect "Deny from all" is the issue...
> 
> the PerlAccessHandler will run before the apache default mod_access gets the 
> chance to implement the Deny rule.  on a successful login, your 
> PerlAccessHandler will return OK, which is then denied by mod_access, resulting 
> in a FORBIDDEN message.
> 
> unlike with the PerlAuthenHandler, which immediately terminates on the first OK, 
> the PerlAccessHandler will keep going in search of failure.
> 
>  > Has anybody gotten this to sucessfully work?
> 
> yes :)
> 
> you may be interested in chapter 13 of the cookbook, which should help clarify 
> things somewhat.
> 
> --Geoff




mod_perl Basic Authentication problem using PerlAuthenHandler

2002-04-17 Thread Jason

In httpd.conf i have

PerlAccessHandler ApacheAuthentication
PerlSetVar Intranet "65.103.229.188 => joe, 10.10.10.2 => userB"
PerlAuthenHandler ApacheAuthentication
AuthName realm
AuthType Basic
Require valid-user
Order deny,allow
Deny from all








And my module is
package ApacheAuthentication;
#use strict;
use Apache::Constants qw(:common);
use Apache::URI;
use Apache::File;

sub handler {
my $r = shift;
# get user's authentication credentials
my ($res, $sent_pw) = $r->get_basic_auth_pw;
return $res if $res != OK;
my $user = $r->connection->user;
# authenticate through DBI
my $reason = authen_dbi($r, $user, $sent_pw);
if ($reason) {
$r->note_basic_auth_failure;
$r->log_reason($reason, $r->uri);
return AUTH_REQUIRED;
}
warn "FINISHED $user $sent_pw";
return OK;
}






It warns to the log file and returns But the problem is, why does my browser come 
up "forbidden"

Has anybody gotten this to sucessfully work?
Server Version: Apache/1.3.22 (Unix) PHP/4.0.6 mod_perl/1.26 mod_ssl/2.8.5 
OpenSSL/0.9.6b 

Thanks in advance




Re: Weird mod_perl & CGI.pm interaction (Bug?)

2002-02-10 Thread Jason Czerak

On Sat, 2002-02-09 at 09:50, Mike McLagan wrote:

I asked this question before. I had the same problem on _one_ of my
machines but not any of the others. 

Is this perl 5.6.1 (or 5.6.0 even I dunno). And Do these perl
installs have threading enabled? are they self compiled.  if you said
YES to all of those or even some (most importantly the threading bit). 

Recompile without threading. and then try.

Keep in mind I tried several version of CGI.pm. Where the problem is
(and yes, I did hack CGI.pm and fixed it but felt it was unnessary to
hack CGI.pm since it wasn't at fault and didn't want to break other
working apps), e, the problem is in the read_from_client() call
where CGI.pm issues a read() from the STDIN file handle. The problem is
when it's called for the second time the handle reference is missing.

That is the jist of the details. I can get 100% informative if anyone
wishes to know.

--
Jason Czerak

> On Fri, 8 Feb 2002 17:02:20 + (GMT), Ged Haywood wrote:
> 
> >>My message is about data space.  The data space for the modules does not 
> >> seem to be recreated or reinitialized (BEGIN blocks are not rerun) from one 
> >> invocation of a script to another.
> >
> >Yes, this is well known to mod_perl users and it's in the Guide, in
> >the same chapter that I've already suggested that you read:
> >
> >=head1 BEGIN blocks 
> >
> >Perl executes C blocks as soon as possible, at the time of
> >compiling the code. The same is true under mod_perl. However, since
> >mod_perl normally only compiles scripts and modules once, either in
> >the parent server or once per-child, C blocks in that code will
> >only be run once.  As the C manpage explains, once a C
> >block has run, it is immediately undefined. In the mod_perl
> >environment, this means that C blocks will not be run during
> >the response to an incoming request unless that request happens to be
> >the one that causes the compilation of the code.
> 
> Broken behavior, defined or not, is still broken behavior.  Maybe it's
> up to the CGI.pm author to investigate what he has to do to work around
> this problem, but that's still a work around for broken behavior.
> 
> >If you are having trouble coping with mod_perl and CGI.pm perhaps it
> >would better if you tried different approach, Apache::Request for
> >example has some useful features.
> 
> Linux Online has been using mod_perl and CGI.pm for over 4 years now,
> I'm not about to change because I've tripped over this bug.  As my 
> original message said, I found a solution, albeit an unreasonable one.
> If Apache::Request was perl only, I might look into it since we only 
> use CGI.pm for it's query parsing abilities but with the need to drag
> along a C library, I'll pass.
> 
>Michael
> 
> 
> 
> 





Re: Weird mod_perl & CGI.pm interaction (Bug?)

2002-02-07 Thread Jason Czerak

On Thu, 2002-02-07 at 13:38, Ged Haywood wrote:
> Hi there,
> 
> On Thu, 7 Feb 2002, Mike McLagan wrote:
> 
> >I have two scripts, call them A and B.
> [snip]
> >$q = new CGI;
> [snip]
> > Inveriably, I end up with "B::show()" in my output, not at all what I wanted, 
> 
> Isn't this mentioned in the mod_perl Guide?
> 
> http://perl.apache.org/guide
> 
> 73,
> Ged.
> 
> 

As I mentioned ealier today. I asked the question. 'do you have threaded
support compiled into perl?'. If you do, this was the solution I needed
to fix the same problem that I have been having also.

--
Jason Czerak







Re: weird problem. Lost of the POST data (SOLUTION)

2002-02-07 Thread Jason Czerak

On Mon, 2002-02-04 at 11:12, Oscar Serrano wrote:
> Hi:
> some days ago I wrote to ask for this problem: The CGI.pm (sometimes) could
> not receive the POST data. I tried all you recomended me here in the list.
> But I still had the problem. Finally I decide to kick out CGI.pm and start
> to use the old cgi-lib.pl. But I still had the same problem. Then I turnet
> to Apache::Request, and since I use it, I've never had the same problem.
> I just tell you because perphaps somebody may have the same problem. I
> don't really understan if the problem is in mod_perl, in Apache, in Templat
> Toolkit, in my ultrasecure patched kernel, in CGI.pm, but the point is that
> Apache::Request seems not to loose any post data :-?
> 
> Thank you all.
> 
> Oscar Serrano.
> 
> 
> 

Did anyone of you guys by chacne compile PERL 5.6.1 with 'threading'.
Cuz I had the EXACT same porblem. The problem was 'fixable' in CGI.pm.

Look at the init() procedure. scroll down to line 453 where is calls
read_from_client() (version 2.79 but is in all versions of CGI.pm). Now
what I did was remove the reference to the STDIN filehandle and BINGO.
things worked fine. But I found that that was unacceptable to modify the
CGI.pm source. But that means reference handling was incorrect. I went
and put alot of debugging stuff in read_from_client() and confirmed that
the read() call was getting nothing returned becuase there wasn anything
in the file handle that was passed to it.

I 'thought' I had 2 exact matching systems. the one on the web server
(that was having this problem) and my workstation/dev box. My dev box
worked perfectly fine. 

At this point I was fed up with this and I started recompiling things.
:) started with perl. This time I just ran ./configure and held down the
"Enter" button (making sure I compiled libperl.so tho). remove the
current perl tree frm the system compleatly. installed it. reinstalled
all modules that I needed. That solved any problems. things run
perfectly now.

The only differnece is that I must of enabled multi-threading support
because there was that 'thread' directory tree present.

--
Jason Czerak





Re: mod_perl, OpenPGP & Math::Pari - Solved

2002-02-07 Thread Jason Galea


someone coulda told me to RTFM.. 8) then again I've read it before, so 
it probably wouldn't have helped, but just for those who have doubts...

PerlFreshRestart is BAD!!

but it's bad in a weird way cos it didn't affect my test server, but 
when I turned it off on the production server everything was good 
again... 8)

J


Jason Galea wrote:
> 
> 
> Ged Haywood wrote:
> 
>>
>> There's a file in the mod_perl directory called SUPPORT.  (That bit
>> about 'perl -V' was taken from there. :)  SUPPORT contains detailed
>> instructions about what to do when mod_perl crashes, including what
>> information to provide and how to generate a stack backtrace.
>>
>> 73,
>> Ged.
>>
> 
> yeh, read that... I guess I shoudn't have used the word "crashes" as 
> it's really "dies" when it tries to do a numeric comparison on an 
> alphanumeric string, which is entirely reasonable, so I'm not getting a 
> core dump, and I don't think mod_perl itself is at fault. I suspect the 
> implementation of GP/Pari as I ended up with the "worst case" as 
> mentioned in the Math::Pari install and manually copied (as instructed) 
> what I guess is a 'C' library file of some description (paricfg.h - I am 
> by no stretch a C programmer..) to the proper location. It all seemed to 
> work ok after that and as I had had troubles prior I already had my test 
> scripts which all ran fine so I thought Hooray! Then I implemented the 
> real system and got the errors mentioned.
> 
> What I still don't understand is why the test scripts run ok, but the 
> mod_perl implementation doesn't. (But on my dev server everything works 
> as it should..)
> 
> I'm going to reinstall GP/Pari on the production server using the 
> src.rpm I found on the Pari site, then if that goes ok I might be able 
> to install/update Math::Pari without errors, then maybe it'll all work.. 
> that's the plan anyway..
> 
> cheers,
> 
> 


-- 
J
Web Developer

Eight Degrees Off Centre
http://www.eightdegrees.com.au/




Re: mod_perl, OpenPGP & Math::Pari

2002-02-05 Thread Jason Galea



Ged Haywood wrote:

> 
> There's a file in the mod_perl directory called SUPPORT.  (That bit
> about 'perl -V' was taken from there. :)  SUPPORT contains detailed
> instructions about what to do when mod_perl crashes, including what
> information to provide and how to generate a stack backtrace.
> 
> 73,
> Ged.
> 

yeh, read that... I guess I shoudn't have used the word "crashes" as 
it's really "dies" when it tries to do a numeric comparison on an 
alphanumeric string, which is entirely reasonable, so I'm not getting a 
core dump, and I don't think mod_perl itself is at fault. I suspect the 
implementation of GP/Pari as I ended up with the "worst case" as 
mentioned in the Math::Pari install and manually copied (as instructed) 
what I guess is a 'C' library file of some description (paricfg.h - I am 
by no stretch a C programmer..) to the proper location. It all seemed to 
work ok after that and as I had had troubles prior I already had my test 
scripts which all ran fine so I thought Hooray! Then I implemented the 
real system and got the errors mentioned.

What I still don't understand is why the test scripts run ok, but the 
mod_perl implementation doesn't. (But on my dev server everything works 
as it should..)

I'm going to reinstall GP/Pari on the production server using the 
src.rpm I found on the Pari site, then if that goes ok I might be able 
to install/update Math::Pari without errors, then maybe it'll all work.. 
that's the plan anyway..

cheers,


-- 
J
Web Developer

Eight Degrees Off Centre
http://www.eightdegrees.com.au/




Re: mod_perl, OpenPGP & Math::Pari

2002-02-05 Thread Jason Galea


> [snip]
> 
> perl -V
> 
> That's lower case perl, upper case V.
> 
> [snip]

now that's funny!



ok, so I was babbling.. try this. A simple perl script useing 
Crypt::OpenPGP runs fine from the command line while the same subroutine 
used in a mod_perl module on the same machine crashes. Why? Its nothing 
to do with global variables, multiple runs, or random occurances.

I put a warn statement into Crypt::Primes to show the offending variable 
$B represented as 'B'. The only line I can find in Crypt::Primes that 
sets the value of $B is:
my $B = floor ( $c_opt * ( $k ** 2 ) );

'floor' is imported from Math::Pari which according to the docs does not 
use any enviromental variables.

Throughout the run from the commandline $B remains an everchanging 
integer, while during the mod_perl run it suddenly becomes something 
else (37e5156f in the example below) subsequently crashing the program 
when it is involved in a numeric comparison.

and, yeh, if no one else has any suggestions this time, I'll drop it.
Thanks, Tom, for the nudge I needed to get this far..

cheers,

J


run from the commandline (test_pgp_gen.pl):



my $attrib = {
Size  => '2048',
Identity  => 'PGP EzyDVD <[EMAIL PROTECTED]>',
Password  => 'a new passphrase for you',
};

my $self = {
EV_config => {
PGPKeyLoc => 'd_main/data/.pgptest',
},
};

# test Key Generation
($self) = pgp_keygen($self,$attrib);

exit;

sub pgp_keygen{
##
my ($self,$attrib) = @_;
my $file = time;
warn "Generating Keys";
use Crypt::OpenPGP;
warn "Creating Keychain";
my $keychain = Crypt::OpenPGP->new;
warn "Generating Keys with:\n\tType => 'RSA'\n\tSize => 
$attrib->{'Size'}\n\tIdentity => $attrib->{'Identity'}\n\tPassphrase => 
$attrib->{'Password'}";
 my ($public, $private) = $keychain->keygen (
   
   Type => 'RSA',
   
   Size  => $attrib->{'Size'},
   
   Identity  => $attrib->{'Identity'},
   
   Passphrase  => $attrib->{'Password'},
# 
   
   Verbosity => 1,
   
   ) or die $keychain->errstr();
warn "Generating complete. Saving..";

$public = $public->save;
open(PUBLIC,'>',"$$self{'EV_config'}{'PGPKeyLoc'}/$file".'.public');
print PUBLIC $public;
close(PUBLIC);

$private = $private->save;
open(PRIVATE,'>',"$$self{'EV_config'}{'PGPKeyLoc'}/$file".'.private');
print PRIVATE $private;
close(PRIVATE);
warn "Saving complete.";

return ($self);
}

[]$ perl test_pgp_gen.pl
Generating Keys at test_pgp_gen.pl line 29.
Creating Keychain at test_pgp_gen.pl line 31.
Generating Keys with:
 Type => 'RSA'
 Size => 2048
 Identity => PGP EzyDVD <[EMAIL PROTECTED]>
Passphrase => a new passphrase for you at test_pgp_gen.pl line 33.
B = 43, r = 0.5, k = 22, q = 5347 at 
/usr/lib/perl5/site_perl/5.6.1/Crypt/Primes.pm line 610.
B = 151, r = 0.506631180276321, k = 41, q = 2267129 at 
/usr/lib/perl5/site_perl/5.6.1/Crypt/Primes.pm line 610.
B = 506, r = 0.53037992595081, k = 75, q = 2196811726937 at 
/usr/lib/perl5/site_perl/5.6.1/Crypt/Primes.pm line 610.
B = 1520, r = 0.562081100800386, k = 130, q = 26428241092041745277471 at 
/usr/lib/perl5/site_perl/5.6.1/Crypt/Primes.pm line 610.
B = 3352, r = 0.667875988226359, k = 193, q = 
688430562782715717240302427312908015051 at 
/usr/lib/perl5/site_perl/5.6.1/Crypt/Primes.pm line 610.
B = 9564, r = 0.588637765080919, k = 326, q = 
965545119950202842999573881663024114299390132769541041 at 
/usr/lib/perl5/site_perl/5.6.1/Crypt/Primes.pm line 610.
B = 29240, r = 0.56933184524636, k = 570, q = 
1079008567477111753397094310847156029079713553247572710822855637214539638256680204084416659
 
at /usr/lib/perl5/site_perl/5.6.1/Crypt/Primes.pm line 610.
B = 94371, r = 0.554913243836389, k = 1024, q = 
2738877267722396215978314103886896155676111721678953257651796203192310298619466435015458288033302116849702218709734148499773910739678380930731862293431860017467060796038877
 
at /usr/lib/perl5/site_perl/5.6.1/Crypt/Primes.pm line 610.
B = 60, r = 0.5, k = 26, q = 24359 at 
/usr/lib/perl5/site_perl/5.6.1/Crypt/Primes.pm line 610.
B = 190, r = 0.533359128724712, k = 46, q = 48084667 at 
/usr/lib/perl5/site_perl/5.6.1/Crypt/Primes.pm line 610.
B = 392, r = 0.674

mod_perl, OpenPGP & Math::Pari

2002-02-04 Thread Jason Galea


OK, this has got me stumped.. so it just has to be something obvious..

I am attemting to use Crypt::OpenPGP to encrypt some data. To do this I 
need to generate some keys.. (ok that's all obvious too..get to the 
point, J)

On my development server everything runs fine producing useable public & 
private keys. I've added a subroutine to my lil web system (running on 
mod_perl) that takes the required arguements and feeds them to OpenPGP's 
keygen method. On our production server this dies with the message 
"[error] PARI:  ***   incorrect type in comparison. at 
/usr/lib/perl5/site_perl/5.6.1/Crypt/Primes.pm line 683."

Now what's really got me stumped, is feeding the same sub with the same 
arguements in an independant perl script run from the command line on 
the production (and development) server runs fine and produces usable 
public & private keys.

My only guess is that somehow mod_perl on the production server is using 
  a different library of modules than perl run from the command line is 
using but I can't believe that I wouldn't have had troubles long ago if 
that were the case.

Anyone? any clues on where to start looking?

Development Apache/1.3.20 (Unix) mod_perl/1.25
Production  Apache/1.3.20 (Unix) mod_perl/1.26

cheers

-- 
J
Web Developer

Eight Degrees Off Centre
http://www.eightdegrees.com.au/




Re: Fast template system. Ideas,theorys and tools

2002-01-03 Thread Jason Czerak

On Thu, 2002-01-03 at 12:20, Perrin Harkins wrote:
 
> > I implamented some google style timing in the API. It's basicly gets a
> > Time::HiRes timestamp in the beginning and does the math at the very end
> > and posts it in an html comment.
> 
> You'd be better off with Devel::DProf (or Apache::DProg under mod_perl).
> 
> > My average transaction time is
> > about .08 of a second. That leads me to think that my machine can handle
> > 10 html page generations a second (this isn't an exact science, but
> > close).
> 
> You are assuming serial execution.  You should be able to push much more
> than that through in a second because of parallel execution.
> 
What do you suggest as a good benchmark tool to use that would be
'smart' when testing a whole complete site.

--
Jason Czerak




Re: Fast template system. Ideas,theorys and tools

2002-01-01 Thread Jason Czerak
 running with full caching enabled and
fully persistant code base for the cart. My average transaction time is
about .08 of a second. That leads me to think that my machine can handle
10 html page generations a second (this isn't an exact science, but
close).

Now, As with the bug I think I am having with text::template. I'm using
STDOUT when I compile the template and execute all call backs and sql
queries and the such fixes things for now. (the buffering bit it can use
to compile the output into a varable is not working, it process the
output of the perl API and prints it in the incorrect spot, the
beginning of the output). 

Second feature that I'm not using is caching of output. The caching I'm
wondering how to handle it. I would need this text::template buffering
bit to work better first before I can use the caching. But I found a few
nice mod_perl aware caching tools on CPAN that I'll use to do caching.

3rd. my sql queries are not the most optimized and mostly tossed
together. But then again my developemnt tables are not that big at all.

Keep in mind that my times are based also on the time it takes to make
the transmission of the data from server to client as well as the time
it takes to compile the template and do sql queries. I"m not sure if
your times are factoring that in. Locally times are .08/sec but remotely
from T1 to cable times are .16/sec to .20/sec depending on network
conditions and size of html file at the time naturally. Some of the html
files can be about 50K in size we found.

Also, pages will do about 3 sql queries on average plus queries to the
Apache::Session state information. 

Do these numbers sound right? There are places were I could move from
doing SQL to keeping some data in Apache::Session. but it would be small
speed improments unless the catagories are very deep, I do have
recursive SQL queries inplace for some things.

Your talking 50 to 60/sec as slow. So I dunno what is 'fast'.

I do plan on release this cart GPL one of these days once I know it
works. And I do plan on having a web site explaining it in full detail.
If anyone is interested right now in the development of it. Give me a
ring. I'll be glad to get some help with it. (expecially with fedex, ups
shipping calcs :) )

If anyone would like to see a working site using the cart that I am
working on. It's over at http://www2.test.jasnik.net. 

--
Jason Czerak






Re: Apache::Filter Help Please!!

2001-12-07 Thread Jason Hall

AHAH!!!  I found it..  thanks, your example showed the difference.

What it was is that I was sending my header before my final filter, which as 
I now am guessing, maps STDOUT, which this needs.  I'm recommending to the 
author to put a note in about where the headers should be printed.

Thanks for your help, definately made the difference

On Friday 07 December 2001 01:10 pm, you wrote:
> Jason Hall wrote:
> > ok, that make sense, so I modified my filter1 to just register the
> > filter, print out some text, and return ok, that's it. and it still
> > doesn't print anything if filter2 comes after it? Does that sound wrong
> > to anybody but me?
>
> try this:
>
> package One;
>
> use Apache::Constants qw(OK);
> use strict;
>
> sub handler {
>   my $r = shift;
>   $r = $r->filter_register();
>   print "Filter 1";
>   return OK;
> }
> 1;
>
> package Two;
>
> use Apache::Constants qw(OK);
> use strict;
>
> sub handler {
>   my $r = shift;
>   $r = $r->filter_register();
>   my ($fh, $status) = $r->filter_input();
>   return $status unless $status == OK;
>   $r->send_http_header('text/plain');
>   while(<$fh>) {
> print;
>   }
>   print "Filter 2";
>   return OK;
> }
> 1;
>
>
> looks like if you don't send your headers things go slightly amuck.
>
> --Geoff

-- 
Jayce^



Re: Apache::Filter Help Please!!

2001-12-07 Thread Jason Hall

ok, that make sense, so I modified my filter1 to just register the filter, 
print out some text, and return ok, that's it. and it still doesn't print 
anything if filter2 comes after it? Does that sound wrong to anybody but me?

On Friday 07 December 2001 12:47 pm, you wrote:
> I tried out your config and handlers pretty much verbatim and got them
> to work just fine.  the only real change was that I needed to comment
> out
>
> > return $status unless $status == OK;
>
> from filter one, since $fh is $r->filename for the first filter, which
> brings up 404 when the file is not found.
>
> that said, yes I see the same thing, but only for 404s.  I think the
> problem is that you need to deal with your error code properly.
>
> > now, according to what I've read, this should print out the "Filter
> > 1Filter 2", which is what I need to let me get real work done, but all I
> > get is Filter 2.  So all powerful list, WTF am I missing (it's gotta be
> > something obvious, it always is).
>
> $fh is $r->filename for the first filter in the chain.  if
> $r->filename does not exist, you need to handle this.  $status is one
> way of handling it.  checking for $fh (which will be undef if
> $r->filename does not exist) is another.  basically, you definitely
> don't want to read from $fh if $fh is not defined :)
>
> this situation should probably be protected against in Apache::Filter
> better, but it basically looks like it is a problem with your logic.
>
> HTH
>
> --Geoff

-- 
Jayce^



Apache::Filter Help Please!!

2001-12-07 Thread Jason Hall

Please see if you notice anything glaringly wrong in what I'm doing.

Basically my problem is that my filter isn't passing data along, eg what I 
print in filter1 isn't getting output, even though filter2 get's the 
filehandle and loops over it.  My setup is pretty akin to what the docs offer 
in the synopsis.

in httpd.conf
--
PerlModule Apache::Filter


SetHandler perl-script
PerlSendHeader ON
PerlSetVar Filter On
PerlHandler Filter1 Filter2


in the filters
---
sub handler
{
my $r = shift;
$r = $r->filter_register();
my ($fh, $status) = $r->filter_input();
return $status unless $status == OK;
while(<$fh>)
{
print;
}
print "Filter 2";   #filter 1 has "filter1", obviously
return OK;
}

now, according to what I've read, this should print out the "Filter 1Filter 
2", which is what I need to let me get real work done, but all I get is 
Filter 2.  So all powerful list, WTF am I missing (it's gotta be something 
obvious, it always is).

-- 
Jayce^



Re: Apache::MP3::Skin and PerlSetVar

2001-11-28 Thread Jason Galea

Patrick Buckingham wrote:

> I just install Apache::MP3 and it works fine but if I try to use ::Skin
> I get these messages for PerlSetVar
> 
> "PerlSetvar takes two arguments Perl config var and value" This does
> this with ::Sortlist also. But with the straight MP3 modules I can use
> PerlSetVar 
> 
>   SetHandler perl-script
>   PerlHandler Apache::MP3::Skin
>   PerlSetVar  CacheDir   /usr/tmp/mp3_cache
>   PerlSetVar  SortFieldsAlbum,Title,-Duration
>   PerlSetVar HomePath /sounds   # optional
>   PerlSetVar DefaultSkin default.tmpl   # required
> 
> This is the config
> 
> 
> Thanks,
> 
>   Patrick
> 
> .
> 
> 


try taking out the comments, ie "# optional" & "# required" (or just 
move them to a separate line) - it's worked for me before.. I don't 
think PerlSetVar recognises the # as the start of a comment.



-- 
J
Web Developer

Eight Degrees Off Centre
http://www.eightdegrees.com.au/




Apache::Scoreboard

2001-10-12 Thread Jason Boxman

It's borked on my box somehow.

Even though I have multiple servers running, I only get results for the 
parent process and only partial information at that.  It also prevents 
Apache::VMonitor from returning any useful information about my running 
Apache processes.

[Fri Oct 12 15:52:22 2001] [notice] Apache/1.3.20 (Unix) Debian/GNU 
mod_perl/1.25 configured -- resuming normal operations

Has anyone ever seen this?  The module compile flawlessly.

I don't have a clue how to fix it / my setup.

mod_perl is compiled as a module.  It's all stock Debian stuff from 
Sid/unstable.

Thanks.



Re: Programmer Wanted

2001-10-12 Thread Jason Boxman

On Friday 12 October 2001 01:43 pm, you wrote:
> Hello,

Another make-money-fast site?

*sigh*

I don't know what' scarier, that you have 400,000 'people' who've bought into 
it or that you expect two million more.


> James Ventrillo
> [EMAIL PROTECTED]
>
> FREE Website
> FREE Advertising
> FREE Money!
> http://www.BuildReferrals.com
>
> James Ventrillo
> [EMAIL PROTECTED]



Re: Apache VMonitor

2001-10-09 Thread Jason Boxman

On Tuesday 09 October 2001 06:08 am, you wrote:
> Jason Boxman wrote:
> > Hey all!
> >

> Jason,
>
> Since you've already tried to look at the code and play with it, it's
> not a VMonitor's issue, but the Scoreboard's one. I'm running all the
> latest -dev versions of modperl/apache and it works for me.

Yeah, it didn't look like a VMonitor problem.

> > (loading /scoreboard returns three spaces to my browser and nothing
> > else.)
>
> cauze, it returns a *binary* image. Try to grab it instead. On my setup
> it's about 538 bytes long (depends on how many children are running and
> other info, but should be definitely 100+ bytes). Try:
>
>  % lynx --dump http://localhost/status/scoreboard > the_score

Here where it gets weird.  I got a single line of white space, that's it.

jasonb@nebula:~$ lynx --dump http://localhost/scoreboard > the_score
-rw-r--r--1 jasonb   jasonb  8 Oct  9 14:59 the_score

Not quite sure how I could have screwed up installing Scoreboard.

I ran

perl Makefile.PL PREFIX=$HOME
make
make install

No errors at all.

My httpd.conf is setup for Scoreboard as shown in my original email.

Did I mess that up?  Is everyone else's different?

Thanks.

(Basically from the POD docs.)

 
  SetHandler perl-script
  PerlHandler Apache::Scoreboard::send
  order deny,allow
  deny from all
  #same config you have for mod_status
  allow from 127.0.0.1
  allow from 192.168.0.0/255.255.255.0
  





Apache VMonitor

2001-10-09 Thread Jason Boxman

Hey all!

I'm actually not sure if this is a VMonitor issue or a Scoreboard issue, but 
here's my situation.

I compiled and installed Scoreboard, GTop, and VMonitor.  I load VMonitor in 
my startup.pl file as shown below:

(... Or to jump to the point, the reason for my post is my VMonitor output 
for Apache only shows partial information for the parent process and no 
information for my running children... See config info and output below:)

use lib qw( /home/jasonb/src/webzeus /home/jasonb/local/lib/perl/5.6.1 );
use Apache::Scoreboard ();
use Apache::VMonitor ();
$Apache::VMonitor::Config{BLINKING} = 1;
$Apache::VMonitor::Config{REFRESH}  = 0;
$Apache::VMonitor::Config{VERBOSE}  = 0;
$Apache::VMonitor::Config{SYSTEM}   = 1;
$Apache::VMonitor::Config{APACHE}   = 1;
$Apache::VMonitor::Config{PROCS}= 1;
$Apache::VMonitor::Config{MOUNT}= 1;
$Apache::VMonitor::Config{FS_USAGE} = 1;
$Apache::VMonitor::Config{SORT_BY}  = 'size';

$Apache::VMonitor::PROC_REGEX = join "\|", qw(mysql apache);

I'm running Debian GNU/Linux Woody with Sid's Apache:

[Mon Oct  8 19:30:12 2001] [notice] Apache/1.3.20 (Unix) Debian/GNU 
mod_perl/1.25 configured -- resuming normal operations

My VMonitor config in httpd.conf is as follows:

  
  SetHandler perl-script
  PerlHandler Apache::VMonitor
  

  
  SetHandler perl-script
  PerlHandler Apache::Scoreboard::send
  order deny,allow
  deny from all
  #same config you have for mod_status
  allow from 127.0.0.1
  allow from 192.168.0.0/255.255.255.0
  

(loading /scoreboard returns three spaces to my browser and nothing else.)

When I load /monitor it only returns the parent (par) Apache process and it 
doesn't show any child processes at all.  I've a dozen running, though.


 ##PID M Elapsed LastReq Srvd  Size Share VSize   Rss   Client
Request (first 64 chars)
par: 18987 .   8.3M  8.2M 10.1M  8.3M
Total:  8724K ( 8.3M) size,   8724K ( 8.3M) approx real size (-shared)


##   PID UID   Size Share VSize   Rss TTY  St  Command
 1 18987 root  8.3M  8.2M   10M  8.3M  S   apache 
 2 18988 www-data  8.5M  7.8M   10M  8.5M  R   apache 
 3 18989 www-data  8.4M  8.2M   10M  8.4M  S   apache 
 4 18990 www-data  8.4M  8.2M   10M  8.4M  S   apache
. other httpds 

I hunted through the VMonitor.pm code, just to see if I could figure out 
what's going on...

for (my $i=-1; $iparent($i)->pid;
last unless $pid;
my $proc_mem  = $gtop->proc_mem($pid);
my $size  = $proc_mem->size($pid);

I commented out the "last unless $pid" and printed out $i.  It went through 
256 increments, but the output above remained the same.  It seems like my 
Apache::Scoreboard isn't setup properly.

If anyone has any thoughts, I'd appreciate the help.  VMonitor is a sweet 
module I'd let to get working fully.

Thanks!

-Jason




Apache::DBI fails to load

2001-10-01 Thread Jason Shaw

First off, if you could cc responses to me, that would be great.

On to the problem. I compiled apache 1.3.20 from sources, w/ the
following compiled statically:mm 1.1.3, mod_layout 3.0, mod_perl 1.25,
mod_ssl 2.8.4, and php 4.0.6. I am running perl 5.6.1, originally
installed from RPM and then upgraded via cpan. 

Whenever I try to run apache I get the following errors. If I run
apachectl start or startssl, I get "Apache.pm failed to load!" in my
error_log, and "apachectl start: httpd could not be started" printed to
my console. If I run httpd -f httpd.conf.p4a (my configuration file,
working on a different machine that is to be migrated to this one) I
get:

Can't locate object method "module" via package "Apache" (perhaps you
forgot to load "Apache"?) at
/usr/lib/perl5/site_perl/5.6.1/Apache/DBI.pm line 202.
Compilation failed in require at /www/conf/httpd.conf.p4a line 287.
BEGIN failed--compilation aborted at /www/conf/httpd.conf.p4a line 287.

The block of code that encompasses line 287 is:


PerlFreshRestartOn
PerlModule  Apache  # I don't think that this line
does anything, but
#I get the same errors w/ and w/out it
PerlModule  Apache::Status
PerlModule  Apache::Registry
PerlModule  Apache::ASP
PerlModule  Apache::DBI   




and line 202 in DBI.pm is:


Apache::Status->menu_item(

'DBI' => 'DBI connections',
sub {
my($r, $q) = @_;  
my(@s) =
qw(DatasourceUsername);
for (keys %Connected) {
push @s, '', join('', (split($;,
$_))[0,1]), "\n";
}
push @s, '';
return \@s;
   }

) if ($INC{'Apache.pm'} && Apache->module('Apache::Status'));


1;



httpd -l lists mod_perl as being loaded. I compile all of apache w/out
any errors, and all of my perl/cpan installs have went smoothly.
Apache::DBI is installed and is at version number 1.20.

To verify that it is not just my apache install, I try to run perl
/www/conf/startup/pl and get the same DBI error. my startup.pl file is
as follows:


use strict;
die "no mod_perl :(" unless $ENV{MOD_PERL};
$ENV{'GATEWAY_INTERFACE'} =~ /^CGI-Perl/ or die "GATEWAY_INTERFACE not
Perl!";

use Apache::Registry;
use Apache::DBI;
use LWP::UserAgent();
1;


Any possible hints/clues will be greatly appreciated!
Thank you,
-jason shaw.
http://www.hcst.com 



ANANNOUNCE: Apache-AuthenCache-0.05

2001-08-18 Thread Jason Bodnar

NAME
   Apache::AuthenCache - Authentication caching used in
   conjuction with a primary authentication module
   (Apache::AuthenDBI, Apache::AuthenLDAP, etc.)

CHANGES

0.05  Thu Aug 16 17:00:00 2001
- Patch from Christian Gilmore fixing bug caused by 
  missing 'use Apache::Log' and removing check for mod_perl 1.26
- Added per-realm caching back in as implemented in 0.03 and 
  missed in the 0.04 rewrite 
  A different cache is created for each realm (AuthName) so 
  users allowed access to one realm do not get access to other realms.



-FW: <[EMAIL PROTECTED]>-

Date: Sun, 19 Aug 2001 02:32:16 +0200
From: PAUSE <[EMAIL PROTECTED]>
To: Jason Bodnar <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
Subject: CPAN Upload: J/JB/JBODNAR/Apache-AuthenCache-0.05.tar.gz

The uploaded file

Apache-AuthenCache-0.05.tar.gz

has entered CPAN as

  file: $CPAN/authors/id/J/JB/JBODNAR/Apache-AuthenCache-0.05.tar.gz
  size: 4686 bytes
   md5: d6d19a1dca46ad03c7504fbc8d435fca

No action is required on your part
Request entered by: JBODNAR (Jason Bodnar)
Request entered on: Sun, 19 Aug 2001 00:31:53 GMT
Request completed:  Sun, 19 Aug 2001 00:32:16 GMT

Virtually Yours,
Id: paused,v 1.74 2001/05/20 14:59:52 k Exp k 

--End of forwarded message-----

-- 
Jason Bodnar
[EMAIL PROTECTED]



ANOUNCE: Apache-DBILogConfig-0.02

2001-08-16 Thread Jason Bodnar

NAME
   Apache::DBILogConfig - Logs access information in a DBI
   database

CHANGES

   0.02  Thu Aug 16 22:17:00 2001
   - Fixed error in parsing of DBILogConfig_log_format that caused things
 to break when whitespace was used in parameters.
   - Added support for the following logging formats:

 b - bytes sent, excluding HTTP headers, in CLF format, i.e. a '-'
 rather than a 0 when no bytes are sent
 B - Bytes sent, excluding HTTP headers (%b used to be the format for
 this)
 H - The request protocol
 m - The request method
 q - The query string (prepended with a ? if a query string exists,
 otherwise an empty string)

- Added stubs for future support of:

 A - Local IP-address
 c - Connection status when response is completed
 'X' = connection aborted before the response completed
 '+' = connection may be kept alive after the response is sent
 '-' = connection will be closed after the response is sent
 V - The server name according to the UseCanonicalName setting

 Support for these formats will be completed when mod_perl makes this
 information available via the Apache request, connection and server
 APIs.

-FW: <[EMAIL PROTECTED]>-

Date: Fri, 17 Aug 2001 05:35:36 +0200
From: PAUSE <[EMAIL PROTECTED]>
To: Jason Bodnar <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
Subject: CPAN Upload: J/JB/JBODNAR/Apache-DBILogConfig-0.02.tar.gz

The uploaded file

Apache-DBILogConfig-0.02.tar.gz

has entered CPAN as

  file: $CPAN/authors/id/J/JB/JBODNAR/Apache-DBILogConfig-0.02.tar.gz
  size: 5335 bytes
   md5: 6162133983400e8dc220f155cb18c042

No action is required on your part
Request entered by: JBODNAR (Jason Bodnar)
Request entered on: Fri, 17 Aug 2001 03:35:15 GMT
Request completed:  Fri, 17 Aug 2001 03:35:36 GMT

Virtually Yours,
Id: paused,v 1.74 2001/05/20 14:59:52 k Exp k 

------End of forwarded message-

-- 
Jason Bodnar
[EMAIL PROTECTED]



Newbie question

2001-07-12 Thread Jason

Sorry if this is in an FAQ somehere (googled for it, but no luck).

Does anyone know of a *good* guide to compiling/configuring/installing
Apache + mod_perl on a Windows NT system?

The impression I get from scouting newsgrops is that most people resort to
using a prebuild binary - so I figure it must be tricky?

Jason




Installation woes :)

2001-06-10 Thread Jason

Hi everyone,

I am using ActiveState perl on Win32.   I have downloaded and installed
mod_perl (using ppm) like so:

PPM> install /location http://theoryx5.uwinnipeg.ca/ppmpackages/
mod_perl

And the mod_perl file seems to be created ok:

C:\Program Files\Apache Group\Apache\modules\mod_perl.so

So far so good I follow the "Configuration" instructions at
http://perl.apache.org/dist/cgi_to_mod_perl.html and make adjustments to
httpd.conf:

Alias /perl/  "c:/program files/perl/perl"


SetHandler  perl-script
PerlHandler Apache::Registry
Options +ExecCGI


I try restarting apache, but get this message:

Invalid command 'PerlHandler', perhaps mis-spelled or defined by a
module not included in the
server configuration

So, I snoop around and notice that the following line is commented, so I
uncomment it:

LoadModule usertrack_module modules/mod_perl.so

I get the feeling that I have missed an important step.  The wording at
http://perl.apache.org/distributions.html suggested to me that the PPM
installation was self working -- but maybe I need to do some extra work?

thanks for any advise :)

Jason








RE: Still not talking!

2001-05-21 Thread Jason Bodnar

> $db_username = "";
> $db_password = "";
> warn "Before DBI->connect(): [$$]";
> $dbh = DBI->connect($dsn, $db_username, $db_password, {'RaiseError' => 1})
> or die sprintf "Error: %s.\n", DBI->errstr;

You're probably not getting your error message because you have RaiseError on.

>From the DBI pod:

RaiseError (boolean, inherited)
  This attribute can be used to force errors to raise
  exceptions rather than simply return error codes in
  the normal way. It is "off" by default.  When set
  "on", any method which results in an error will cause
  the DBI to effectively do a die("$class $method
  failed: $DBI::errstr"), where $class is the driver
  class and $method is the name of the method that
  failed. E.g.,

  DBD::Oracle::db prepare failed: ... error text here ...


So DBI is dying before your die ... as to why you can't connect? I'm not sure
yet. Still thinking ...

-- 
Jason Bodnar
[EMAIL PROTECTED]



Re[2]: NameWithVirtualHost

2001-05-20 Thread Jason J. Czerak

On Thu, 17 May 2001 08:04:31 -0400 Geoffrey Young > wrote:

> 
> 
> > -Original Message-
> > From: Jason Czerak [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, May 16, 2001 3:18 PM
> > To: [EMAIL PROTECTED]
> > Subject: NameWithVirtualHost
> > 
> > 
> [snip] 
> > and the lines in startup.pl:
> > 
> > #! /usr/bin/perl
> > use strict;
> > use Apache::RegistryNG;
> > use CGI ();
> > use DBI ();
> > use DBD::Pg ();
> > 1;
> > 
> > nothing changes if the
> > $Apache::Registry::NameWithVirtualHost = 1 is in the
> > startup.pl or not.
> 
> well, you're not using Apache::Registry (which uses the
> $Apache::Registry::NameWithVirtualHost global)
> but Apache::RegistryNG (for which there's no corresponding
> $Apache::RegistryNG::NameWithVirtualHost :)
> 
> I haven't used RegistryNG at all, so I don't know the benefits of it over
> Registry (someone might) but I suspect that you
> will get the namespace isolation you desire if you move to Apache::Registry
> instead.
> 
> --Geoff
> 
>  
> 

I read that RegistryNG is supposed to be automatically
smarter about the namespace and I get the same effect
illreguardless if I use RegistryNG or Registry. Plus
RegistryNG is OO.

I since solved this problem tho. I went over every script
and added multi level module nameing. I did things like

domain_com::contact   for the 6 or 7 contact pages we have
and use the same idea for the 2 very complex site I'm
working on now. 

And yes, the name space isolation does work infact. but only
for the /index.pl (and any ohter scripts)  and the what not.
Tt doesn't protect the .pm or modules I load with in the 
name space or at server startup. Once loaded by any script 
it is useable by any script with in that child process even 
if the other scripts don't 'require' it it is still useable.
I dunno if this is proper for mod_perl's Registry but seems 
to be logical now that I had lots of time to mess with it. 


Or maybe I'm fooling my self. :) either way I'm getting work
done once again. :)


--
Jason J. Czerak ([EMAIL PROTECTED])
  Linux Systems Evangelist
  
Jasnik Services, LLC
  http://www.Jasnik.net






NameWithVirtualHost

2001-05-16 Thread Jason Czerak

I"m running Apache 1.3.12 + mod_perl 1.25

I'm looking to fully optimized my mod_perl scripts and in
the process I'm finding that I can't totaly seperate my
virtual hosts. I'm finding that sub procedure that are in
modules that I write  will get redefined across vhosts.
I did extensive research on this and did all the tricks 
that was suggest but with no luck.

An example test script is like this.

/index.pl:
#
#!/bin/perl -w
use strict;

require "/path/to/custom/module/test.pm"

&testmodulepackage::main();
exit;
#


Now test.pm would be duplicated and  would have simular
calls but differnet outputs.

Am I assuming correctly that in vhostA.com's /index.pl what
ever is 'required' for use is compleatly local to that
vhost? or once it's required, it's global but the only thing
that is local to that vhost is what ever is in the /index.pl
code-wise? That's what I'm getting to assume here.


my config is simple  here are lines in my dynamic
httpd httpd.conf file:


#PerlModule Apache::StatINC


   SetHandler perl-script
   PerlHandler Apache::RegistryNG->handler
   Options +ExecCGI
#PerlSendHeader On
#PerlInitHandler Apache::StatINC
#PerlSetVar StatINCDebug On


PerlRequire /vhost/bin/apache-dynamic/startup.pl



and the lines in startup.pl:

#! /usr/bin/perl
use strict;
use Apache::RegistryNG;
use CGI ();
use DBI ();
use DBD::Pg ();
1;

nothing changes if the
$Apache::Registry::NameWithVirtualHost = 1 is in the
startup.pl or not.

If I change the SetHandler perl-script to SetHandler
cgi-script all the modules in the startup.pl load and are
cached and shared but my scripts are not.


I can provide output from perl-status if anyone wishes to C
that. But from what I gather, Apache does correctly place
all calls in the correct name spaces.



--
Jason J. Czerak ([EMAIL PROTECTED])
  Linux Systems Evangelist
 
Jasnik Services, LLC
  http://www.Jasnik.net






looking for a functin to move %fdat to the symbol table..

2001-05-10 Thread jason n perkins

php has a function called extract which takes an array (no distinction
between arrays and hashes in php. in this case in perl, it'd actually be a
hash). extract takes the key values of the array (and optionally prepends a
user specified prefix to each of the values to avoid clobbering other values
in the symbol table), sets each of them up as a variable with that name and
sets the variable's value equal to the value of that associated key in the
hash. the beauty of extract comes into play when you want to use each of the
key/value pairs in the array. instead of setting them up one at a time, pass
the array to extract and voila, you have all of the key/value elements
available as variables. if my description is too unclear, you can check the
extract functions info at http://www.php.net/manual/en/function.extract.php.

does embedded perl sport a similar function?

my apologies if i've posted to the wrong list. i did cross post to the
embperl list, to cover all of the bases.

:: jason n perkins
:: email -> [EMAIL PROTECTED]
:: web -> www.somebodydial911.com






really odd XML + CGI.pm + mod_perl + Macintosh + IE 4.5 problem

2001-05-07 Thread Jason Terry

OK I have ben RTFMing for about 5 hours now and I did find a fix for part of my 
problem

It seems that Mac browsers (IE 4.5 and an old AOL that I know of) are having trouble 
viewing our HTML producing CGI scripts that use
a function called &CGI::start_html()

Apparently (recently in CGI.pm) there has been a change where the CGI::start_html 
includes the following


This tag is reaking havoc on some browsers on Mac and possibly others.

Well after pouring through the "perldoc CGI" I found that if you
use CGI(:all -no_xhtml);

then you will not get the compile(qw(:all -no_xhtml));#used to optimize CGI.pm memory consumption for 
forked processes

and I have this in the 2 scripts that I actually use in mod_perl
use CGI qw(:all -no_xhtml);

my problem is that in mod_perl... it still occasionally prints the 


mod_perl and infinite loops

2001-04-25 Thread Jason Terry

I have a rather large script I run through mod_perl and occasionally, I have 
notice some users with "stuck" processes.  It seems
like they are in some sort of infinite loop.

The CPU that the child is using is high, and the memory gradually grows until my 
server would eventually start to thrash (however, I
built a script to kill the child before this occurs)

Does anyone know of a way (even if it costs more memory/cpu) that I could load an 
ability into modperl and view where in the perl
code a mod_perl process is atually at?  Would "Apache::Status" or "B::TerseSize" or 
something else make this possible?

I know that "B::TerseSize" will allow me to view the code loaded into memory, but I 
havent' found a way to actually analyze a child
to find out what it is CURRENTLY runnning.




New Install Perl 5.6.1- mod_perl not findind mods

2001-04-19 Thread Jason Leidigh



Hi,
 
I have a mod_perl 1.24 installed installed with 
Apache 1.3.12 in solaris.  Perl at the time I installed mod_perl/Apache was 
5.005.  This distribution did not include ByteLoader.  I now have a 
need for ByteLoader.  Using the CPAN mod I installed it which really just 
went all the way and installed 5.6.1.  The problem is that it is not find 
toe the modules for 5.6.1, in fact it seem to be running the old perl thoughh 
I'm not sure why or how.  In the error log for apache I get:
 
Can't locate ByteLoader.pm in @INC (@INC contains: 
/usr/local/apache2_mod_perl/mod_perl /usr/local/apache2_mod_perl/mod_perl 
/usr/local/lib/perl5/5.00503/sun4-solaris /usr/local/lib/perl5/5.00503 
/usr/local/lib/perl5/site_perl/5.005/sun4-solaris 
/usr/local/lib/perl5/site_perl/5.005 . /usr/local/apache2_mod_perl/ 
/usr/local/apache2_mod_perl/lib/perl)
 
Yet this perl -e "print @INC" print 
this:
 
/usr/local/lib/perl5/5.6.1/sun4-solaris/usr/local/lib/perl5/5.6.1/usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/usr/local/lib/perl5/site_perl/5.6.1/usr/local/lib/perl5/site_perl/5.005/sun4-solaris/usr/local/lib/perl5/site_perl/5.005/usr/local/lib/perl5/site_perl.
 
And same for /usr/local/bin/perl -e "print @INC" 
and /usr/bin/perl
 
I copied all the Byteloader files from 5.6.1 to 
5.005 but that caused a sybols error:
 
Can't load 
'/usr/local/lib/perl5/5.00503/sun4-solaris/auto/ByteLoader/ByteLoader.so' for 
module ByteLoader: ld.so.1: /usr/local/apache2_mod_perl/bin/httpd: fatal: 
relocation error: file 
/usr/local/lib/perl5/5.00503/sun4-solaris/auto/ByteLoader/ByteLoader.so: symbol 
PL_ppaddr: referenced symbol not found at 
/usr/local/lib/perl5/5.6.1/sun4-solaris//XSLoader.pm line 75.
 
OK thats logical, it was built for 5.6.1.but 
how do I make mod_perl respect the new perl binary...do I have to recompile 
mod_perl/Apache
Jason Z. LeidighProject LeaderUOL 
InternacionalAv.Libertador 1068 - Piso 3Capital Federal - ( C1112ABN 
)Buenos Aires - ArgentinaT.E: 
0054-11-5777-2446Fax:  
0054-11-5777-2402www.uol.com.ar[EMAIL PROTECTED]


Re: Reading Apache config info from mod_perl

2001-03-26 Thread Jason Leidigh



This depend on the info you want as certain tables 
of info have different methods.  For the port you can use:
 
my $port = $r->get_server_port;
 
I'm not sure you can get the actaul pass file used 
for the protected dir howevere you can recover the authentication result 
and the pass used to get into the dir via this method:
 
my($result,$pass) = 
$r->get_basic_auth_pw;
 
The user via:
 
my($user_name) = 
$r->connection->user;
 
 
To get conf info you can use this 
method:
 
$myConfVar = 
$r->dir_config('ThisVar');
 
And in the httpd.conf:
 
PerlSetVar ThisVar  
0
 
 
Hope this helps.
Jason Z. LeidighProject LeaderUOL 
InternacionalAv.Libertador 1068 - Piso 3Capital Federal - ( C1112ABN 
)Buenos Aires - ArgentinaT.E: 
0054-11-5777-2446Fax:  0054-11-5777-2402www.uol.com.ar[EMAIL PROTECTED]


Memory Leaks?

2001-03-15 Thread Jason Leidigh



At the the mod_perl/Apache web site (http://perl.apache.org/faq/#Why_is_httpd_using_so_much_memor)
 
there is a section about memory usage and a 
subroutine is given which can help test for memory leaks which perl "does no 
overtly report"
 

Joel Wagner reports that calling an undefined subroutine in a module can 
cause a tight loop that consumes all memory. Here is a way to catch such errors. 
Define an autoload subroutine 
  sub UNIVERSAL::AUTOLOAD {
  my $class = shift;
  warn "$class can't `$UNIVERSAL::AUTOLOAD'!\n";
  }

It will produce a nice error in error_log, giving the line number of the call 
and the name of the undefined subroutine.
I edited this to get a little more info:
  sub UNIVERSAL::AUTOLOAD 
{  my $class = 
shift;    my($package,$file,$line) = 
caller;  warn "$class 
can't `$UNIVERSAL::AUTOLOAD'\n\tCaller 
Info:\n\t$package\n\t$file\n\t$line\n";    $" = 
"\n";    warn @_ , "\n\n";  }
I was able to clean up a number of errors which 
seemed as though they were indeed causing leaks.  For example:
$regex = qr'xx?'i;
Causes the following error:
(?i-xsm:xx?) can't 
`Regexp::DESTROY'    Caller 
Info:    
Apache::JProxy    
/usr/local/apachessl/mod_perl/Apache/JProxy.pm    
780
The only solution I found was to not precompile the 
regex but it would definilty be nice so as to save some time as I repeatedly use 
numeros patterns which I was precompliling.
 
Another error I found was with the use of 
LWP:
LWP::UserAgent=HASH(0x5acb10) can't 
`LWP::UserAgent::DESTROY'    Caller 
Info:    
Apache::JProxy    
/usr/local/apache2_mod_perl/mod_perl/Apache/JProxy.pm    
980
I was able to erradicat this error by adding 
DynaLoader to the @ISA of LWP::UserAgent.
OK not so bad but one error I have been unable 
erradicat is the following:
Apache=SCALAR(0x84da840) can't 
`Apache::DESTROY'    Caller 
Info:    
main    
/dev/null    0
I have not found that Apache,pm has a ISA to add 
dynaloader to and I have not yet trid adding it my self but..any ideas on 
where this (apparent) leak is comming from?  It adds 4k to a 
child per request.  On a site with the amount of traffic we have that is 
death
 
Thanks in advance!
Jason Z. LeidighProject LeaderUOL 
InternacionalAv.Libertador 1068 - Piso 3Capital Federal - ( C1112ABN 
)Buenos Aires - ArgentinaT.E: 
0054-11-5777-2446Fax:  0054-11-5777-2402www.uol.com.ar[EMAIL PROTECTED]


Apache thrashing my swap...

2001-02-28 Thread Jason Terry

I am running
Apache/1.3.14 (Unix) mod_perl/1.24_01 PHP/4.0.3pl1 mod_ssl/2.7.1 OpenSSL/0.9.6

And run several database and MEMORY hogging mod_perl scripts...  My problem is that 
recently I have had some users that are getting
impatient and hitting the reload/refresh button OFTEN.  In some instances this causes 
one single person to have over 40 httpd
children service JUST them.  This causes my server to start thrashing swap...

Does anybody on this list know of a way to limit the number of connections apache will 
allow per IP address (before any reverse
lookups would be nice)?  I would like to set this to like 10-15 or so if it is 
possible?  I know that this could cause some people
with proxy servers to be limited, but I figure 10-15 httpd children should be able to 
handle most proxy systems just fine...

I know this isn't really a mod_perl problem... but I also know that this list is 
probably the most likely to have other people who
have exactly this issue on their machines

Thanks in advance
-Jason




Re: Subject: mod_perl failing to interpret bytecode modules

2001-02-09 Thread Jason Leidigh



Mark,
 
I ahve been asking this question for some time 
nowthough admitedly not specific to bytecode and ByteLoader but just how to 
"precomplie" a mod_perl mod.  I went to www.experts-exchange.com and got a 
great walk through of how to use ByteLoader but as with you it fails in 
mod_perl I'm passing you the info they gave me just in case you can see how 
to give it that final twist.I and the person who gave me the answer were 
unable.
 
>>>


  
  
This may bring you on the right track, but be 
  careful you are entering headache land:$ cat foo.pmpackage 
  foo;sub bar { print "a foo::bar\n"; return 
  1;}1;$ cat bar.pluse lib ".";use 
  foo;foo::bar();$ perl -MO=Bytecode,-O6,-o,bar.plc 
  bar.plbar.pl syntax OK$ ls -l total 162-rw-r--r-- 
    1 thoellri   35 Jan 24 18:02 
  bar.pl-rw-r--r--   1 thoellri   153053 Jan 24 
  18:30 bar.plc-rw-r--r--   1 thoellri 
    66 Jan 24 18:02 foo.pm$ echo 
  "use Byteloader 0.03;\n" > loader.pl$ cat bar.plc >> 
  loader.pl$ ls -l total 322-rw-r--r--   1 
  thoellri   35 Jan 24 18:02 
  bar.pl-rw-r--r--   1 thoellri   153053 Jan 24 
  18:30 bar.plc-rw-r--r--   1 thoellri 
    66 Jan 24 18:02 foo.pm-rw-r--r-- 
    1 thoellri   153075 Jan 24 18:32 loader.pl$ 
  perl loader.pla foo::bar$ perl -vThis is perl, v5.6.0 
  built for sun4-solarisCopyright 1987-2000, Larry WallPerl 
  may be copied only under the terms of either the Artistic License or 
  theGNU General Public License, which may be found in the Perl 5.0 
  source kit.Complete documentation for Perl, including FAQ lists, 
  should be found onthis system using `man perl' or `perldoc perl'. 
   If you have access to theInternet, point your browser at http://www.perl.com/, the Perl Home 
  Page.Have fun 
:-)  Tobias
>>>>
 
I hope that you, I or someone will find the key 
because I am (as I'm sure you are) very anxious to have this solution in 
placegood luck!  
Jason Z. LeidighProject LeaderUOL 
InternacionalAv.Libertador 1068 - Piso 3Capital Federal - ( C1112ABN 
)Buenos Aires - ArgentinaT.E: 
0054-11-5777-2446Fax:  0054-11-5777-2402www.uol.com.ar[EMAIL PROTECTED]


Reading email with mod_perl

2001-02-07 Thread Jason Terry

Does anybody have an information on how to read a MIME encoded email attachment with 
mod_perl?




Re: Perl Sections, NameVirtualHost, and Aliases

2001-02-07 Thread Jason Terry

I use this code to pull my domains from a VERY simple mySQL db


- Original Message - 
From: "G.W. Haywood" <[EMAIL PROTECTED]>
To: "Veatch, David W" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, February 07, 2001 10:04 AM
Subject: Re: Perl Sections, NameVirtualHost, and Aliases


> Hi there,
> 
> On Wed, 7 Feb 2001, Veatch, David W wrote:
> 
> > Has anyone successfully built a fully perl conf file with multiple virtual
> > hosts on the same IP?
> 
> Dunno if it will work for you in those circumstances, but have you
> looked at mod_macro?  I used it last year and it was fine for an
> ordinary (although complex, multiple virtual hosts) http.conf.
> 
> 73,
> Ged.

 virt_perl.inc


Transfering Headers... w/ miltiple 'Set_Cookie'

2000-12-21 Thread Jason Leidigh




Hi,
 
I have a problem with a "procy" I'm writing.  
The proxy mut pass the headers from the response to the response that the Apache 
will return to the client.  I am using the following method as read from 
The Egal Book (Writing Apache Modules)
 
    
$headers->scan(sub 
{    
$r->header_out(@_);    
});
 
Where $headers is a HTTP::Response object... the 
problem is that there are many Set-Cookie instructions in $headers but mod_perl 
seems to use a tied hash to link to the request table and so each set cookie 
replaces the last as the hash key is seen to equal?  How do I get 
around thisI tried:
 
$r->headers_out->add('Set-Cookie' => 
$cookieString);
 
Inside a loop which modifies $cookieString each 
time through but it had the same effect.  In the end Apache sens you a 
single cookie which is equivelent to the last set.
 
Thanks in advance..
 
Jason
 
PS I am still waiting for a good sugguestion on how 
to protect code:
 
I have a mod_perl module which I would like to 
protect.  The code is very "private" and I would like to have it 
exist only as perl byte code... which can be used each time the server may 
be restarted... is this possible?  How?  Thanks in advance and to 
those wo responded to may last question "Help me beat 
Java..." 
 
The goal is not to prevent decompiling which seemed 
to be one persons sugguestion using obfuscation...but simply to make it 
impossible to open and read the .pm. Make it a prcompiled Perl Byte Code which 
Apache can insert into its parent and child processes whithout expecting a raw 
perl script which requires compiling...
Jason Z. LeidighProject LeaderUOL 
InternacionalAv.Libertador 1068 - Piso 3Capital Federal - ( C1112ABN 
)Buenos Aires - ArgentinaT.E: 
0054-11-5777-2446Fax:  0054-11-5777-2402www.uol.com.ar[EMAIL PROTECTED]
Jason Z. LeidighProject LeaderUOL 
InternacionalAv.Libertador 1068 - Piso 3Capital Federal - ( C1112ABN 
)Buenos Aires - ArgentinaT.E: 
0054-11-5777-2446Fax:  0054-11-5777-2402www.uol.com.ar[EMAIL PROTECTED]


Precompile to protect code?

2000-12-18 Thread Jason Leidigh



I have a mod_perl module which I would like to 
protect.  The code is very "private" and I would like to have it 
exist only as perl byte code... which can be used each time the server may 
be restarted... is this possible?  How?  Thanks in advance and to 
those wo responded to may last question "Help me beat 
Java..." 
Jason Z. LeidighProject LeaderUOL 
InternacionalAv.Libertador 1068 - Piso 3Capital Federal - ( C1112ABN 
)Buenos Aires - ArgentinaT.E: 
0054-11-5777-2446Fax:  0054-11-5777-2402www.uol.com.ar[EMAIL PROTECTED]


RE: Response time of a perl script!!!

2000-12-05 Thread Jason Liu

In this situation, I think the bottle neck is establishing connection with
the database.  Apache::DBI helps to maintain persistent database connection.
That's why the latter test is 20 times faster.

Jason
>
>
>   Hi folks,
>
>   I ran a same perl script twice. First time only under mod_perl,
> and after under mod_perl and Apache::DBI. The response time of both
> experiments was very different. The last was fastest than the first
> approximately 20 times. Is it correctly? If the response time of a perl
> script with mod_perl is bad, I think that it without mod_perl will be
> much worse. I also would like to know if when the apache (with mod_perl)
> starts each child process already has one embedded interpreter or they
> will have only when the first request arrives. Please, if soneone help me
> will be very appreciated. Thanks...
>
>   Edmar,
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Problem with Apache::DBI under mod_perl!!

2000-11-27 Thread Jason Liu

I had some similar problem before.  It was caused by the "PerlFreshRestart
on".   Comment this line out and see what happens.

Jason



> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Edmar Edilton da Silva
> Sent: Thursday, November 23, 2000 5:40 AM
> To: [EMAIL PROTECTED]
> Subject: Problem with Apache::DBI under mod_perl!!
>
>
> Hi all,
>
> I have installed on the my machine the following modules:
> apache 1.3.12-2
> perl-5.00503-10
> mod_perl 1.21-10
> DBI 1.14
> Apache::DBI 0.87
>
> For enable the mod_perl module, I added the below code in the
> configuration file of apache ("httpd.conf"):
>
> # If the perl module is installed, this will be enabled.
>
> 
>   PerlFreshRestart On
>   Alias /perl-bin/ /home/httpd/perl-bin/
>   
> SetHandler perl-script
> PerlHandler Apache::Registry
> PerlSendHeader On
> Options +ExecCGI
>   
> 
>
> For load the Apache::DBI module, I also added this line in the
> "httpd.conf" file:
> PerlRequire /etc/httpd/conf/startup.pl
>
> Inside of "startup.pl" file, I added the following code:
> #!/usr/bin/perl
>
> use strict;
>
> # Extend @INC if needed
> use lib qw(/dir/foo /dir/bar);
>
> # Make sure we are in a sane environment.
> $ENV{MOD_PERL} or die "not running under mod_perl!";
>
> # For things in the "/perl-bin" URL
> use Apache::Registry;
>
> # Load Perl modules of your choice here
> # This code is interpreted *once* when the server starts
> use Apache::DBI ();
> $Apache::DBI::DEBUG = 2;
> $Apache::AuthDBI::DEBUG = 2;
> use DBI ();
>
> # Tell me more about warnings
> use Carp ();
> $SIG{__WARN__} = \&Carp::cluck;
>
> # Load CGI.pm and call its compile() method to precompile
> # (but not to import) its autoloaded methods.
> use CGI ();
> CGI->compile(':all');
>
> #Initialize the database connections for each child
> Apache::DBI->connect_on_init
> ("dbi:Oracle:ora8", "travel", "travel",
>{
>PrintError => 1, # Warn() on errors
>RaiseError => 0, # Don't die on error
>AutoCommit => 1, # Commit executes immediately
>}
> );
>
> But, when I try loading a HTML page of WWW server, the server refuse my
> request. I think that the problem is in the WWW server that don't load
> their child process because to the Apache::DBI to be with some problem.
> During the installation of all the modules didn't have any problem. The
> apache start correctly, but when I try stoping them, I get a error
> message that the process failed.
> Locking the configuration files, can anyone tell me what is happening?
> Any help will very appreciated.
>
> 
> Edmar Edilton da Silva
> Bacharel em Ciência da Computacão - UFV
>   Mestrando em Ciência da Computacão - UNICAMP
> 
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: dynamic vs. mostly static data

2000-11-10 Thread Jason Liu

Is a package global var, such as %CACHE in the code below, persistent during
the life of a child process?  Does each child get a copy of %CACHE after the
parent forks?

Thanks,

Jason
>
> i often do something like this where i allow each individual child
> process to cache it's data.  i do something like this:
>
> package Apache::Foo;
>
> use strict;
> use Apache::Constants;
> use POSIX 'strftime';
>
> use constant CACHE_EXPIRES => 3600; # one hour
> use vars qw[ %CACHE ];
> %CACHE = ();
>
> sub handler {
> my $r = shift;
>
> eval {
> my $expires = $CACHE{'expires'} || 0;
> if ($expires < time) {
> my @data = < some routine >;
> my $t = HTML::Template->new(filename  => 'foo.tmpl',
> die_on_bad_params => 0,
> cache => 1);
> $t->param('data', \@data);
>
> $CACHE{'data'}= $t->output;
> $CACHE{'expires'} = time + CACHE_EXPIRES;
> }
> $r->print($CACHE{'data'});
> };
>
> return print_err($r, $@) if $@;
> return OK;
> }
>
> 1;
>
> btw, i'd really recommend you look into using Template Toolkit.  it's a
> much more powerful and flexible templating system than HTML::Template,
> but i digress (and might start a flame war against myself by saying this).
>
> hth,
>
> ky
>
>




RE: database access

2000-11-07 Thread Jason Liu

Thank you for the help everyone.

Jason



RE: database access

2000-11-07 Thread Jason Liu

Is Apache::DBI absolutely necessary if you want to establish persistent
database connection per child?

Thanks,

Jason



> -Original Message-
> From: David Hodgkinson [mailto:[EMAIL PROTECTED]]
> Sent: Monday, November 06, 2000 5:10 AM
> To: Jason Liu
> Cc: [EMAIL PROTECTED]
> Subject: Re: database access
>
>
> "Jason Liu" <[EMAIL PROTECTED]> writes:
>
> > In general, how should database connections be handled between
> parent and
> > child processes?  Can you establish database connections from within a
> > handler?
>
> Absolutely. And using Abache::DBI caches the connection handle.
>
> --
> Dave Hodgkinson, http://www.hodgkinson.org
> Editor-in-chief, The Highway Star   http://www.deep-purple.com
>   Apache, mod_perl, MySQL, Sybase hired gun for, well, hire
>   -
>




RE: database access

2000-11-06 Thread Jason Liu

Thanks for reply.

I need some information in the Oracle database for access control.  We have
some methods in our proprietary library for Oracle access.  I have a file
called GateKeeper.pm that contains the access handler, sub handler{ ... }.
I placed the same code inside and outside of the handler subroutine in
GateKeeper.pm.  When the Apache starts up, those code outside of the handler
subroutine got executed.  It queries the Oracle and writes the result in a
file.  This part works fine.  However, when I requests a file and the access
handler is triggered, I got an error message says "Undefined subroutine
&dbChannel::command called at /usr/up/papi/lib/PAPIDatabase.pm", which is a
library file that works.

In general, how should database connections be handled between parent and
child processes?  Can you establish database connections from within a
handler?

Jason



>
> "Jason Liu" <[EMAIL PROTECTED]> writes:
>
> > Hi,
> >
> > I can access oracle database from the main Apache process, but
> not from any
> > child processes.  I am fairly new to this subject, can someone
> give me some
> > advice?
>
> What error are you getting? You looked in the error logs? What do you
> mean by "main" apache process?
>
> --
> Dave Hodgkinson, http://www.hodgkinson.org
> Editor-in-chief, The Highway Star   http://www.deep-purple.com
>   Apache, mod_perl, MySQL, Sybase hired gun for, well, hire
>   -
>




database access

2000-11-06 Thread Jason Liu

Hi,

I can access oracle database from the main Apache process, but not from any
child processes.  I am fairly new to this subject, can someone give me some
advice?

Thanks in advance,

Jason




prototype mismatch in Socket.pm

2000-11-01 Thread Jason Liu

Hi,

I got the following prototype mismatch error when starting up Apache.  Has
anyone seen this before?

Prototype mismatch: sub Socket::INADDR_ANY vs () at
/usr/local/lib/perl5/5.6.0/sun4-solaris/Socket.pm line 328.
Prototype mismatch: sub Socket::INADDR_BROADCAST vs () at
/usr/local/lib/perl5/5.6.0/sun4-solaris/Socket.pm line 329.
Prototype mismatch: sub Socket::INADDR_LOOPBACK vs () at
/usr/local/lib/perl5/5.6.0/sun4-solaris/Socket.pm line 330.
Prototype mismatch: sub Socket::INADDR_LOOPBACK vs () at
/usr/local/lib/perl5/5.6.0/sun4-solaris/Socket.pm line 331.
[Wed Nov  1 13:05:26 2000] [notice] Apache/1.3.14 (Unix) mod_perl/1.24_01
configured -- resuming normal operations


Jason




RE: An idea, for comments

2000-10-27 Thread Jason Bodnar

This is very similar to SOAP (Simple Object Access Protocol). There is a perl
module that implements SOAP. It's also like the many perl RPC modules.

On 27-Oct-2000 Nouguier wrote:
> Hi all
> 
> Fist of all, sorry for my bad english...
> 
> We "think/found" a technic to manage user action through a web
> interface. And I like to know your opinion about it.
> 
> The goal is to trigger actions through the server without using cgi ( or
> mod_perl ) fake pages.
> 
> The actions are managed by a Content Handler on a location:
> 
> 
> An example is better than long ( bad writen text ) so:
> 
> 
>   /action/Client/Add
> 
> Is parsed to obtains an object type ( "Client" ) and an action to
> perform ( "Add" )
> 
> $object = "Client"
> $method = "Add"
> 
> and posted data are read in $fdat ( hash table ref )
> 
> Then a perl package is found regarding the object type.
> 
> $package = MyNameSpace::Client;
> 
> An the action is called on that package.
> 
> The problem we have was that we wanted the handler to be able to call
> any function available on any authorised package, whithout using a
> dispatcher
> with a long
> if() {
> }elsif(){
> }elsif(){
> }else{
> }
> 
> To sumup, here want we are doing:
> 
> 1: parsing URI, to obtain a package and a method
> 
> 2: look if action is allowed on that package, by this user ( with a
> session management ).
> 
> 3: build a string  $str = 'MyNameSpace::Client->Add( $session, $fdat
> )',  $fdat are the data posted throught the handler
> 
> 4: calling $return = eval $str.
> 
> 5: find a redirection page for that ( package, action, result )
> 
> That all, it's work fine and it's allowing to call package/object methods
> whithout having fake pages to maintains.
> 
> Comments are very, very welcomes
> 
> --
> Don't be irreplaceable, if you can't be replaced, you can't be promoted.

-- 
Jason Bodnar
[EMAIL PROTECTED]



Re: simple cookie authorization?

2000-10-21 Thread Jason Bodnar

On 21-Oct-2000 James G Smith wrote:
> Jason Bodnar <[EMAIL PROTECTED]> wrote:
>>Is there a module for simple cookie authorization? I want to grant access if
>>the user has a cookie set. I don't care about the value of the cookie.
>>
>>I looked at Apache::AuthCookie and it looks overly complex for my needs.
> 
> Something like the following?

Exactly. I just didn't want to write it if somebody else had done it already ;-)


> package My::CookieAuth;
> 
> use strict;
> use Apache::Constants qw(:common);
> use CGI qw(:standard);
> use CGI::Cookie ();
> 
> sub handler {
>   my $r = shift;
> 
>   return DECLINED unless cookie(COOKIE_NAME);
>   return OK;
> }
> 
> __END__
> 
> 
> 
> 
> In httpd.conf, you will need to set this as the PerlAuthenHandler 
> for the protected files/directories and `require any' to get Apache 
> to actually call it.  This is not the most efficient, but it could 
> be a starting point for what you're looking for, if I understand 
> what you're looking for.
> -- 
> James Smith <[EMAIL PROTECTED]>, 979-862-3725
> Texas A&M CIS Operating Systems Group, Unix

-- 
Jason Bodnar
[EMAIL PROTECTED]



simple cookie authorization?

2000-10-21 Thread Jason Bodnar

Is there a module for simple cookie authorization? I want to grant access if
the user has a cookie set. I don't care about the value of the cookie.

I looked at Apache::AuthCookie and it looks overly complex for my needs.

-- 
Jason Bodnar
[EMAIL PROTECTED]



ANNOUNCE:: Apache::ProxyStuff-0.10

2000-10-20 Thread Jason Bodnar

Revision history for Perl extension Apache::ProxyStuff.

0.10  Sat Oct 21 01:09:00 2000
  - ProxyStuff now adds a  tag when the document does not contain one
which should result in all pages receiving a footer even if they are not
syntacticly correct


-FW: <[EMAIL PROTECTED]>-

Date: Sat, 21 Oct 2000 08:16:54 +0200
From: PAUSE <[EMAIL PROTECTED]>
To: Jason Bodnar <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
Subject: CPAN Upload: J/JB/JBODNAR/Apache-ProxyStuff-0.10.tar.gz

The uploaded file

Apache-ProxyStuff-0.10.tar.gz

has entered CPAN as

  file: $CPAN/authors/id/J/JB/JBODNAR/Apache-ProxyStuff-0.10.tar.gz
  size: 6232 bytes
   md5: e2184258e7fb03903a59ddf08e44b140

No action is required on your part
Request entered by: JBODNAR (Jason Bodnar)
Request entered on: Sat, 21 Oct 2000 06:15:33 GMT
Request completed:  Sat, 21 Oct 2000 06:16:54 GMT

Virtually Yours,
Id: paused,v 1.69 2000/10/16 16:19:25 k Exp k 

--End of forwarded message-----

-- 
Jason Bodnar
[EMAIL PROTECTED]



failed on sanity check on compiler and options

2000-10-20 Thread Jason Liu

Hi,

Thanks for the previous help.

When building mod_perl (perl Makefile.PL), it failed on "sanity check on
compiler and options."  It seemed like the gcc command was chopped off.  Did
anyone see this before?  Below is the error message.  Thanks in advance.

Jason

 Error Output for sanity check 
cd ..;
gcc  -DSOLARIS2=260 -DMOD_PERL -DUSE_EXPAT -I./lib/expat-lite -DNO_DL_NEEDED
 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -I/usr/local/lib/perl5/5.6.0/su
n4-solaris/CORE  -I. -I../.. -DUSE_PERL_SSI  -D_LARGEFILE_SOURCE -D_FILE_OFF
SET_BITS=64 -DMOD_PERL -o helpers/dummy helpers/dummy.c  `perl
/usr/local/apache/mod_perl-1.24_01/src/modules/perl/ldopts  ` -lsocket -lnsl
/usr/local/lib/perl5/5.6.0/sun4-solaris/auto/DynaLoader/DynaLoader.a
/usr/local/lib/perl5/5.6.0/sun4-solaris/auto/B/B.a
/usr/local/lib/perl5/5.6.0/sun4-solaris/auto/ByteLoader/ByteLoader.a
/usr/local/lib/perl5/5.6.0/sun4-solaris/auto/Data/Dumper/Dumper.a
/usr/local/lib/perl5/5.6.0/sun4-solaris/auto/Devel/DProf/DProf.a
/usr/local/lib/perl5/5.6.0/sun4-solaris/auto/Devel/Peek/Peek.a
/usr/local/lib/perl5/5.6.0/sun4-solaris/auto/Fcntl/Fcntl.a
/usr/local/lib/perl5/5.6.0/sun4-solaris/auto/File/Glob/Glob.a
/usr/local/lib/perl5/5.6.0/sun4-solaris/auto/IO/IO.a
/usr/local/lib/perl5/5.6.0/sun4-solaris/auto/IPC/SysV/SysV.a
/usr/local/lib/perl5/5.6.0/sun4-solaris/auto/NDBM_File/NDBM_File.a
/usr/local/lib/perl5/5.6.0/sun4-solaris/auto/ODBM_File/ODBM_File.a
/usr/local/lib/perl5/5.6.0/sun4-solaris/auto/Opcode/Opcode.a
/usr/local/lib/perl5/5.6.0/sun4-solaris/auto/POSIX/POSIX.a
/usr/local/lib/perl5/5.6.0/sun4-solaris/auto/SDBM_File/SDBM_File.a
/usr/local/lib/perl5/5.6.0/sun4-solaris/auto/Socket/Socket.a /usr/loca
gcc: /usr/loca: No such file or directory
*** Error code 1
make: Fatal error: Command failed for target `dummy'
= End of Error Report =

 Aborting!




How to use gcc to build mod_perl

2000-10-20 Thread Jason Liu

Hi,

I was trying to build mod_perl 1.24_01 and apache 1.3.14.  I used the
following command:

perl Makefile.PL
make test && make install

The Makefile wants to use the "cc" compiler.  Can I use "gcc" instead?

Thanks,

Jason




ANNOUNCE: Apache::ProxyStuff 0.09

2000-10-19 Thread Jason Bodnar

Recent changes:

0.09  Wed Oct 18 23:36:00 2000
  - Fixed a bug that added an additional  tag when adding  tags
  - ProxyStuff now adds a  tag when the document does not contain one
which should result in all pages receiving a header even if they are not
syntacticly correct


-FW: <[EMAIL PROTECTED]>-

Date: Thu, 19 Oct 2000 18:06:13 +0200
From: PAUSE <[EMAIL PROTECTED]>
To: Jason Bodnar <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
Subject: CPAN Upload: J/JB/JBODNAR/Apache-ProxyStuff-0.09.tar.gz

The uploaded file

Apache-ProxyStuff-0.09.tar.gz

has entered CPAN as

  file: $CPAN/authors/id/J/JB/JBODNAR/Apache-ProxyStuff-0.09.tar.gz
  size: 6051 bytes
   md5: 76525bd499e69af57d427a26072e7793

No action is required on your part
Request entered by: JBODNAR (Jason Bodnar)
Request entered on: Thu, 19 Oct 2000 16:04:57 GMT
Request completed:  Thu, 19 Oct 2000 16:06:13 GMT

Virtually Yours,
Id: paused,v 1.69 2000/10/16 16:19:25 k Exp k 

--End of forwarded message-----

-- 
Jason Bodnar
[EMAIL PROTECTED]



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
 
   AllowOverride None
   Options ExecCGI
   SetHandler perl-script
   PerlHandler Apache::Registry
   PerlSendHeader On
 

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



ANNOUNCE: Apache::ProxyStuff 0.08

2000-10-12 Thread Jason Bodnar

This version fixes a typo in the Pod documentation spotted by Christian
Gilmore. The typo was causing problems installing the module.


-FW: <[EMAIL PROTECTED]>-

Date: Thu, 12 Oct 2000 18:44:21 +0200
From: PAUSE <[EMAIL PROTECTED]>
To: Jason Bodnar <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
Subject: CPAN Upload: J/JB/JBODNAR/Apache-ProxyStuff-0.08.tar.gz

The uploaded file

Apache-ProxyStuff-0.08.tar.gz

has entered CPAN as

  file: $CPAN/authors/id/J/JB/JBODNAR/Apache-ProxyStuff-0.08.tar.gz
  size: 5335 bytes
   md5: d4d0e38d07f80f512b21f79fac8b0ed9

No action is required on your part
Request entered by: JBODNAR (Jason Bodnar)
Request entered on: Thu, 12 Oct 2000 16:43:48 GMT
Request completed:  Thu, 12 Oct 2000 16:44:21 GMT

Virtually Yours,
Id: paused,v 1.68 1999/10/22 14:39:12 k Exp k 

--End of forwarded message-----

-- 
Jason Bodnar
[EMAIL PROTECTED]



ANNOUNCE: Apache::ProxyStuff 0.07

2000-10-11 Thread Jason Bodnar

Apache::ProxyStuff is module for adding headers and
footers to content proxied from other web servers. Rather 
than sandwiching the content between the header and footer
it "stuffs" the header and footer into their correct
places in the content -- header after the  tag and
footer before the  tag. This allows you to give
content living on established servers a common look and
feel without making changes to the pages.

Recent Changes:

0.07  Wed Oct 11 18:08:00 2000
  - Added MetaDescription param to add meta tag to  section
  - Added MetaContent param to add meta tag to  section
  - Now handles text seperately from other tags in order to work with new
versions of HTML::TokeParser

0.06  Tue Aug 19 23:36:00 2000
  - Set REMOTE_ADDR, REMOTE_HOST and REMOTE_USER for header and footer requests
  - Added REAL_URI and ORIG_URI headers for header and footer requests




-FW: <[EMAIL PROTECTED]>-

Date: Thu, 12 Oct 2000 01:16:41 +0200
From: PAUSE <[EMAIL PROTECTED]>
To: Jason Bodnar <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
Subject: CPAN Upload: J/JB/JBODNAR/Apache-ProxyStuff-0.07.tar.gz

The uploaded file

Apache-ProxyStuff-0.07.tar.gz

has entered CPAN as

  file: $CPAN/authors/id/J/JB/JBODNAR/Apache-ProxyStuff-0.07.tar.gz
  size: 5278 bytes
   md5: 627453193e4744b430fb3f3eb1c852eb

No action is required on your part
Request entered by: JBODNAR (Jason Bodnar)
Request entered on: Wed, 11 Oct 2000 23:16:27 GMT
Request completed:  Wed, 11 Oct 2000 23:16:41 GMT

Virtually Yours,
Id: paused,v 1.68 1999/10/22 14:39:12 k Exp k 

--End of forwarded message-----

-- 
Jason Bodnar
[EMAIL PROTECTED]



RE: How tp Prevent This

2000-10-09 Thread Jason Bodnar

That'll be fixed in the next version of AuthenCache. Hopefully, due out
sometime this week now that I am unemployed.

On 09-Oct-2000 Sambit Nanda wrote:
> Hi Friends
> I Applied AuthenCache to My Apache 1.3.11 + SSL +
> PERL + Etc, web Server My server is also having
> AuthenSmb with it. What i found When any user sign in
> the user name and password goes to log file. So in my
> log file  some line gets appended whenever any user
> sign in. like this 
> 
> [Sun Oct  8 11:46:29 2000] [warn]
> AuthenCache::manage_cache: username=snanda
> [Sun Oct  8 11:46:29 2000] [warn]
> AuthenCache::manage_cache: added snanda:examplesam
> 31 to the cache
> 
> So this things happen for every user, what i do not
> want. 
> 
>   So Each there any way to stop this thing. Or The
> user name or the Password should not come/write  to
> Log Files 
> 
> 
> Any Help Any Idea. ???
> 
> Thanks 
> 
> Sambit Nanda
> Unix Admin
> 
> ///|||---|||\\\
> \\\---|||---///
> 
> 
> 
> 
> ______
> Do You Yahoo!?
> Yahoo! Photos - 35mm Quality Prints, Now Get 15 Free!
> http://photos.yahoo.com/

-- 
Jason Bodnar
[EMAIL PROTECTED]



Do I need to reinstall mod_perl?

2000-09-15 Thread Jason

I'm on a RaQ4 which comes preinstalled with perl 5.005 and mod_perl 1.24

Whever I test a script, I get this error:

[Thu Sep 14 20:46:54 2000] [error] Can't locate Apache/ASP.pm in @INC (@INC
contains: /usr/lib/perl5/5.00503/i386-linux /usr/lib/perl5/5.00503
/usr/lib/perl5/site_perl/5.005/i386-linux /usr/lib/perl5/site_perl/5.005 .
/etc/httpd/ /etc/httpd/lib/perl) at (eval 43) line 3.


My ASP.pm file is located in this directory:

/usr/local/lib/perl5/site_perl/5.6.0/Apache/ASP.pm


Does this mean I have to reinstall mod_perl to recognize that I'm using a
newer version of Perl, or should I just copy the contents of the Apache
folder into something like /usr/lib/perl5/5.00503 ?

Also, would doing this effect my installation of Apache::ASP?

By the way, thanks for pointing me in the direction Stas Beckman's guide.
It's been really helpful as far as understanding terminology and config
info.

Also, if  you remember, I was the idiot who was having problems with my
httpd.conf -- the reason I was having trouble was that some of my config
info is also stored in a file called access.conf -- I guess some systems use
one httpd.conf, while others use more than one..


Thanks!

Jason






Still having problems with mod_perl and Apache::ASP

2000-09-14 Thread Jason

OK .. you guys are probably sick of me by now ... I think I know what my
problem is.  I need to edit my httpd.conf file.  What do I need to put into
the httpd.conf file to configure mod_perl and what do I do to configure
Apache::ASP -- both are installed on my system.  Also, my httpd.conf has
virtual hosts -- do I need to put the information there or what??

Sorry for being a pain,

Jason

P.S.
Thanks for all the help so far!




RE: How can I tell if Apache::ASP is available?

2000-09-13 Thread Jason

I put that into an HTML file and looked at it in a browser and received this
output:

--begin hello.asp --end hello.asp

is there something else I need to do?

Thanks for all your help guys!


-Original Message-
From: Jerrad Pierce [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 13, 2000 3:12 PM
To: Jason Ables; Jerrad Pierce
Cc: [EMAIL PROTECTED]
Subject: RE: How can I tell if Apache::ASP is available?


Yes.

--begin hello.asp
<%= "Hello World" %>
--end hello.asp

>-Original Message-
>From: Jason [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, September 13, 2000 3:04 PM
>To: 'Jerrad Pierce'
>Cc: [EMAIL PROTECTED]
>Subject: RE: How can I tell if Apache::ASP is available?
>
>
>Thanks .. I typed this:
>[root admin]# perl
>use Apache::ASP;
>print "Hello World\n";
>
>then pressed Ctrl-D, and it output:
>
>Hello World
>[root admin]#
>
>So, I assuming that means it's working.
>
>When I type lwp-request command, I get this:
>
>Connection: close
>Date: Wed, 13 Sep 2000 19:11:26 GMT
>Accept-Ranges: bytes
>Server: Apache/1.3.12 Cobalt (Unix) mod_ssl/2.6.4 OpenSSL/0.9.5a
>PHP/4.0.1pl2 mo
>d_auth_pam/1.0a FrontPage/4.0.4.3 mod_perl/1.24
>
>Which I believe means that mod_perl 1.24 is installed.
>
>So by that rational, can someone on our server now program
>with mod_perl and
>Apache::ASP??
>
>
>-Original Message-
>From: Jerrad Pierce [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, September 13, 2000 2:56 PM
>To: Jason Ables; [EMAIL PROTECTED]
>Subject: RE: How can I tell if Apache::ASP is available?
>
>
>prompt# perl
>use Apache::ASP;
>print "Hello World\n";
>^D
>
>If you get no errors it's there
>
>>-Original Message-
>>From: Jason [mailto:[EMAIL PROTECTED]]
>>Sent: Wednesday, September 13, 2000 2:28 PM
>>To: [EMAIL PROTECTED]
>>Subject: How can I tell if Apache::ASP is available?
>>
>>
>>This is the output of my httpd -l command .. how can I tell if
>>Apache::ASP
>>is available?
>>
>>
>>[admin admin]$ httpd -l
>>bash: httpd: command not found
>>[admin admin]$ /usr/sbin/httpd -l
>>Compiled-in modules:
>>  http_core.c
>>  mod_so.c
>>  mod_perl.c
>>suexec: disabled; invalid wrapper /usr/sbin/suexec
>>[admin admin]$
>>
>




RE: How can I tell if Apache::ASP is available?

2000-09-13 Thread Jason

Thanks .. I typed this:
[root admin]# perl
use Apache::ASP;
print "Hello World\n";

then pressed Ctrl-D, and it output:

Hello World
[root admin]#

So, I assuming that means it's working.

When I type lwp-request command, I get this:

Connection: close
Date: Wed, 13 Sep 2000 19:11:26 GMT
Accept-Ranges: bytes
Server: Apache/1.3.12 Cobalt (Unix) mod_ssl/2.6.4 OpenSSL/0.9.5a
PHP/4.0.1pl2 mo
d_auth_pam/1.0a FrontPage/4.0.4.3 mod_perl/1.24

Which I believe means that mod_perl 1.24 is installed.

So by that rational, can someone on our server now program with mod_perl and
Apache::ASP??


-Original Message-
From: Jerrad Pierce [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 13, 2000 2:56 PM
To: Jason Ables; [EMAIL PROTECTED]
Subject: RE: How can I tell if Apache::ASP is available?


prompt# perl
use Apache::ASP;
print "Hello World\n";
^D

If you get no errors it's there

>-Original Message-
>From: Jason [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, September 13, 2000 2:28 PM
>To: [EMAIL PROTECTED]
>Subject: How can I tell if Apache::ASP is available?
>
>
>This is the output of my httpd -l command .. how can I tell if
>Apache::ASP
>is available?
>
>
>[admin admin]$ httpd -l
>bash: httpd: command not found
>[admin admin]$ /usr/sbin/httpd -l
>Compiled-in modules:
>  http_core.c
>  mod_so.c
>  mod_perl.c
>suexec: disabled; invalid wrapper /usr/sbin/suexec
>[admin admin]$
>




Does anyone know of a Hello World program for mod_perl and Apache::ASP

2000-09-13 Thread Jason

I need a simple script that will test to see if these are working on my
server.





How can I tell if Apache::ASP is available?

2000-09-13 Thread Jason

This is the output of my httpd -l command .. how can I tell if Apache::ASP
is available?


[admin admin]$ httpd -l
bash: httpd: command not found
[admin admin]$ /usr/sbin/httpd -l
Compiled-in modules:
  http_core.c
  mod_so.c
  mod_perl.c
suexec: disabled; invalid wrapper /usr/sbin/suexec
[admin admin]$




Question on installation and location of httd.conf file.

2000-09-12 Thread Jason

Hi .. I hope someone can help me with this problem.

I've been assigned to install Apache::ASP and mod_perl so that one of our
client's can use a program called Hyperseek.

My biggest problem is that I'm not very familiar with the server or the Unix
environment.

Over the past few days, I've managed to install MySQL, DBI module and
DBD::mysql.  I've now run into a problem with Apache::ASP and mod_perl.

When I perform a locate test on my server (RaQ4) for mod_perl, it finds a
bunch of files.  I can also find my Apache::ASP files.

I had the automatically installed via CPAN.pm by doing an install mod_perl
and install Bundle::Apache command.

According to tutorials, I need to edit my httpd.conf file in order activate
Apache and mod_perl.   The problem is that when I try to locate my
httpd.conf file, I can't find it. I also do not have a /usr/local/Apache
folder.  Does this mean Apache isn't installed??

I'm really confused.  Can anyone help me?  Also, is there a way to test that
Apache::ASP and mod_perl are correctly installed and can run scripts?

Your help is very much appreciated.

-- Jason Ables




Re: PUT handling (somewhat off-topic)

2000-09-06 Thread Mark-Jason Dominus


> It worked like a charm, the first time, 

Apparently it works like a charm for everyone but me, since none of
the instructions I've found on the net have admitted the possibility
that anything can go wrong.

Which is why I came here, to bother the experts.

> If it hadn't worked, I probably would've trussed Apache while I made the
> request to see what was going on.

I guess I'll try that, but I'm not expecting much.




Re: PUT handling (somewhat off-topic)

2000-09-06 Thread Mark-Jason Dominus


> > If it hadn't worked, I probably would've trussed Apache while I made the
> > request to see what was going on.
> 
> I guess I'll try that, but I'm not expecting much.

That was the right thing to do.  The problem became apparent right
away: I had another handler installed for a parent directory of the
one I was trying to enable 'PUT' for.

Thanks very much.  Also thanks to Frank Wiles, who pointed my
attention at the relevant part of the manual.




PUT handling (somewhat off-topic)

2000-09-06 Thread Mark-Jason Dominus


I apologize in advance, because this isn't directly related to
mod_perl.  But I really wasn't sure where to ask.  Posting to
comp.infosystems.www.servers.unix didn't produce any result.  There
doesn't seem to be a mailing list for discussion of Apache generally.

I am trying to get apache to invoke a CGI program in response to PUT
requests.  This is a FAQ.  The FAQ instructions are very clear and
straightforward and don't work for me.

I have the following in the VirtualHost section in my httpd.conf:

   Script PUT /cgi-bin/Put

/cgi-bin is ScriptAliased correctly.  /cgi-bin/Put has permissions set
propserly and runs correctly from the shell and also when I send
Apache a GET request for it.

When I send Apache a PUT request using 'telnet', the request is
received.  However, my PUT script does not run.  Instead, Apache
fabricates a 200 response that looks like this:

HTTP/1.1 200 OK
Date: Tue, 05 Sep 2000 08:57:12 GMT
Server: Apache/1.3.6 (Unix) mod_perl/1.19
Connection: close
Content-Type: text/html

the body of the response is empty.

I know that /cgi-bin/Put isn't being run because it would have
produced a 206 response, not a 200 response,  because it would have produced
a nonempty body, and because it would have written a log to
/tmp/Put.err, which it didn't do.

The access log entry looks like this:

209.152.205.5 - - [05/Sep/2000:04:57:12 -0400] "PUT /~mjd/p/index.html 
HTTP/1.0" 200 0 "-" "-"

There is no entry in the error log.

I get the same behavior when I put the 'Script' directive into a
 section and send a PUT request for a file in the
directory.  

I don't want Apache to respond to the PUT request itself.  I want it
to run /cgi-bin/Put and have /cgi-bin/Put generate the response.  The
on-line manual and the FAQ all say that the

   Script PUT /cgi-bin/Put

directive that I have should do that, but it isn't doing it.  Does
anyone have any suggestions about what might be wrong, or about a more
appropriate forum in which to ask?





RE: Help Embperl

2000-08-05 Thread Jason Bodnar

Please send the file for the url you're getting the error with.

On 05-Aug-2000 Jeff Smelser wrote:
> I got EMbperl to compile. It when I did make test, everything went great.
> OK's down the line. I set up apache with:
> 
> 
> SetHandler perl-script
> PerlHandler HTML::Embperl
> 
> 
> This is what apache says when I restarted it:
> 
> [10843]ERR:  25: Line 1: Error 
> [Sat Aug  5 16:10:00 2000] [notice] Apache/1.3.9 (Unix)  (Red Hat/Linux)
> mod_perl/1.21 configured -- resuming normal operations
> 
> This is what it says when I test is with test.html: 
> 
> Bareword found where operator expected at /home/httpd/perl/test.html line
> 3, near "Jeff's"
> (Missing operator before Jeff's?)
> Bareword found where operator expected at /home/httpd/perl/test.html line
> 5, near "/TITLE>
>(Might be a runaway multi-line // string starting on line 4)
> (Missing operator before HEAD?)
> Scalar found where operator expected at /home/httpd/perl/test.html line 7,
> at end of line
> (Missing operator before ?)
> [Sat Aug  5 16:10:07 2000] [error] syntax error at
> /home/httpd/perl/test.html line 2, near "HEAD"
> 
> What did I miss?
> 
> Running embpexec.pl works fine on the same file I am running through
> apache.
> 
> Thanks,
> Jeff
> 
> 
> 

-- 
Jason Bodnar
[EMAIL PROTECTED]



RE: Where are mod_perl coders?

2000-07-20 Thread Jason Murphy

>>>>> "d" == davidu  <[EMAIL PROTECTED]> writes:

d> and have not come across any that have real skills.  Where do all the
d> mod_perl coders hang out?

 (To tell you the truth, I don't know who originally posted this question)

 However, I should point out that when you look for a mod_perl programmer,
that you be a bit open minded.
I personally feel there are few mod_perl coders out there that have "real
skills" when you look at the big picture.

As some others have suggested in other threads that you take a perl coder
or someone willing to learn and teach them mod_perl. When it comes to
mod_perl programmers, there is a limited supply.


 Jason Murphy

 smime.p7s


RE: ORA conference

2000-07-17 Thread Jason Bodnar

Yeah, sorry about that guys. I got cornered by our VP of Business
Development and he poured beer down my throat all night. Hope the Crown
and Anchor worked out fine for you guys.

On Mon, 17 Jul 2000, brian moseley wrote:

> On Mon, 17 Jul 2000, Ask Bjoern Hansen wrote:
> 
> > http://photo.tomat.dk/tpc4/dsc_4552.html
> 
> hey that didn't take long. nice evening of hanging with
> mod_perl buddies. in fact i just left everybody at the pub,
> buncha lushes.
> 
> cutely enough, when i started netscape on this terminal, it
> was set up for jason bodnar's roaming profile.. someone we
> /didn't/ see last night. hm.
> 




RE: ORA conference

2000-07-14 Thread Jason Bodnar

Since nobody had a better idea how about The Crown and Anchor Pub:

http://www.crownandanchor.net/

On 15-Jul-2000 Vivek Khera wrote:
>>>>>> "j" == jbodnar  <[EMAIL PROTECTED]> writes:
> 
> j> Well, perhaps we should organize an informal mod_perl BOF (Beer's
> j> Our Friend) Sunday night? Can anybody remember and recommend a bar
> j> or pub from last year?
> 
> Sounds good.  I don't know of a place, but I'll volunteer to be
> "contact point".  Just leave a message for me at the Marriott.  I
> should roll into town around 6pm-ish.
> 
> -- 
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> Vivek Khera, Ph.D.Khera Communications, Inc.
> Internet: [EMAIL PROTECTED]   Rockville, MD   +1-301-545-6996
> GPG & MIME spoken herehttp://www.khera.org/~vivek/

-- 
Jason Bodnar
[EMAIL PROTECTED]



Re: Idea of an apache module

2000-07-12 Thread Jason Bodnar

On 12-Jul-2000 Rob Tanner wrote:
> --On Wednesday, July 12, 2000 4:14 PM -0700 Pramod Sokke 
> <[EMAIL PROTECTED]> wrote:
> 
>> So is it true that Netscape has a better performance than Apache 1.3?
> 
> But, scalibility in a large site depends an awful lot on all kinds of 
> things over and above the WEB server.


Exactly. When people start talking about Apache vs Netscape vs IIS and don't
even think about other variables point them to this article:

http://cs.alfred.edu/~lansdoct/mstest.html

Unless you're yahoo or aol or ebay web server performance isn't going to be
your bottleneck.

-- 
Jason Bodnar
[EMAIL PROTECTED]



Apache::Leak ouput

2000-06-25 Thread Jason Nugent

Hi, folks,

I had a question regarding the output of Apache::Leak.  I'm testing a
perl module for memory leaks using this module, and I've wrapped my code
inside of a

leak_test {

}

statement.  My error_log file (where the output of the leak_test
function goes) ends up with a rather large number of the following bits
of information:

ENTER: 2740 SVs

new 0x827b018 : new 0x827b03c : new 0x827b048 : new 0x827b060   (many of
these).

LEAVE: 15609 SVs
ENTER: 15609 SVs
new 0x827b0e4 : new 0x827b378 : new 0x827b3b4 : new 0x81c91f8 : new
0x81c29f8 : old (1):
 0 old (1):
 0 old (1):
 0 old (1):
 0 old (1):
 0
LEAVE: 15609 SVs

So, I guess my question is how this all gets interpreted.  the perldoc
for Apache::Leak is a bit sparse, saying:

   use Apache::Leak;

   leak_test {
   my $obj = Foo->new;
   $obj->thingy;
   };
   #now look in error_log for results

so I was wondering if anyone in here had suggestions.

thanks, most appreciated.

Jason





Re: DNS Lookups ? huh ?

2000-06-09 Thread Jason Terry

I do use an allow/deny with a domain name.

My question is, does it only force the lookup for the directory that the rule applies 
to.  Or, does simply having the rule force
lookups on ALL pages?

Thanks for the help
-Jason

- Original Message -
From: "Marc Slemko" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, June 08, 2000 12:42 PM
Subject: RE: DNS Lookups ? huh ?


> On Thu, 8 Jun 2000, Rob Tanner wrote:
>
> > I gotta read messages all the way down before I respond.. Duh.  You said
> > they were off and I told you to turn them off.  That's probably at least
> > three demerits for me.
> >
> > Anyway, unless you have an extremely busy server, those lookups are
> > generally not that expensive.  For instance, I run TCP wrappers on all my
> > inetd monitored ports on all my machines, and I run in paranoid mode (looks
> > up once to get the name and then looks up the name to make sure it gets
> > that same address back -- makes spoofing harder).  This includes just about
> > everything but sendmail and httpd.  Even the pop and imap ports are
> > wrapped.  The impact is negligible.
>
> No, the impact is _HUGE_ in many cases.  The problem is that there
> are many addresses out there with broken reverse DNS, so they can
> take a significant time for the lookup attempt to timeout before
> serving the pages.  You can cry that the remote systems are broken
> until you are blue in the face, and you are right.  That doesn't stop
> you from hurting those users and having them go to another site that
> works for them.  On top of that, it ties up your httpds for longer, which
> is never a good thing.
>
> In addition, most of the time the hostnames are not used for anything, so
> going to the extra pain to log them doesn't make much sense.  And on
> top of it, unless you enable "Hostnamelookups double" (which does a
> reverse lookup then a forward on what it gets), which are even slower,
> then you can end up with a hostname that is completely useless and gives
> you far less information than the IP address would.
>
> If you don't have any hostname based access restrictions, then you don't
> get any security from requiring that the reverse DNS is there.
>
> In any case, the default is off and that is for very good reasons.





$r->print() Fails

2000-06-06 Thread Jason Leidigh



I have a rewriting proxy based on the module of the 
same name by:Mike Reiling, Steve Baker and Tim DiLauro (Many thanks to them 
and I =will be contacting you soon)I have made some modifications 
which SEEM to have disturbed the code.  =The original SEEM to fail in 
the same way (I say seem because =it appears to be irregular).  The 
problem is the following.I capture a request using a the proxy_mod 
internally carry out the =request with LWP and rewrite much of the content 
but when I print the =content to the browser 
using:$r->print("/n$content");The page comes back broken, 
like 
this:Sexoterapiacharset=3Diso-8859-1">framespacing=3D"0">=20  That word marginwidth is not the only 
place the page can break and I =have found that while it very regular per 
session is I change sessions I =can often see a different break point.  
BUT her is the real doozy... if =I porint $content to a Log file right 
before I send it out with =$r->print("/n$content"); it ALWAYS prints 
well.  That is to say that =neither the LWP GET nor and of the 
substitutions are the problem but =some how the sending of the material to 
the browser via Apache...  I =supoose there must be some character 
confusing apache and making it =believe that the file has ended when it has 
not...but I am =stumped!@%^$^!ALSO if I print out the content direct 
from the LWP I get the same =problem.. The page breaks in the browser but is 
perfect in the logI tried something stupid like:$content =3D~ 
s/(\n|\r)/\r/gio;but no luck!I guess my real question is what character 
can fool apache but get =printed to a text file without 
detection...


Re: [benchmark] DBI/preload (was Re: [RFC] improving memory mapping thru code exercising)

2000-06-06 Thread Jason Terry

I just wanted to thank you guys for sending this to the mailing list.

I added these lines to my startup script
use Carp;
CGI->compile(qw(my_common_functions));
DBI->install_driver('mysql');

Please note that these were already existing in my startup script.
use CGI();
use DBI();

And after testing, and running the server with the new settings all night long, it 
seems that I am saving ~2M of RAM for each apache
process.  Again thank you.

However, this has made me curious, and left me wondering...   I have 3 scripts that I 
pre-load in my startup file, would any of my
self-made modules, or other CPAN modules, benefit from including directly in the 
startup script... as opposed to being loaded only
in the pre-loaded scripts themselves?

Again, thank you for this thread it has saved me 20-80M of RAM depending on my current 
load.
-Jason

- Original Message -
From: "Stas Bekman" <[EMAIL PROTECTED]>
To: "Tim Bunce" <[EMAIL PROTECTED]>
Cc: "mod_perl list" <[EMAIL PROTECTED]>
Sent: Sunday, June 04, 2000 1:50 PM
Subject: Re: [benchmark] DBI/preload (was Re: [RFC] improving memory mapping thru code 
exercising)


> On Sun, 4 Jun 2000, Tim Bunce wrote:
>
> > On Sat, Jun 03, 2000 at 02:49:47AM +0300, Stas Bekman wrote:
> > > On Fri, 2 Jun 2000, Perrin Harkins wrote:
> > >
> > > > On Sat, 3 Jun 2000, Stas Bekman wrote:
> > > > > * install_driver  (2):
> > > > >   DBI->install_driver("mysql");
> > > >
> > > > I've never seen that before,
> > >
> > > There is always a first time :)
> > >
> > > > and it isn't in the DBI perldoc.
> > >
> > > Where do you think I've found it :) It is mentioned in DBI manpage:
> > >
> > >DBI->connect automatically installs the driver if it
> > >has not been installed yet. Driver installation always
> > >returns a valid driver handle or it dies with an error
> > >message which includes the string 'install_driver' and
> > >the underlying problem. So, DBI->connect will die on a
> > >driver installation failure and will only return undef
> > >on a connect failure, for which $DBI::errstr will hold
> > >the error.
> >
> > I've been meaning to document it properly for the last couple of
> > years, since I knew people were using it for mod_perl.
>
> I guess most of the mod_perl folks don't use it, since they don't
> know about it. I have discovered it following the Vivek's reply.
>
> > > but actualy it's the DBD:: method.
> >
> > Nope. A DBI->method.
>
> Ok
>
> > > > Is it safer than "use DBD::mysql;"?
> > >
> > > "safer" is the wrong question. It's always used by DBI, but when you call
> > > it at the server startup you get a few more K shared, compared with only
> > > preloading of DBD::mysql.
> >
> > Yes, and the semantics of install_driver are that it'll die if the driver
> > can't be installed, just like 'use'.
> >
> > >  Apache::DBI->connect_on_init('DBI:mysql:test::localhost', [...]
> > >  or DBI->disconnect("Cannot connect to database: $DBI::errstr\n");
> >
> > There's no such method as DBI->disconnect.
>
> Ouch, you are right. But the first part has never failed for me, so I copy
> and paste this old error for years :) Thanks for telling me!
>
> _
> Stas Bekman  JAm_pH --   Just Another mod_perl Hacker
> http://stason.org/   mod_perl Guide  http://perl.apache.org/guide
> mailto:[EMAIL PROTECTED]   http://perl.org http://stason.org/TULARC
> http://singlesheaven.com http://perlmonth.com http://sourcegarden.org




RE: logging bytes served

2000-06-01 Thread Jason Bodnar

$r->log->debug($r->bytes_sent);

On 01-Jun-2000 Paul wrote:
> Is there a simple way already provided to add bytes served a request
> into the log?
> 
> __
> Do You Yahoo!?
> Send instant messages & get email alerts with Yahoo! Messenger.
> http://im.yahoo.com/

-- 
Jason Bodnar + [EMAIL PROTECTED] + Tivoli Systems

I'm sick of eating hoagies!  I want a grinder, a sub, a foot-long
hero!  I want to live, Marge!  Won't you let me live?  Won't you,
please?

-- Homer Simpson
   Fear of Flying




  1   2   3   >