Trouble building HTML_Tree

2000-12-12 Thread Ian Mahuron


Can't load '../blib/arch/auto/HTML/Tree/Tree.so' for module HTML::Tree: 
../blib/arch/auto/HTML/Tree/Tree.so: Undefined symbol
"__builtin_delete" at /usr/libdata/perl/5.00503/DynaLoader.pm line 169.

Any idea?  I'm sure someone has run into this before.

System is FreeBSD 4.1

Thanks in advance.

Ian




Apache::Session - kludgy workaround?

2000-10-04 Thread Ian Mahuron


If I repeatedly write to:

$session{foo}{bar}

I find that I have to do something like:

$session{smack}++;

to get it to write when the hash is untied.  Is there a better way to do this?

TIA

ian



RE: [OT?] Cross domain cookie/ticket access

2000-09-08 Thread Ian Mahuron


Why not do this...

Implement sessions via DBI.  All three servers will use the same table in the same 
database for setting/getting session data (ie
'authenticated_uid' = 1425).

Pass the session id around in the path or in query string.  Make sure your 
applications include this data when linking to the other
servers.

It's too early.. so I doubt this method is without flaws.  Session hijacking comes to 
mind.  Bad juju.




creating db handles externally

2000-08-16 Thread Ian Mahuron


I have the following code in several of my mod_perl handlers:

my $dbh = DBI-connect($c{db}{dsn}, $c{db}{user}, $c{db}{pass})
|| die(DBI::errstr);

Is there a way to do something like:

my $dbh = $MyModules::DBH;

instead of putting connect string in *EVERY* script?

to get the database handle?  Someone mentioned doing a ChildInitHandler and using 
Class::Singleton.. I'm a clueless newbie so I
didn't get too far with this (code snippets anyone?).

TIA

Ian




Apache::Upload buffering issues?

2000-08-15 Thread Ian Mahuron

What is the proper way to take the filehandle provided by $upload-fh and write the 
file to disk?  I seem to be having buffering
issues w/ the following (file is truncated):

if (open(OUTFILE, "$u_fullpath")) {
print OUTFILE $buffer while read($fh, $buffer, 8*1024);
} else {
...
}

a simple $| = 1; before the print didn't seem to help.. maybe OUTFILE is not hot?  
Dunno.. this is my first run in w/ buffering
issues.  I hope someone can help.

TIA

Ian




perldoc gateway/handler

2000-06-29 Thread Ian Mahuron


Does anyone know of a good mod_perl handler or CGI for browsing the perl
docs and various module docs?  I'd prefer to offer this functionality to my
developers on our intranet, rather then sending them off to
http://search.cpan.org

I've also been looking for a good one for system man pages.  The last one I
found had a tendency to break things.

TIA

Ian




Apache::Request

2000-06-25 Thread Ian Mahuron


Is anyone using this module (Apache::Request) in production?  I'm interested
in using it for general client input as well as client uploads.  I'm
terribly concerned about security when it comes to client uploads.  As the
documentation is fairly sparse, does anyone have some snippets of code that
would give me a good idea of how to use this module securely?  I'm also
wondering what the pros/cons are of using this module vs. CGI.pm.

TIA!

Ian




Apache::DBI broken?

2000-06-16 Thread Ian Mahuron


I've been searching through the mailing list and have seen several people
with the same problem I'm experiencing.  Yet I've seen no solid answers to
this problem... so maybe I'll try again.

System is:
FreeBSD 4.0
Apache 1.3.12
perl 5.005_03
mod_perl 1.24
DBI 1.14
Apache::DBI 0.87

# Apache::DBI preloaded via:
use Apache::DBI; # in startup.pl

# DB handles created via:
my $dbh = DBI-connect('...');

Every module that contains DBI-connect causes the server to segfault:
[Fri Jun 16 12:05:41 2000] [notice] child pid 41672 exit signal Segmentation
fault (11)

I wrote up a quick script in perl to test DBI and it works fine.

If any other information is required, please let me know.




RE: Apache::DBI broken?

2000-06-16 Thread Ian Mahuron


Everything except MySQL was built up from sources (no ports).  All modules
are linked static.

As per your advice, I nixed the load of Apache::DBI... and it still
segfaults.. so the problem obviously lies w/ DBI or the DBD for mysql.
Having read more of the mod_perl list archives, it seems that there may be a
bug in the mysql driver (see "Segfault on DBI-Connect (04/01/2000)"
thread).

Considering how recently (and frequently) this has poped up on the list, I
wonder if Indrek is right.. Is php4 the culprit?

Ian

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of
 Edmund Mergl
 Sent: Friday, June 16, 2000 01:31 PM
 To: Ian Mahuron
 Cc: Mailing List, mod_perl
 Subject: Re: Apache::DBI broken?


 Ian Mahuron wrote:
 
  I've been searching through the mailing list and have seen
 several people
  with the same problem I'm experiencing.  Yet I've seen no solid
 answers to
  this problem... so maybe I'll try again.
 
  System is:
  FreeBSD 4.0
  Apache 1.3.12
  perl 5.005_03
  mod_perl 1.24
  DBI 1.14
  Apache::DBI 0.87
 
  # Apache::DBI preloaded via:
  use Apache::DBI; # in startup.pl
 
  # DB handles created via:
  my $dbh = DBI-connect('...');
 
  Every module that contains DBI-connect causes the server to segfault:
  [Fri Jun 16 12:05:41 2000] [notice] child pid 41672 exit signal
 Segmentation
  fault (11)
 
  I wrote up a quick script in perl to test DBI and it works fine.
 
  If any other information is required, please let me know.


 in order to check whether Apache::DBI makes the trouble, just remove
 the 'use Apache::DBI;' from startup.pl and check if the problem
 disappears.

 Do you use statically linked mod_perl or is mod_perl a DSO ?

 Edmund


 --
 Edmund Mergl
 mailto:[EMAIL PROTECTED]
 http://www.edmund-mergl.de
 fon: +49 700 EDEMERGL





RE: Apache::DBI broken?

2000-06-16 Thread Ian Mahuron


It was PHP4.  A rebuild fixed it.  Thanks guys!

 -Original Message-
 From: Ian Mahuron [mailto:[EMAIL PROTECTED]]
 Sent: Friday, June 16, 2000 01:50 PM
 To: Edmund Mergl
 Cc: Mailing List, mod_perl
 Subject: RE: Apache::DBI broken?



 Everything except MySQL was built up from sources (no ports).  All modules
 are linked static.

 As per your advice, I nixed the load of Apache::DBI... and it still
 segfaults.. so the problem obviously lies w/ DBI or the DBD for mysql.
 Having read more of the mod_perl list archives, it seems that
 there may be a
 bug in the mysql driver (see "Segfault on DBI-Connect (04/01/2000)"
 thread).

 Considering how recently (and frequently) this has poped up on the list, I
 wonder if Indrek is right.. Is php4 the culprit?

 Ian

  -Original Message-
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of
  Edmund Mergl
  Sent: Friday, June 16, 2000 01:31 PM
  To: Ian Mahuron
  Cc: Mailing List, mod_perl
  Subject: Re: Apache::DBI broken?
 
 
  Ian Mahuron wrote:
  
   I've been searching through the mailing list and have seen
  several people
   with the same problem I'm experiencing.  Yet I've seen no solid
  answers to
   this problem... so maybe I'll try again.
  
   System is:
   FreeBSD 4.0
   Apache 1.3.12
   perl 5.005_03
   mod_perl 1.24
   DBI 1.14
   Apache::DBI 0.87
  
   # Apache::DBI preloaded via:
   use Apache::DBI; # in startup.pl
  
   # DB handles created via:
   my $dbh = DBI-connect('...');
  
   Every module that contains DBI-connect causes the server to segfault:
   [Fri Jun 16 12:05:41 2000] [notice] child pid 41672 exit signal
  Segmentation
   fault (11)
  
   I wrote up a quick script in perl to test DBI and it works fine.
  
   If any other information is required, please let me know.
 
 
  in order to check whether Apache::DBI makes the trouble, just remove
  the 'use Apache::DBI;' from startup.pl and check if the problem
  disappears.
 
  Do you use statically linked mod_perl or is mod_perl a DSO ?
 
  Edmund
 
 
  --
  Edmund Mergl
  mailto:[EMAIL PROTECTED]
  http://www.edmund-mergl.de
  fon: +49 700 EDEMERGL
 






Object persistence

2000-06-05 Thread Ian Mahuron


Is there any way to implement object persistence with Apache::Session?

I'd like to do something like this (though I'm not sure how):

# during some point in application (throwing object into session data)

my $user = MyMods::User-new();
$user-fetch_by_id(1234);
$session{user} = $user;


# during some other request (pulling object out)

my $user = $session{user};
my $login = $user-login();
print("$login\n");

I'm sure it's more complicated then this.  Any help would be appreciated.
Thank you in advance.

Ian




RE: mod_perl of FreeBSD 4

2000-05-04 Thread Ian Mahuron

 I have freebsd 4, and am going to install mod_perl on it.  If I go to
 /usr/ports/www/mod_perl and do a make, I get v1.21.  But if I go to the
 ftp site it has up to v1.23.  Can I change the ports, or update them to
 get the latest files?

Your question is somewhat off topic but I'll answer it anyway.

Get familiar w/ cvsup to keep your ports tree up to date.

You can download the new(est) mod_perl port from
http://www.freebsd.org/ports (1.22 seems to be the most recent addition.).

Better yet, install Apache and mod_perl from source.




RE: Unknown Error Message

2000-04-24 Thread Ian Mahuron


I get something similar when I wrap my call to Apache::Session::DBI in an
eval to try to catch it die()ing (ie. session id not found).  IIRC, this is
a known bug in perl.


 panic: POPSTACK
 Callback called exit.





RE: :ShareLite and garbage collection

2000-01-11 Thread Ian Mahuron


Does linux have ipcs, ipcrm, etc. for listing/killing IPC resources?  I use
FreeBSD so...  If you're trying to do this programatically w/ perl then
start reading through module sources.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Dave Hodson
Sent: Tuesday, January 11, 2000 9:13 AM
To: [EMAIL PROTECTED]
Subject: IPC::ShareLite and garbage collection


I'm trying to implement IPC::ShareLite on a Red Hat Linux box. I've
successfully stored/fetched the data I want between proc's, and am now
attempting to "clean up" once the httpd is killed/restarted.

Anyone has a good suggestion on how to do this? The POD for ShareLite
doesn't address this topic.

--
Dave Hodson
Vice President of Technology
iPrint, inc
Voice: 650 298.8500 x2480Fax: 650 364.7724
Email: [EMAIL PROTECTED]
Visit iPrint at http://www.iPrint.com





RE: oracle : The lowdown

2000-01-11 Thread Ian Mahuron


From past experiences I'll tell you that PostgreSQL is *dog slow*!  We had a
search engine with about 10,000 entries in it that was being run on MySQL,
moved it to PostgreSQL and *bam*.. even with proper indexing  limiting
queries, it took 2-5 seconds to execute a simple query (server was load
free).  So anyways.. don't waste your time installing PostgreSQL.

I've heard good things about Solid.. so maybe you start there.

Jeff Warner wrote:
   We were a mySQL shop.  We replaced mySQL with Oracle8i/mod_perl and
 and Apache::DBI.  Works great, once it is all setup.  Our overall
 processing is faster with Oracle too.  The lack of transactions and
 views put an immediate end of mySQL once we got into the details of my
 project.

   Oracle is overkill for smaller task but you don't have to worry about
 outgrowing it.

What about PostgreSQL (www.postgresql.org)? It looks like it has transaction
management (commit, rollback) with the whole concurrency control thing. I
don't know if has views. I've got a small project that I am figuring on
using PostgreSQL for, so I'm curious to hear what people might have to say
about it.

Another option to look at is Solid (www.solidtech.com). They just quoted me
their Solid Embedded Server (their name for a database server) for $2,000
per CPU. I used their database server a few years ago and it was very nice.
Back then it cost only $200, too... :-)

 - David Harris
   Principal Engineer, DRH Internet Services





RE: oracle : The lowdown

2000-01-11 Thread Ian Mahuron

Joshua but if you don't need transactions, go with MySQL...

Or sub-selects.. I can't live without sub-selects!



Mason + Apache::Session .. strange problems.

2000-01-10 Thread Ian Mahuron


This will be posted to both the mod_perl and mason mailing lists.

I'm tearing my hair out here.  I'm using Apache::Session with Mason (snippet
of calls to Apache::Session below).  For some reason, when I hit certain
pages with java applets (opencube scroller), and then do a browser "refresh"
(IE5 and NS4.5) Apache::Session die()'s and posts:

[Mon Jan 10 12:27:43 2000] [error] Object does not exist in the data store
at /usr/local/lib/perl5/site_perl/5.005/Apache/Session/DBIStore.pm line 192.

Which typically happens when you request a session id that's not in the
store.  A quick query reveals that the session is still there:

mysql SELECT id, length FROM sessions WHERE id='48434f27feea873a';
+--++
| id   | length |
+--++
| 48434f27feea873a | 41 |
+--++
1 row in set (0.00 sec)

Jumping to a page that pulls the cookie from the browser and spits it out
shows that the cookie holds a new value (ie. bc7d790fa9f76185).  Another
query shows that it exists as well:

mysql SELECT id, length FROM sessions WHERE id='bc7d790fa9f76185';
+--++
| id   | length |
+--++
| bc7d790fa9f76185 | 41 |
+--++
1 row in set (0.00 sec)

From what I've found so far, I can query $session for my _session_id.. then
if I request the cookie containing my session ID, I find that it is unset!
So naturally, another session ID is set and I loose all the old data.

So I have a couple questions here:  How is my cookie getting "unset" /
mangled?  How can I tell which "Object does not exist in the data store"
(ie. logging the session id in the error log)?  What's the best way to debug
this?



### Setting up sessions for mason
my %session;
my $cookie = $r-header_in('Cookie');
$cookie =~ s/SESSION_ID=(\w*)/$1/;

tie %session, 'Apache::Session::DBI', $cookie, {
DataSource = 'dbi:mysql:mydb',
UserName   = 'username',
Password   = 'password'
};
$r-header_out("Set-Cookie" = "SESSION_ID=$session{_session_id};") if
 !$cookie );
local *HTML::Mason::Commands::session = \%session;

$ah-handle_request($r);

untie %HTML::Mason::Commands::session;



RE: Mason + Apache::Session .. strange problems.

2000-01-10 Thread Ian Mahuron


I've got a few things to add..

I wrapped my tie in an eval so I can see what cookie is being set, etc.
It's been a big help for debugging.  This has helped me to discover that the
scroller applet I'm using makes a query to a text file on the server.. so if
I have a page w/ the scroller applet in it, two requests are made to the
handler.. not just one (which makes sense).

Ok..
scenario #1:

I open a fresh browser and go to some generic page w/out the scroller in
it.. session_id is set.. no problems.  Then I go to the page with the
scroller in it.. and still no problems.  Everything is as I would expect it
to be.  The log file shows this when I load and refresh once:

[Mon Jan 10 13:47:57 2000] [info] tie() successful: ''
[Mon Jan 10 13:48:13 2000] [info] tie() successful: '4f6b9edbe40e0c2b'

So the first line is request #1.. and the second line is the refresh.

scenario #2:

I open a fresh browser and go directly to the page with the scroller in it.
The page comes up fine.  When I refresh, the handler bombs.  The log file
shows this:

[Mon Jan 10 13:50:43 2000] [info] tie() successful: ''
[Mon Jan 10 13:50:47 2000] [info] tie() successful: ''
[Mon Jan 10 13:51:54 2000] [error] tie() failed: 'Object does not exist in
the data store at
/usr/local/lib/perl5/site_perl/5.005/Apache/Session/DBIStore.pm line 192.
'
panic: POPSTACK
Callback called exit.

So the first line is request #1.. the second line is the java applet
requesting its file.. the third and all following lines are the result of a
refresh.

It looks like the java applet is causing the server to set a second cookie..
am I correct in assuming this?


Ian



RE: Mason + Apache::Session .. strange problems.

2000-01-10 Thread Ian Mahuron


It turns out that the java applet making another request for a page on the
server was causing my cookie to be reset.  Moving the file it was requesting
out of mason's reach fixed the problem.



RE: Merry f*cking xmas

1999-12-09 Thread Ian Mahuron


Woops.. this wasn't supposed to go here.  I bcc'ed to mod_perl list by
accident.  Sorry everyone.



RE: Upgrading to 1.21-2

1999-11-23 Thread Ian Mahuron


Did you install perl from source?  If you did then RPM is unaware of perl
5.005x being on the box.

As said several times before on the list.. You may want to build perl,
apache, and mod_perl from source.  Odds are, everything will work without a
hitch.

Ian


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Glen Lee Edwards
Sent: Tuesday, November 23, 1999 12:20 PM
To: [EMAIL PROTECTED]
Subject: Upgrading to 1.21-2


I just upgraded to Perl 5.005_03 from 5.004_something.  (I run Red Hat
Apollo (5.2) on my box).  I had to install GLIBC_2.1 and uninstall
mod_perl-1.19-1.  That done, Perl installed with only one hitch, the
following error:

/etc/localtime created as /etc/localtime.rpmnew

Then I tried to install mod-perl-1.21-2.i386.rpm.  It didn't take, but
instead kicked back a "failed dependency error, Perl 5.005_03 needed" or
something to that affect.  perl -v from the command prompt returned
5.005_03 as the current version.  Any suggestions as to why I can't load
the mod_perl-1.21-2... rpm and why I have the correct version of Perl but
it isn't being detected?

Thanks,

Glen





RE: mod_perl starting problems

1999-11-17 Thread Ian Mahuron


Try looking at the error_log.



RE: Trying not to re-invent the wheel

1999-11-12 Thread Ian Mahuron


I've decided to go with Mason.



Trying not to re-invent the wheel

1999-11-10 Thread Ian Mahuron

Hi guys  gals.

I'm writing a mod_perl handler for a ColdFusion'esque embedded scripting
language... I was wondering what the quickest (performance wise) way to
parse through the HTML is.

Embperl documents show that it requires HTML::Parser, though I can't seem to
find where it uses this module to parse documents.

The code in HTML::Template may work.. though it seems that it would be very
slow.

I would appreciate any input the rest of you might have.

Ian Mahuron



RE: Trying not to re-invent the wheel

1999-11-10 Thread Ian Mahuron


As per someone's suggestion I'll ellaborate on what's in the HTML...

Insert code for advertisment (there's 1,000's of different ads on the
site.):
ADVERTISMENT id=252

Insert news scroller:
NEWS_ITEM id=92834 bgcolor="#0066FF"

There will be at least 50 similar tags.. so I'm not parsing for just a
couple of tags like HTML::Template..

I may implement IF/LOOPS/etc.. but not until I see the need.

I've written up a few test benches for HTML::Parser.. it works ok, but it's
not as fast as I would like it to be.

Ian



Quick question from newbie

1999-01-16 Thread Ian Mahuron


I'm using mod_perl and have Apache::DBI in my startup.pl file.

I usually put my DBI-connect line outside of the handler sub... however, I
would like to put the DBI-connect line inside of the sub so I can get the
connection info from a couple of 'PerlSetVar' config directives (similar to
the way edmund mergl does in AuthDBI).

I'm concerned that if I do this without calling disconnect(), I will end up
with a whole bunch of open connections to my DB.  Am I correct in assuming
this?  If so, what's a better way to move the call to connect() outside of
the handler subroutine while still having the ability to use PerlSetVar
config directives to get args for connect()?

Ian