[mp2] win2000 + Apache::DBI + Oracle

2003-06-09 Thread Paul Simon
So, according to the docs,
http://perl.apache.org/docs/2.0/user/performance/mpm.html#Work_with_DataBases_under_Threaded_MPM,
using Apache::DBI doesn't do anything under
mp2+windows2000 ... What is the status of DBI::Pool?
These modules deal mainly with persistent database
connections. Is that correct?

Paul 


[mp2] make test errors

2003-04-03 Thread Paul Simon
Is this something to be worried about? Or can I
continue with make install? Please help.

System: FreeBSD 4.8-RELEASE
Server version: Apache/2.0.45

I received the following summary from make test:

Failed Test   Stat Wstat Total Fail  Failed  List
of Failed
---
apr/perlio.t11   11 100.00%  1-11
apr/threadmutex.t33 100.00%  1-3
4 tests skipped.
*** server localhost:8529 shutdown
!!! error running tests (please examine
t/logs/error_log)
*** Error code 1

The error_log follows:
END in modperl_extra.pl, pid=57443
[Thu Apr 03 19:37:27 2003] [notice] Apache/2.0.45
(Unix) mod_perl/1.99_08 Perl/v5.8.0 configured --
resuming normal operations
[Thu Apr 03 19:37:27 2003] [info] Server built: Apr  3
2003 09:02:09
[Thu Apr 03 19:37:27 2003] [debug] prefork.c(1039):
AcceptMutex: flock (default: flock)
[Thu Apr 03 19:37:28 2003] [error] server reached
MaxClients setting, consider raising the MaxClients
setting
[Thu Apr 03 19:38:37 2003] [info] [client 127.0.0.1]
TestAPI::aplog test in progress
[Thu Apr 03 19:38:37 2003] [debug]
/usr/src/mod_perl-1.99_08/t/response/TestAPI/aplog.pm(43):
log_serror test ok
[Thu Apr 03 19:38:37 2003] [debug]
/usr/src/mod_perl-1.99_08/t/response/TestAPI/aplog.pm(46):
(20007)No time was provided and one was required.:
log_serror test 2 ok
[Thu Apr 03 19:38:37 2003] [debug]
/usr/src/mod_perl-1.99_08/t/response/TestAPI/aplog.pm(49):
[client 127.0.0.1] (20007)No time was provided and one
was required.: log_rerror test ok
[Thu Apr 03 19:38:37 2003] [error] $r-log_error test
ok
[Thu Apr 03 19:38:37 2003] [error] $s-log_error test
ok
[Thu Apr 03 19:38:37 2003] [debug]
/usr/src/mod_perl-1.99_08/t/response/TestAPI/aplog.pm(63):
TestAPI::aplog test done
[Thu Apr 03 19:38:37 2003] [warn] ApacheApache-warn
test ok
[Thu Apr 03 19:38:37 2003] [warn] $s-warn test ok
[Thu Apr 03 19:40:25 2003] [error] [client 127.0.0.1]
mkdir /usr/src/mod_perl-1.99_08/t/htdocs/perlio:
Permission denied at
/usr/src/mod_perl-1.99_08/Apache-Test/lib/Apache/TestUtil.pm
line 128

[Thu Apr 03 19:40:50 2003] [error] [client 127.0.0.1]
Can't locate APR/ThreadMutex.pm in @INC (@INC
contains: /usr/src/mod_perl-1.99_08/t
/usr/src/mod_perl-1.99_08/blib/lib/Apache2
/usr/src/mod_perl-1.99_08/blib/arch/Apache2
/usr/src/mod_perl-1.99_08/Apache-Test/lib
/usr/src/mod_perl-1.99_08/lib
/usr/src/mod_perl-1.99_08/blib/lib
/usr/src/mod_perl-1.99_08/blib/arch
/usr/src/mod_perl-1.99_08/t/response
/usr/src/mod_perl-1.99_08/t/protocol
/usr/src/mod_perl-1.99_08/t/hooks
/usr/src/mod_perl-1.99_08/t/filter
/usr/src/mod_perl-1.99_08/t/htdocs/testdirective/perlmodule-vh
/usr/src/mod_perl-1.99_08/t/htdocs/testdirective/main
/usr/local/lib/perl5/5.8.0/i386-freebsd
/usr/local/lib/perl5/5.8.0
/usr/local/lib/perl5/site_perl/5.8.0/i386-freebsd
/usr/local/lib/perl5/site_perl/5.8.0
/usr/local/lib/perl5/site_perl) at
/usr/src/mod_perl-1.99_08/t/response/TestAPR/threadmutex.pm
line 17.

[Thu Apr 03 19:41:08 2003] [error] Apache::log_error
test ok
[Thu Apr 03 19:44:29 2003] [error] [client 127.0.0.1]
File does not exist:
/usr/src/mod_perl-1.99_08/t/htdocs/nope
[Thu Apr 03 19:45:57 2003] [error] [client 127.0.0.1]
need AuthName: /TestModperl::setauth
[Thu Apr 03 19:46:40 2003] [info] removed PID file
/usr/src/mod_perl-1.99_08/t/logs/httpd.pid (pid=57444)
[Thu Apr 03 19:46:40 2003] [notice] caught SIGTERM,
shutting down
END in modperl_extra.pl, pid=57444

Thanks
Paul


=
'Ideals are like stars. We may never reach them, but we use them to chart our course.' 
-- Unknown


Re: Re-installing 1.99_08 binary or 1.99_05 RPM in Red Hat 8 [mp2]

2003-01-15 Thread Paul Simon
--- Jon [EMAIL PROTECTED] wrote:

 This RPM was working before, so all my messing
 around has broken something 
 I can't find.  If the recommendation is to ditch the
 RPM and proceed with 
 the new binary then that's fine.
 
 thanks again, jon
 
Red Hat's RPM seems very friendly at first then it
turns into the devil from hell, at least for me :) I
had the same problem as you when installing Perl 5.8
and apache/mod_perl on RH 7.1 using RPM. Everything
was a dependency issue and got F'ed up. I finally
learned how to build from source...   




Apache::DBI

2003-01-02 Thread Paul Simon
Hi all

I have a feeling this may be [OT], take it to the DBI
list... But I'm hoping to eliminate as much as
possible any suspicion that Apache::DBI/mod_perl is
causing my headache. I'm trying to push this platform
at work ;) If anyone can shed some light on this then
I'd be very appreciative, of course. 

I have what's becoming a reoccuring problem with an
app running under:

Apache/2.0.42 (Win32) mod_perl/1.99_08-dev Perl/v5.8.0


I'm using Apache::compat and Apache::DBI for
persistent database connections. 

Here are the configurations in the httpd.conf file:

#
LoadFile C:/Perl/bin/perl58.dll
LoadModule perl_module modules/mod_perl.so
 PerlOptions +Parent  
 PerlInterpStart 10
 PerlInterpMax 50
 PerlInterpMaxSpare 25 
PerlRequire C:/Apache2pl/conf/startup.pl
#-

The startup.pl looks like this:
#-
#!C:/Perl/bin/Perl.exe
use Apache2();
use lib('/Apache2pl/lib/perl/Apache');


use ModPerl::Registry();
use Apache::compat;
use Apache::DBI;
use DBI;
use DBD::ODBC;
use HTML::Template;
use CGI::Lite;

#$Apache::DBI::DEBUG = 2;

use Standard3;

1;
#-

For completeness sake, here's the connection string:
my $DBH  = DBI-connect(DBI:ODBC:$db, $user, $pass,
{ RaiseError = 1, PrintError = 1, AutoCommit = 1 })
or print( Unable to connect to Database:
$DBI::errstr\n ) ;

Finally, the error message I'm getting is:

DBI-connect(pdb9) failed:
[Oracle][ODBC][Ora]ORA-12535: TNS:operation timed out
(SQL-S1000)(DBD: db_login/SQLConnect err=-1) at
/Apache2/lib/perl/Apache/Standard3.pm line 29 

This problem goes away if the ORacle server(on it's
own hardware running windows 2000 pro) is restarted.
The last time this happened the box Oracle resides on
needed a cold reboot! So far, I haven't had to restart
apache.

Could Apache::DBI or mod_perl2 cause this behavior?

Paul 



windows and apache/mod_perl?

2002-12-16 Thread Paul Simon
Is it worth installing apache 1.x and mod_perl 1.x on
windows if apache2/mod_perl2/perl5.8 run on windows?

Thanks



Trouble using mod_perl and IE5.x, IE6.x

2002-11-07 Thread simon

Hi,
I'm using Apache 1.3.26, mod_perl 1.26 and perl 5.6.1 on a HPUX 11
system.
My program genarate HTML page with perl cgi.

Sometimes, html pages are lost by the IE browser :
Internet  Explorer chooses to display the default Microsoft internal
server error  page instead of the generate HTML page.
This HTML page is well generated but the code is in the error_log file
of the http server.
This trouble don't appear every time on the same page.
There is no trouble with Netscape 7.


Thanks in advance for your help
Regards

Christophe




Re: Trouble using mod_perl and IE5.x, IE6.x

2002-11-07 Thread simon
Hello,
I'm not generating an error page.
The trouble occurs for sample with this little simple script (sometime on 1 browser 
using 16 browsers simultanly for sample) :

print(html);
sleep (5);
print(head);
print(titleTITRE DE LA PAGE\/title);
print (META http-equiv=\PRAGMA\ content=\NO-CACHE\);
print(\/head);
print(body bgcolor=\red\);
print (SAMPLE TROUBLE HTML PAGE);
print(\/body);
sleep (5);
print (\/html);


Thanks for your help.
Christophe.


Per Einar Ellefsen wrote:

 Hello Christophe,

 At 11:55 07.11.2002, simon wrote:

 Hi,
 I'm using Apache 1.3.26, mod_perl 1.26 and perl 5.6.1 on a HPUX 11
 system.
 My program genarate HTML page with perl cgi.
 
 Sometimes, html pages are lost by the IE browser :
 Internet  Explorer chooses to display the default Microsoft internal
 server error  page instead of the generate HTML page.
 This HTML page is well generated but the code is in the error_log file
 of the http server.
 This trouble don't appear every time on the same page.
 There is no trouble with Netscape 7.

 If it is an error page you are generating (it seems like it), you have hit
 a known problem with IE described with a solution here:
 
http://perl.apache.org/docs/tutorials/client/browserbugs/browserbugs.html#Internet_Explorer_disregards_your_ErrorDocuments

 --
 Per Einar Ellefsen
 [EMAIL PROTECTED]

--
Christophe SIMON

EVER TEAM
Knowledge Into Action
Immeuble l'Aquilon - 40 b rue de la Villette 69425 LYON Cedex 03 - FRANCE
Tél. : +33 (0)4 26 68 33 00 - Fax  : +33 (0)4 26 68 33 16
mailto:c.simon;ever-team.com - Site Web : http://www.ever-team.com





Re: current state of conf/code, feedback?

2002-10-16 Thread Paul Simon
I was cruising with Apache::DBI, definitely better than the way I had it, but now suddenly I'm getting this error:
DBD::ODBC::dr FETCH failed: handle 1 is owned by thread 1e90bdc not current thread b0f18c (handles can't be shared between threads and your driver may need a CLONE method added) at C:/Perl/site/lib/Apache/DBI.pm line 64. 
What's going on?
Perrin Harkins [EMAIL PROTECTED] wrote:
Paul Simon wrote: I currently have CGI pages caching on the client side, which  is helping some, but I'm also going to experiment with CGI::Cache. There are some mod_perl specific version of this too, like the one from the mod_perl Developer's Cookbook (Apache::CacheContent), but these are mod_perl 1.x and probably require work to get them running on mod_perl 2. Traditionally this has mostly been done with a caching reverse proxy, and that's another angle you could try. What kind of trouble is  there for having use DBI and use HTML::Template in both startup.pl and  Snoopy.pm (besides being redundant)?None. That is the right thing to do, because it preloads the modules (by having them in startup.pl) and documents the dependencies (by putting in Snoopy.pm). Since Snoopy.pm is the meat and  pototoes, should it also be in startup.pl?Yes. Does declaring Class  variables, such as the DBI handle, offer any benefits (or pain) of a  shared connection? You're getting yourself into major trouble there. You should use Apache::DBI instead. The way you have it now (with the connection code in the "main" section of Snoopy.pm), that database connection will be created when you use the module in startup.pl. Apache will then fork and multiple children will try to share the same $DBH. Disaster.Also, your solution will not try to reconnect if it loses its connection. Apache::DBI will. And you are creating a closure here with your $DBH which might come back to bite you later if your module gets automatically reloaded when you change it.- Perrin

current state of conf/code, feedback?

2002-10-15 Thread Paul Simon
Hi all
I'm asking for some insight, guidance, comments from the list. 
I'm currently running a pilot appunder win2000 + apache 2.0.42 + perl5.8 + mod_perl. Mostly, it's running great, much faster than the vanilla CGI version. I think the database connection is slowing it down though... I currently have CGI pages caching on the client side, which is helping some, but I'm also going to experiment with CGI::Cache.
The application uptime is 2 weeks, but that's includingprayers.
Here are the specifics. 
In the http.conf, I have:
LoadFile "C:/Perl/bin/perl58.dll"LoadModule perl_module modules/mod_perl.soPerlRequire "C:/Apache2/conf/startup.pl"PerlInterpStart 5PerlInterpMaxSpare 5PerlInterpMax 20PerlInterpMaxRequests 5
In an included snoopy.conf:
Alias /snoopy/ "C:/Apache2/application/snoopy2/"Location "/snoopy/" ExpiresActive On ExpiresDefault "now plus2 days" SetHandler perl-script PerlResponseHandler ModPerl::Registry PerlOptions +ParseHeaders Options +ExecCGI/Location
In the startup.pl:
#!C:/Perl/bin/Perl.exeuse Apache2();use ModPerl::Registry ();use DBI;use DBD::ODBC;use HTML::Template;1;
I'm running the app under ModPerl::Registry (evident enough). The bulk of it is in Snoopy.pm, which Iimplement via OO method calls. Currently, each of 5 cgi pageshas ause Snoopy.pm at the top.
The beginning of Snoopy.pm, before the actual methods,looks like:
# Since each CGI page has use Snoopy.pm, I put these directives at the top of# Snoopy module.I thought itmight be more efficient to have them in one place, # instead ofrepeating them in each of the 5 CGI pages.use CGI::Lite;use HTTP::Date;use DBI;use HTML::Template;use HTML::Parser;
package Snoopy;use strict;
#--# Class Data#--###connect to ODBC-ORACLE my $db = ''; my $user = ''; my $pass = ''; my $DBH = DBI-connect("DBI:ODBC:$db", $user, $pass, { RaiseError = 1, PrintError = 1, AutoCommit = 1 }) or die( "Unable to connect to Database: $DBI::errstr\n" ) ; $DBH-{LongReadLen} = 1;
 our $AUTOLOAD;
 ### Set the tracing level to 2 and prepare #DBI-trace( 1, 'dbitrace2.log' ); #--sub new{ my ($class, @args) = @_; my $obj = {};
 # Bless the hash reference obj. Create an object. bless $obj, $class;  $obj-{dbh} = \$DBH;   # Call _init $obj-_init(@args);
 # return Object. return $obj;}
methods ...
1;
Is there anything here that spells trouble? What kind of troubleis therefor having use DBI and use HTML::Templatein bothstartup.pl and Snoopy.pm (besides being redundant)?Since Snoopy.pm is the meat and pototoes, should it also be in startup.pl? Does declaring Class variables, such as the DBI handle, offer any benefits (or pain)of a shared connection? 
Are there anyobvious (or not soobvious)issues with these configurations or codethatshould be knocking me in the head?
Thanks,Paul

Re: Apache::DBI for persistent connections

2002-10-15 Thread Paul Simon
I was under the impression that Apache::DBI isn't compatible for this set up:
win2000 + apache2.0.42 + perl5.8 + mod_perl1.99
For a multi threaded environment, isn't Apache::DBIPool necessary? I'd rather use Apache::DBI.
Rafiq Ismail [EMAIL PROTECTED] wrote:
On Tue, 15 Oct 2002, Paul Simon wrote: variables, such as the DBI handle, offer any benefits (or pain) of a shared connection?You might want to try using Apache::DBI for persistent connections.It is completely transparent to your code, in terms of changes.R.-- Senior ProgrammerBookings.nl--Me::[EMAIL PROTECTED]||www.dreamthought.comBudget hosting on my 10Mbit/backbone::[EMAIL PROTECTED]

Re: current state of conf/code, feedback?

2002-10-15 Thread Paul Simon
I have no choice about the win thing. I'd feel much happier using linux and mod_perl 1.x as you suggest. 
I'm terribly frightenedaboutonly having2 weeks of uptime -that's what the prayings for :) But I'm putting my faith in this very new software and the wonderful people who have been cultivating and supporting it.
I wrecked that bike on my home from the universitysome years ago... It was my first and last motorcycle.
Thanks for the feedback,Paul
Ged Haywood [EMAIL PROTECTED] wrote:
Hi there,On Tue, 15 Oct 2002, Paul Simon wrote: I'm currently running a pilot app under win2000 + apache 2.0.42 + perl5.8 + mod_perl. Is there anything here that spells trouble?That win...thing?Seriously though, you're using very new software. If you want realstability I'd suggest Linux and versions 1.x of mod_perl and Apachemight be a shade more reliable at present. But if you are happy witha couple of weeks of uptime (I like to measure it in years...:) thenyou should be fine with what you're using.73,Ged.PS: Which bike got wrecked?

Re: current state of conf/code, feedback?

2002-10-15 Thread Paul Simon
I'm going to change the DBH code. I've witnessed a few problemsso far where the DBHhas crapped out. I'll try Apache::DBI. 
I've been wrapping my head around thereverse proxy cache, I have it set up on my home servers.It seems to be a really good solutionfor caching, but it'sfurther down the road for me... In the meantime, I'm going to try the CGI::Cache.
Got some work to do :)
Thanks for the tips and explanations,Paul
Perrin Harkins [EMAIL PROTECTED] wrote:
Paul Simon wrote: I currently have CGI pages caching on the client side, which  is helping some, but I'm also going to experiment with CGI::Cache. There are some mod_perl specific version of this too, like the one from the mod_perl Developer's Cookbook (Apache::CacheContent), but these are mod_perl 1.x and probably require work to get them running on mod_perl 2. Traditionally this has mostly been done with a caching reverse proxy, and that's another angle you could try. What kind of trouble is  there for having use DBI and use HTML::Template in both startup.pl and  Snoopy.pm (besides being redundant)?None. That is the right thing to do, because it preloads the modules (by having them in startup.pl) and documents the dependencies (by putting in Snoopy.pm). Since Snoopy.pm is the meat and  pototoes, should it also be in startup.pl?Yes. Does declaring Class  variables, such as the DBI handle, offer any benefits (or pain) of a  shared connection? You're getting yourself into major trouble there. You should use Apache::DBI instead. The way you have it now (with the connection code in the "main" section of Snoopy.pm), that database connection will be created when you use the module in startup.pl. Apache will then fork and multiple children will try to share the same $DBH. Disaster.Also, your solution will not try to reconnect if it loses its connection. Apache::DBI will. And you are creating a closure here with your $DBH which might come back to bite you later if your module gets automatically reloaded when you change it.- Perrin

Re: Response Headers

2002-10-04 Thread Paul Simon

Randy Kobes <[EMAIL PROTECTED]>wrote:

On Thu, 3 Oct 2002, Paul Simon wrote:  How do HTTP headers work under Registery::ModPerl? set up: windows2000 apache2.0.42 mod_perl/1.99_08-dev Perl/v5.8.0  I had to comment out the following in the CGI script:  #print "Expires: " . time2str( time() + 432000 ) . "\n"; #print "Content-type: text/html\n\n";  because it would print out as content to the browser??  This is in the conf file:  Alias /standards/ "C:/Apache2/application/standards2/"  SetHandler perl-script PerlResponseHandler ModPerl::Registry #PerlOptions +ParseHeaders Options +ExecCGI   If somebody could point me in the right direction -  Thanks.If you send the headers yourself, as, eg,print "Content-type: text/html\n\n";in the script, then you should havePerlOptions +ParseHeaders in the relevant section. If you don't send the header yourself,Apache will send one for you, based on, in particular, theDefaultType setting. In this case you shouldn't havePerlOptions +ParseHeadersin that section. As you found, other combinations can leadto a double set of headers sent, resulting in one ofthem appearing in the browser.-- best regards,randy kobes
I have a pilot web app running with the above set-up (It's working really well, *fingers crossed*). 
I understand your explanation. I'm still having problems with sending an Expires in the header. You mentioned, "Apache will send one for you, based on, in particular, the DefaultType setting."
Can Iconfigurethe DefaultType in apache?
The way I have it now is:print "Content-type: text/html\n\n";in the CGI scriptAnd in the conf file:
Location "/standards/" SetHandler perl-script PerlResponseHandler ModPerl::Registry PerlOptions +ParseHeaders Options +ExecCGI/Location
Here's the response headerfrom the server:
HTTP/1.1 200 OKDate: Fri, 04 Oct 2002 13:40:30 GMTServer: Apache/2.0.42 (Win32) mod_perl/1.99_08-dev Perl/v5.8.0Connection: closeContent-Type: text/html; charset=ISO-8859-1
My current goalis to cache the pages on the client browser. Ultimately, I'd like to cache on the server side too ( as you would've guessed :) )I'm learning as I go... Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!

Re: Response Headers

2002-10-04 Thread Paul Simon
Ok. I answered my own question, using mod_expires. A little off OT...
Paul Simon <[EMAIL PROTECTED]>wrote:

 
Randy Kobes <[EMAIL PROTECTED]>wrote: 

On Thu, 3 Oct 2002, Paul Simon wrote:  How do HTTP headers work under Registery::ModPerl? set up: windows2000 apache2.0.42 mod_perl/1.99_08-dev Perl/v5.8.0  I had to comment out the following in the CGI script:  #print "Expires: " . time2str( time() + 432000 ) . "\n"; #print "Content-type: text/html\n\n";  because it would print out as content to the browser??  This is in the conf file:  Alias /standards/ "C:/Apache2/application/standards2/"  SetHandler perl-script PerlResponseHandler ModPerl::Registry #PerlOptions +ParseHeaders Options +ExecCGI   If somebody could point me in the right direction -  Thanks.If you send the headers yourself, as, eg,print "Content-type: text/html\n\n";in the script, then you should havePerlOptions +ParseHeaders in the relevant section. If you don't send the header yourself,Apache will send one for you, based on, in particular, theDefaultType setting. In this case you shouldn't havePerlOptions +ParseHeadersin that section. As you found, other combinations can leadto a double set of headers sent, resulting in one ofthem appearing in the browser.-- best regards,randy kobes
I have a pilot web app running with the above set-up (It's working really well, *fingers crossed*). 
I understand your explanation. I'm still having problems with sending an Expires in the header. You mentioned, "Apache will send one for you, based on, in particular, the DefaultType setting."
Can Iconfigurethe DefaultType in apache?
The way I have it now is:print "Content-type: text/html\n\n";in the CGI scriptAnd in the conf file:
Location "/standards/" SetHandler perl-script PerlResponseHandler ModPerl::Registry PerlOptions +ParseHeaders Options +ExecCGI/Location
Here's the response headerfrom the server:
HTTP/1.1 200 OKDate: Fri, 04 Oct 2002 13:40:30 GMTServer: Apache/2.0.42 (Win32) mod_perl/1.99_08-dev Perl/v5.8.0Connection: closeContent-Type: text/html; charset=ISO-8859-1
My current goalis to cache the pages on the client browser. Ultimately, I'd like to cache on the server side too ( as you would've guessed :) )I'm learning as I go... 


Do you Yahoo!?New DSL Internet Access from SBC  Yahoo!Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!

Another header question

2002-10-04 Thread Paul Simon
Is it possible for me to create aContent-Length header for aCGI script via ModPerl::Registry or Apache?
PaulDo you Yahoo!?
New DSL Internet Access from SBC & Yahoo!

install/config mod_perl-2(1.99_08)

2002-10-03 Thread Paul Simon
Is there something in the configuration not jiving?
Windows 2000, Apache 2.0.42, mod_perl-2(1.99_08-dev via ppm)
In http.conf I have:Include conf/test.confAddHandler cgi-script .cgiIn test.conf I have:PerlRequire "C:/Apache2/conf/startup.pl"Location /test/ Options +ExecCGI SetHandler perl-script PerlResponseHandler ModPerl::Registry PerlOptions +ParseHeaders/Location#ScriptAlias /test/ "C:/Apache2/htdocs/test/"
startup.pl looks like:#!C:/Perl/bin/Perl.exeuse Apache2();use ModPerl::Registry ();1;
Apache starts up. I can see mod_perl loaded in via server-status. And when I call just the directory /test/, this what I get in the error log:
[error] 1932: ModPerl::Registry: C:/Apache2/htdocs/test/ not found or unable to stat
If I try to call index.cgi under /test/index.cgi, the page just hangs.index.cgi works as a straight CGI page. Here it is:#!C:/Perl/bin/Perl.exe
 print "Content-type: text/plain\n\n"; print "mod_perl 2.0 rocks!\n";
--- I'll keep trying. Hopefully, there's an easy solution to this. Thanks.Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!

Re: install/config mod_perl-2(1.99_08)

2002-10-03 Thread Paul Simon
Randy Kobes <[EMAIL PROTECTED]>wrote: 

On Thu, 3 Oct 2002, Paul Simon wrote:  Is there something in the configuration not jiving?  Windows 2000, Apache 2.0.42, mod_perl-2(1.99_08-dev via ppm)  In http.conf I have: Include conf/test.conf AddHandler cgi-script .cgi  In test.conf I have: PerlRequire "C:/Apache2/conf/startup.pl"  Options +ExecCGI SetHandler perl-script PerlResponseHandler ModPerl::Registry PerlOptions +ParseHeaders  #ScriptAlias /test/ "C:/Apache2/htdocs/test/"  startup.pl looks like: #!C:/Perl/bin/Perl.exe use Apache2(); use ModPerl::Registry (); 1;  Apache starts up. I can see mod_perl loaded in via server-status. And when I call just the directory /test/, this what I get in the error log:  [error] 1932: ModPerl::Registry: C:/Apache2/htdocs/test/ not found or unable to statThis is OK - you normally don't want a directory listingfor locations that have scripts in them. If I try to call index.cgi under /test/index.cgi, the page just hangs. index.cgi works as a straight CGI page. Here it is: #!C:/Perl/bin/Perl.exe  print "Content-type: text/plain\n\n"; print "mod_perl 2.0 rocks!\n";  --- I'll keep trying. Hopefully, there's an easy solution to this. Thanks.Maybe not easy :) Using perl-5.6.1, and Apache-2.0.42, I foundthe above to also hang ... However, it worked as expected usingthe perl-5.8/Apache2 binary of perl-5.8-win32-bin.tar.gz underftp://theoryx5.uwinnipeg.ca/pub/other/. As there's issues withthreads on Win32 with perl-5.6.1, eventually perl-5.8 will be therecommended Win32 Perl for mod_perl-2; if possible, you may wantto give this a try.-- best regards,randy kobes

Almost easy. I have it running now with perl5.8.I'm going to pilot it...Thanks.PaulDo you Yahoo!?
New DSL Internet Access from SBC & Yahoo!

Response Headers

2002-10-03 Thread Paul Simon
How do HTTP headers work under Registery::ModPerl?set up: windows2000 apache2.0.42 mod_perl/1.99_08-dev Perl/v5.8.0
I had to comment out the following in the CGI script:
#print "Expires: " . time2str( time() + 432000 ) . "\n";#print "Content-type: text/html\n\n";
because it would print out as content to the browser??
This is in the conf file:
Alias /standards/ "C:/Apache2/application/standards2/"Location "/standards/" SetHandler perl-script PerlResponseHandler ModPerl::Registry #PerlOptions +ParseHeaders Options +ExecCGI/Location
If somebody could point me in the right direction -
Thanks.Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!

win32 apache2.0.40 mod_perl-2

2002-08-16 Thread Paul Simon
Hi all
I upgraded from apache2.0.39 to 40 and removed, installed mod_perl-2 via ppm. 
NowmyApache::Registry directory is not responding. The browser just hangs. Any tips on how I can troubleshoot this?
Everything isset up the way I had it workingfor2.0.39 and mod_perl-2
Thanks,paulDo You Yahoo!?
HotJobs, a Yahoo! service - Search Thousands of New Jobs

Re: win32 apache2.0.40 mod_perl-2

2002-08-16 Thread Paul Simon
They do work as ordinary CGI scripts (thank goodness!). The same scripts worked under ModPerl::Registry before I upgraded everything. There are no messages in the error logs.
If I call the cgi page under ModPerl::Registry via a browser, it just hangs seemingly forever... 
I can tryinstalling a simple hello worldhandler, skipping ModPerl::Registry, and see if that works...
Thanks
Randy Kobes <[EMAIL PROTECTED]>wrote:
On Fri, 16 Aug 2002, Paul Simon wrote:  Hi all  I upgraded from apache2.0.39 to 40 and removed, installed mod_perl-2 via ppm.  Now my Apache::Registry directory is not responding. The browser just hangs. Any tips on how I can troubleshoot this?  Everything is set up the way I had it working for 2.0.39 and mod_perl-2   Thanks, paulIn addition to what Stas suggested ...- do you mean ModPerl::Registry scripts?- do the scripts still work under ordinary cgi?- are there any useful messages in the error log?-- best regards,randy kobesDo You Yahoo!?
HotJobs, a Yahoo! service - Search Thousands of New Jobs

PerlResponseHandler ?

2002-08-15 Thread Paul Simon
Hi All
Can somebody answer this for me? Here are two directivesfor separate directories(1 and 2) torun under ModPerl::Registry (ModPerl::Registry is being called in via a perl startup.pl):
Location /mydir1 SetHandler perl-script PerlResponseHandler ModPerl::Registry PerlOptions +ParseHeaders Options +ExecCGI/Location
Location /mydir2 SetHandler perl-script PerlResponseHandler ModPerl::Registry PerlOptions +ParseHeaders Options +ExecCGI/Location
I'm wondering, Is it better to create one directive like
Location /perl SetHandler perl-script PerlResponseHandler ModPerl::Registry PerlOptions +ParseHeaders Options +ExecCGI/Location
and put /mydir1 and /mydir2 in the /perl directory? Is it just a matter of managing directories or is there a memory or performance issue? I'd prefer to use the separate directive approach, but I want to make sure it's not causing extra overhead.
ThanksDo You Yahoo!?
HotJobs, a Yahoo! service - Search Thousands of New Jobs

Re: variables not changing with modperl??

2002-08-13 Thread Paul Simon
Hi darren
Did you try starting apache with "httpd -X". It spawns only one process and that helps keep things inorder, as far as variable values. You can try trouble shooting with that.
darren chamberlain <[EMAIL PROTECTED]>wrote:
* Michael Drons <[EMAIL PROTECTED]>[2002-08-13 01:55]: Thanks for the link. I actually don't use functions. Everything is mostly in MAIN. Here is a snip of code: #!/usr/bin/perl -wT use strict; print ""; my $r = Apache-request; $r-content_type("text/html"); $r-status(200); my $auth_type = $r-auth_type; $cookie=$auth_type-key; ($user,$hash)=split(/:/,$cookie); read(STDIN, my $buffer, $ENV{'CONTENT_LENGTH'}); my @pairs = split(//, $buffer); foreach my $pair (@pairs) {  } What I am doing wrong? Everytime the script runs the values of the variables coming in change. Should I use the delete function and delete all of the variables at the end of the script? @pairs is what should change, but sometimes does not. I have tried to add a undef @pairs before the split, but no luck.Are you sure that this is the code that is running? It doesn't compile:$ perl#!/usr/bin/perl -wTuse strict;print "";my $r = Apache-request;$r-content_type("text/html");$r-status(200);my $auth_type = $r-auth_type;$cookie=$auth_type-key;($user,$hash)=split(/:/,$cookie);read(STDIN, my $buffer, $ENV{'CONTENT_LENGTH'});my @pairs = split(//, $buffer);foreach my $pair (@pairs) { }Global symbol "$cookie" requires explicit package name at - line 7.Global symbol "$user" requires explicit package name at - line 8.Global symbol "$hash" requires explicit package name at - line 8.Global symbol "$cookie" requires explicit package name at - line 8.Execution of - aborted due to compilation errorsMake those global symbols ($cookie, $user, and $hash) lexical (declarewith my) and the code will both compile and do what you expect (i.e.,not maintain values from call to call).You'll also want to print things *after* you set the content type andstatus, not before.(darren)--The biggest difference between time and space is that you can'treuse time.-- Merrick FurstDo You Yahoo!?
HotJobs, a Yahoo! service - Search Thousands of New Jobs

Re: Fwd: Re: Apache::DBI as a prerequisite

2002-08-01 Thread Simon Perrault

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On July 30, 2002 10:02 pm, Stas Bekman wrote:
 2) See http://perl.apache.org/docs/2.0/devel/testing/testing.html
 Though you can really rely on it once Apache::Test is released, which
 will happen when mod_perl 2.0 is released.
 1) That's an interesting problem. It seems that nobody has asked this
 question before. Here is my take on it. If you like this solution I'll
 add it to the docs.

Thanks a lot. Your solution for Apache::DBI works and is very Perlish!

- -- 
Simon Perreault [EMAIL PROTECTED]
Web: http://www.linuxquebec.com/~nomis80
PGP: $Web/nomis80.gpg
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE9R94IqaCdwBMK2KkRAn9IAKCJ7UlIztV6MlThz8Y79b7+FbEGAQCZAdE+
3yP5wB/0udz2Rkgkvh+2S4U=
=ETSh
-END PGP SIGNATURE-



Fwd: Re: Apache::DBI as a prerequisite

2002-07-30 Thread Simon Perreault

Could you please take a look at this problem? Thanks.

- Forwarded message from Stas Bekman [EMAIL PROTECTED] -
Date: Mon, 29 Jul 2002 09:56:05 +0800
From: Stas Bekman [EMAIL PROTECTED]
Reply-To: Stas Bekman [EMAIL PROTECTED]
 Subject: Re: Apache::DBI as a prerequisite
  To: Simon Perrault [EMAIL PROTECTED]

Simon, please repost to the modperl list and we will discuss it there. 
Thanks.

Simon Perrault wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Hi,
 
 You wrote on 2002-04-30 to apache-modperl about Apache::DBI not being testable 
 while not under mod_perl. You said this:
 
 
That's normal. You cannot test modules that use mod_perl API without 
running them inside mod_perl server. I've the same problem as you've 
reported. This test suite is simple broken.
...
All Apache:: module authors should be moving to use the new Apache::Test 
framework soon, since it lets you test the code under running mod_perl 
server and works with both versions of httpd/mod_perl.
 
 
 This is exactly my situation. I develop a module which requires Apache::DBI, 
 so I include it in my Makefile.PL like this:
 
 WriteMakefile(
 'PREREQ_PM'= {
 'Apache::DBI'   = 0,
 },
 );
 
 But that prints a warning because Apache::DBI can't find Apache::module(), 
 which is only available under mod_perl.
 
 My question:
 1) Can you tell me (or guide me toward some information) how I can properly 
 add Apache::DBI as a prerequisite so that it doesn't print a warning (which 
 is the subjet of 90% of user emails)?
 2) How can I test my module running Apache::DBI with Apache::Test?
 
 Thanks a lot
 
 - -- 
 Simon Perreault [EMAIL PROTECTED]
 Web: http://www.linuxquebec.com/~nomis80
 PGP: $Web/nomis80.gpg
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.0.6 (GNU/Linux)
 Comment: For info see http://www.gnupg.org
 
 iD8DBQE9QwYAqaCdwBMK2KkRAt+pAJ9knR94Tz5jmBFCyO/hL/fNWwHzmwCfZSl0
 66Chb76wE6YcgR6JbxYpQEc=
 =4xfy
 -END PGP SIGNATURE-



-- 


__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

- End forwarded message -


-- 
Simon Perreault [EMAIL PROTECTED]
Web: http://www.linuxquebec.com/~nomis80
PGP: $Web/nomis80.gpg



Re: Cheap and unique

2002-05-07 Thread Simon Oliver

 [EMAIL PROTECTED] wrote:
 digest source might be able to locate the bits just by trying a lot of
 them. I would expire them after a while just to prevent that from
 happening by stating that if there is a 15 minute session, new random bits
 are generated each five minutes.

I missed the start of this thread, but how about generating a new id (or
random bits) on every vists: on first connect client is assigned a session
id, on subsequent connects, previous id is verified and a new id is
generated and returned.  This makes it even harder to crack.

--
  Simon Oliver



Re: Client capabilities (and JavaScript)

2002-05-02 Thread Simon Oliver

Michael Nino wrote:

 If the browser is Lynx then send text only version otherwise send JavaScript
 browser sniffer. The JavaScript sniffer can check for CSS, DHTML, DOM,
 plugins, etc... then redirect back to the server for the correct
 implementation.

Do you have a sniffer example - I have an idea for a module that
dynamically generates a sniffer/redirector.

--
  Simon Oliver



Re: Client capabilities

2002-04-30 Thread Simon Oliver

Martin Haase-Thomas wrote:
 
 HTTP defines an 'Accept' header.
But that's not much use.  For example lynx replies with

HTTP_ACCEPT text/html, text/plain, image/*, image/jpeg, text/sgml,
   video/mpeg, image/jpeg, image/tiff, image/x-rgb, image/png,
   image/x-xbitmap, image/x-xbm, image/gif, application/postscript,
   */*;q=0.01

But it can't render images or postscript!

Your best bet is to use the HTTP_USER_AGENT header.  From this you can
work out what browser the client is using and marry this info with a
database of browser capabilities (Microsoft provide one for use with IIS).

The main problem is that a client can be modified from the standard
install to prevent JavaScript, StyleSheets, Images, etc and there is no
way to detect this server side.

You can detect JavaScript at the client side and redirect to a JavaScript
enabled URL or use the NOSCRIPT tag to provide alternative content.

Again at the client side you can use DHTML to determine client
capabilities and redirect or display alternative content accordingly but
this will not work with all browsers, see:
  http://msdn.microsoft.com/workshop/author/clientcaps/overview.asp

--
  Simon Oliver



Re: Memory explodes loading CSV into hash

2002-04-29 Thread Simon Oliver

Have you tried DBD::AnyData?  It's pure Perl so it might not be as fast
but you never know?

--
  Simon Oliver



Global (to page) variables under Apache::ASP

2002-04-23 Thread Simon Oliver

In my httpd.conf I have set 'PerlSetVar UseStrict 1' because I always use
sctict anyway and I see in the docs that this might become the default
too.  So I always declare my variables with my().  

Suppose I have a master ASP file that includes other scripts and these
other scripts need access to the variables declrared in the master - no
problem.  But reading through the docs it looks like turning on
DynamicIncludes would save alot of memory and be generally more
efficient.  

Indeed, it would also protect the variables declared in one file from
another because the includes are compliled and called as seperate subs.  
And here lies the problem, how to declare a vaiable in the master ASP file
that is also in the scope of the dynamic include?

--
  Simon Oliver



Re: mod_perl vs. C for high performance Apache modules

2001-12-14 Thread Simon Rosenthal

At 03:58 PM 12/14/2001, Jeff Yoak wrote:
At 09:15 PM 12/14/2001 +0100, Thomas Eibner wrote:
The key to mod_perl development is speed, there are numerous testimonials
from users implementing a lot of work in a very short time with mod_perl.
Ask the clients investor wheter he wants to pay for having everything you
did rewritten as an Apache module in C. That is very likely going to take
a lot of time.

Thank you for your reply.  I realized in reading it that my tone leads one 
to the common image of a buzzword driven doody-head who wants this because 
of what he read in Byte.  That's certainly common enough, and I've never 
had a problem dealing with such types.  (Well... not an unsolvable 
problem... :-)

This is something different.  The investor is in a related business, and 
has developed substantially similar software for years.  And it is really 
good.  What's worse is that my normal, biggest argument isn't compelling 
in this case, that by the time this would be done in C, I'd be doing 
contract work on Mars.  The investor claims to have evaluated Perl vs. C 
years ago, to have witnessed that every single hit on the webserver under 
mod_perl causes a CPU usage spike that isn't seen with C, and that under 
heavy load mod_perl completely falls apart where C doesn't.  (This code 
is, of course, LONG gone so I can't evaluate it for whether the C was good 
and the Perl was screwy.)  At any rate, because of this, he's spent years 
having good stuff written in C.  Unbeknownst to either me or my client, 
both this software and its developer were available to us, so in this case 
it would have been faster, cheaper and honestly even better, by which I 
mean more fully-featured.

CPU usage is certainly one factor... but CPUs are cheap compared to 
development man-hours.

Since you haven't provided any details on the application, this may not be 
relevant, but most of the web apps that we write (and I read about 
here)  spend much of their time waiting for responses from other back-end 
servers - databases, NFS mounted file systems, or whatever. It's probably 
undeniable that a well written C application will run faster than almost 
anything in an interpreted language, but that may not make much of a 
difference to the total response time.

-Simon





Simon Rosenthal ([EMAIL PROTECTED])
Web Systems Architect
Northern Light Technology
One Athenaeum Street. Suite 1700, Cambridge, MA  02142
Phone:  (617)621-5296: URL:  http://www.northernlight.com
Northern Light - Just what you've been searching for




Re: Phase for controlling network input?

2001-09-26 Thread Simon Rosenthal

I'm not sure that any mod_perl handlers are dispatched until the whole 
request is received, so you may have to deal with this at the core Apache 
level.

I think the following is your best bet (from 
http://httpd.apache.org/docs/mod/core.html#timeout )

TimeOut directive

Syntax: TimeOut number
Default: TimeOut 300
Context: server config
Status: core

The TimeOut directive currently defines the amount of time Apache will 
wait for three things:

1.The total amount of time it takes to receive a GET request.
2.The amount of time between receipt of TCP packets on a POST or PUT 
 request.
3.The amount of time between ACKs on transmissions of TCP packets in 
 responses.

We plan on making these separately configurable at some point down the 
road. The timer used to default to 1200 before 1.2, but has been lowered
to 300 which is still far more than necessary in most situations. It is 
not set any lower by default because there may still be odd places in the code
where the timer is not reset when a packet is sent.


We've  experienced this kind of attack inadvertently (as the result of a 
totally misconfigured HTTP client app which froze in the middle of sending 
an HTTP request ;=) but I wasn't aware that there were known attacks based 
on that.

-Simon


At 11:09 AM 9/26/2001, Bill McGonigle wrote:
I'm hoping this is possible with mod_perl, since I'm already familiar with 
it and fairly allergic to c, but can't seem to figure out the right phase.

I've been seeing log files recently that point to a certain DDOS attack 
brewing on apache servers.  I want to write a module that keeps a timer 
for the interval from when the apache child gets a network connection to 
when the client request has been sent.

I need a trigger when a network connection is established and a trigger 
when apache thinks it has received the request (before the response).

PerlChildInitHandler seems too early, since the child may be a pre-forked 
child without a connection.  PerlPostReadRequest seems too late since I 
can't be guaranteed of being called if the request isn't complete, which 
is the problem I'm trying to solve.  I could clear a flag in 
PerlPostReadRequest, but that would imply something is persisting from 
before that would be able to read the flag.

Maybe I'm think about this all wrong.  Any suggestions?

Thanks,
-Bill

-
Simon Rosenthal ([EMAIL PROTECTED])
Web Systems Architect
Northern Light Technology
One Athenaeum Street. Suite 1700, Cambridge, MA  02142
Phone:  (617)621-5296: URL:  http://www.northernlight.com
Northern Light - Just what you've been searching for




WinNT:fatal error LNK1181: cannot open input file ..\..\..\..\..\unzipped\ap\apache-1.3\src\Release\ApacheCore.lib

2001-05-02 Thread Simon Duduica


Hello,

I try to compile mod_perl on Windows NT 4 sp6 and I get the following
message

LINK : fatal error LNK1181: cannot open input file
..\..\..\..\..\unzipped\ap\apache-1.3\src\Release\ApacheCore.lib

I added the path to the ApacheCore.lib to the libpaths, I added the file to
the project, briefly I did everything that was written in INSTALL.win32 but
it doesn't work.
Apache is the 1.3.19, the msi package with sources, and it installed in
C:\Program Files\Apache Group... and perl is Perl-5.6.0 installed in c:\Perl

Any help welcome.
Thanks,
Simon.




Re: Dynamic httpd.conf file using mod_perl...

2001-04-17 Thread Simon Rosenthal

At 04:16 AM 4/17/01, Ask Bjoern Hansen wrote:
On Mon, 16 Apr 2001, Jim Winstead wrote:

[...]
  you would have to do a "run config template expander  HUP" instead
  of just doing a HUP of the apache parent process, but that doesn't
  seem like a big deal to me.

And it has the big advantage of also working with httpd's without
mod_perl.

like proxy servers ...

  Going off on a slight tangent from the orginal topic - the template-based 
approach would also work well for subsystems that have separate 
configuration files - we put quite a bit of application configuration info 
into files other than httpd.conf, so that we can modify it without 
requiring a server restart.

-Simon



  - ask

--
ask bjoern hansen, http://ask.netcetera.dk/   !try; do();
more than 70M impressions per day, http://valueclick.com




[OT] HTTP/1.1 client support using LWPng

2001-02-21 Thread Simon Rosenthal

Slightly off topic...

I am considering using  the LWPng (HTTP/1.1) client code for an app where 
we could gladly use both of the HTTP/1.1 features that it offers: 
persistent connections (the client and server are separated by 7 time zones 
and the TCP connect time is a horrible 125 ms ;=( , and pipelining of 
requests. The status of the code , according to Gisle Aas, is definitely 
alpha, and it hasn't been touched in a few years.

Has anyone else used this module ? and how successfully ?

Thanks

-Simon
-
Simon Rosenthal ([EMAIL PROTECTED])  
Web Systems Architect
Northern Light Technology
One Athenaeum Street. Suite 1700, Cambridge, MA  02142
Phone:  (617)621-5296  :   URL:  http://www.northernlight.com
"Northern Light - Just what you've been searching for"




Re: Socket/PIPE/Stream to long running process

2001-02-07 Thread Simon Rosenthal

At 11:04 AM 2/2/01 -0800, Rob Bloodgood wrote:
So, in my mod_perl app, I run thru each request, then blast a UDP packet to
a process on the local machine that collects statistics on my traffic:

snip



My question is, should I be creating this socket for every request?  OR
would it be more "correct" to create it once on process startup and stash it
in $r-pnotes or something?

we have similar code in a mod_perl environment  for sending Multicast UDP 
packets - I just store the socket filehandle  in a global when it's 
created,  and the next request can pick it up from there (just test if the 
global is defined).
keeping the endpoint info in pnotes is only useful if you need write 
multiple UDP packets per request.

-Simon



And if I did that, would it work w/ TCP?  Or unix pipes/sockets (which I
*don't* understand) (btw the box is linux)?  In testing, I'd prefer not to
use TCP because it blocks if the count server is hung or down, vs UDP, where
I just lose a couple of packets.

TIA!

L8r,
Rob

-
Simon Rosenthal ([EMAIL PROTECTED])  
Web Systems Architect
Northern Light Technology
One Athenaeum Street. Suite 1700, Cambridge, MA  02142
Phone:  (617)621-5296  :   URL:  http://www.northernlight.com
"Northern Light - Just what you've been searching for"




Re: Caching search results

2001-01-08 Thread Simon Rosenthal

At 10:10 AM 1/8/01 -0800, you wrote:
Bill Moseley wrote:
  Anyway, I'd like to avoid the repeated queries in mod_perl, of course.  So,
  in the sort term, I was thinking about caching search results (which is
  just a sorted list of file names) using a simple file-system db -- that is,
  (carefully) build file names out of the queries and writing them to some
  directory tree .  Then I'd use cron to purge LRU files every so often.  I
  think this approach will work fine and instead of a dbm or rdbms approach.

Always start with CPAN.  Try Tie::FileLRUCache or File::Cache for
starters. A dbm would be fine too, but more trouble to purge old entries
from.

an RDBMS is not much more trouble to purge, if you have a 
time-of-last-update field. And if you're ever going to access your cache 
from multiple servers, you definitely don't want to deal with  locking 
issues for DBM and filesystem based solutions ;=(

-Simon

-
Simon Rosenthal ([EMAIL PROTECTED])  
Web Systems Architect
Northern Light Technology
One Athenaeum Street. Suite 1700, Cambridge, MA  02142
Phone:  (617)621-5296  :   URL:  http://www.northernlight.com
"Northern Light - Just what you've been searching for"




Re: Caching search results

2001-01-08 Thread Simon Rosenthal

At 02:02 PM 1/8/01 -0800, Sander van Zoest wrote:
On Mon, 8 Jan 2001, Simon Rosenthal wrote:

  an RDBMS is not much more trouble to purge, if you have a
  time-of-last-update field. And if you're ever going to access your cache
  from multiple servers, you definitely don't want to deal with  locking
  issues for DBM and filesystem based solutions ;=(

RDBMS does bring replication and backup issues. The DBM and FS solutions
definately have their advantages. It would not be too difficult to write
a serialized daemon that makes request over the net to a DBM file.

What in you experience makes you pick the overhead of an RDBMS for a simple
cache in favor of DBM, FS solutions?

We cache user session state  (basically using Apache::Session) in a small 
(maybe 500K records) mysql database , which is accessed by multiple web 
servers. We made an explicit decision NOT to replicate or backup this 
database - it's very dynamic, and the only user visible consequence of a 
loss of the database would be an unexpected login screen - we felt this was 
a tradeoff we could live with.  We have a hot spare mysql instance which 
can be brought into service immediately, if required.

  I couldn't see writing a daemon as you suggested  offering us any 
benefits under those circumstances, given that RDBMS access is built into 
Apache::Session.

I would not be as cavalier as this if we were doing anything more than 
using the RDBMS as a fast cache. With decent hardware (which we have - Sun 
Enterprise servers  with nice fast disks and enough memory) the typical 
record retrieval time  is around 10ms, which  even if slow compared to a 
local FS access is plenty fast enough in the context of the processing we 
do for dynamic pages.

Hope this answers your question.

-Simon




--
Sander van Zoest [[EMAIL PROTECTED]]
Covalent Technologies, Inc.   http://www.covalent.net/
(415) 536-5218 http://www.vanzoest.com/sander/

-
Simon Rosenthal ([EMAIL PROTECTED])  
Web Systems Architect
Northern Light Technology
One Athenaeum Street. Suite 1700, Cambridge, MA  02142
Phone:  (617)621-5296  :   URL:  http://www.northernlight.com
"Northern Light - Just what you've been searching for"




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

2000-09-08 Thread Simon Rosenthal

At 11:37 PM 9/7/00 -0600, Joe Pearson wrote:
I thought you could set a cookie for a different domain - you just can't
read a different domain's cookie.  So you could simply set 3 cookies when
the user authenticates.

I don't think you can set a cookie for a completely different domain, based 
on my reading of RFC2109 and some empirical tests ... it would be a massive 
privacy/security hole, yes ?

- Simon


Now I'm curious, I'll need to try that.

--
Joe Pearson
Database Management Services, Inc.
208-384-1311 ext. 11
http://www.webdms.com

-Original Message-
From: Aaron Johnson [EMAIL PROTECTED]
To: [EMAIL PROTECTED] [EMAIL PROTECTED]
Date: Thursday, September 07, 2000 10:08 AM
Subject: [OT?] Cross domain cookie/ticket access


 I am trying to implement a method of allowing access to three separate
 servers on three separate domains.
 
 The goal is to only have to login once and having free movement across
 the three protected access domains.
 
 A cookie can't work due to the limit of a single domain.
 
 Has anyone out there had to handle this situation?
 
 I have thought about several different alternatives, but they just get
 uglier and uglier.
 
 One thought was that they could go to a central server and login.  At
 the time of login they would be redirected to a special page on each of
 the other two servers with any required login information.  These pages
 would in turn return them to the login machine.  At the end of the login
 process they would be redirected to the web site they original wanted.
 
 This is a rough summary of what might happen -
 
 domain1.net - user requests a page in a protected directory.   They
 don't have a cookie.
 They are redirected to the cookie server.  This server asks for the user
 name and pass and authenticates the user.  Once authenticated the cookie
 server redirects the client to each of the other (the ones not matching
 the originally requested domain) domains.  This redirect is a page that
 hands the client a cookie and sets up the session information.
 domain2.net gets the request and redirects the user to a page that will
 return them to the cookie machine which will add the domain2.net to the
 list of domains in the cookie. And then the process will repeat for each
 domain that needs to be processed.
 
 Am I crazy?  Did I miss something in the documentation for the current
 Session/Auth/Cookie modules?
 
 I did some hacking of the Ticket(Access|Tool|Master) Example in the
 Eagle book, but the cookie limit is keeping it from working correctly.
 ( BTW: I already use it for a single server login and it works great. )
 
 Any information would be appreciated.
 
 Aaron Johnson
 
 

-
Simon Rosenthal ([EMAIL PROTECTED])  
Web Systems Architect
Northern Light Technology   222 Third Street, Cambridge MA 02142
Phone:  (617)621-5296  :   URL:  http://www.northernlight.com
"Northern Light - Just what you've been searching for"




Re: Dynamic Directory Protection - An authorization related question.

2000-09-03 Thread Simon Wei

Thanks guys!
(Michael Hanisch, Michael Robinton, Jonathan Leto)

I think the session key idea will work for me, just hoping there are a
generic solution out there. This is a typical problem why people turn to
LDAP, but LDAP is just so horrible to administer.

Regards,

Simon Wei


  Hi:
 ReHi

  packages provided by mod_perl. However, there doesn't seems to be a
solution
  to dynamically protect a directory without restarting Apache.
 
  What I will like to do:
  Store the URI Directory need to be protected in the database with the
  permitted Groups.
 
  What I have done:
  Using Perl and DBI in httpd.conf, and query the database for the
directory
  information every time Apache starts.
 
  Problem:
  For Authentication and Group Authorization, changes in the database will
be
  reflected without restarting Apache. Not so for the URI Directory part
of
  it.
 Hmm, sorry if this sounds stupid, but...
 What keeps you from querying the DB on every request, i.e. in a
 custom-built Authen/Authz-handler?
 On a site with a small userbase, the overhead should be neglectable.
 Besides, you can still cache the query results in memory and expire them
 after a certain time.
 Or did I miss something here?
 BTW: There are several modules on CPAN that do what you want (if I did get
 what you want, that is ;)

 Regards,
 Michael.


  I have thought about restarting Apache from time to time, but thinking
there
  must be a "lazier" way with performance consideration.
 
 
  Thanks for any comments or tips.
 





Re: What phase am I in

2000-04-07 Thread Simon Rosenthal

At 12:51 PM 4/7/00 -0400, Paul G. Weiss wrote:
Is there any way to determine from the Apache::Request object
what phase of handling we'er in?   I have some code that is used
during more than one phase and I'd like it to behave differently
for each phase.

the current_callback() method (Eagle book, p465). Funny, I had to find this 
out yesterday..

- Simon


-Paul

-
Simon Rosenthal ([EMAIL PROTECTED])  
Web Systems Architect
Northern Light Technology   222 Third Street, Cambridge MA 02142
Phone:  (617)577-2796  :   URL:  http://www.northernlight.com
"Northern Light - Just what you've been searching for"




Re: [Rare Modules] Apache::RegistryNG

2000-02-04 Thread Simon Rosenthal

At 06:17 PM 2/4/00 +0200, Stas Bekman wrote:
The next module is Apache::RegistryNG.

CApache::RegistryNG is the same as CApache::Registry, aside from
using filename instead of URI for the namespace. It also uses OO
interface.

   snip

There is no compelling reason to use CApache::RegistryNG over
CApache::Registry, unless you want to do add or change the
functionality of the existing IRegistry.pm.  For example,
CApache::RegistryBB (Bare-Bones) is another subclass that skips the
stat() call performed by CApache::Registry on each request.


One situation where Apache::RegistryNG  may definitely be required  is if 
you are rewriting URLS  (using either mod_rewrite or your own handler)  in 
certain ways.

For instance  if you  have a rewrite rule  of the form XYZ123456.html  == 
/perl/foo.pl?p1=XYZp2=123456
Apache::Registry loses big, as it recompiles foo.pl  for each unique 
URL.  We ran into this and were totally baffled  as to why we had no 
mod_perl performance boost  until Doug pointed us to RegistryNG, which is 
definitely your friend in these circumstances.

- Simon

-
Simon Rosenthal ([EMAIL PROTECTED])  
Web Systems Architect
Northern Light Technology   222 Third Street, Cambridge MA 02142
Phone:  (617)577-2796  :   URL:  http://www.northernlight.com
"Northern Light - Just what you've been searching for"



Re: Caching DB queries amongst multiple httpd child processes

2000-02-03 Thread Simon Rosenthal

At 03:33 PM 2/3/00 +1100, Peter Skipworth wrote:
Does anyone have any experience in using IPC shared memory or similar in
caching data amongst multiple httpd daemons ? We run a large-ish database
dependent site, with a mysql daemon serving many hundreds of requests a
minute. While we are currently caching SQL query results on a per-process
basis, it would be nice to share this ability across the server as a
whole.

I've played with IPC::Shareable and IPC::ShareLite, but both seem to be a
little unreliable - unsurprising as both modules are currently still under
development. Our platform is a combination of FreeBSD and Solaris servers
- speaking of which, has anyone taken this one step further again and
cached SQL results amongst multiple web servers ?

We looked at this, as we have a  busy multiple web server environment and 
are planning to use Apache::Session + Mysql to manage session state. 
Although per-host caching in shared memory or whatever seemed desirable on 
paper, the complexities of ensuring that cache entries are not invalid due 
to an update on another server are major.

When we  set up a testbed to benchmark Mysql  for this project, the 
time  taken to retrieve or update a session state record  across the 
network over an established connection to  our Mysql host (Sparc 333 mhz 
Ultra 5/Solaris 2.6 with lots of memory) was so small (5-7 ms including 
LOCK/UNLOCK TABLE commands where needed) that we didn't pursue per host 
caches any further.

Clearly, YMMV depending on the hardware you have available.

- Simon


Thanks in advance,

Peter Skipworth

--
.-.
|   Peter SkipworthPh: 03 9897 1121   |
|  Senior Programmer  Mob: 0417 013 292   |
|  realestate.com.au   [EMAIL PROTECTED] |
`-'


-
Simon Rosenthal ([EMAIL PROTECTED])  
Web Systems Architect
Northern Light Technology   222 Third Street, Cambridge MA 02142
Phone:  (617)577-2796  :   URL:  http://www.northernlight.com
"Northern Light - Just what you've been searching for"



Job openings at Northern Light Technology, Cambridge, MA.

2000-02-02 Thread Simon Rosenthal


Who we're looking for:

We're looking for a Senior/Principal Engineer in the Web 
Architecture/Systems group, which is responsible for all aspects of web 
server technology and the development of core technology components for our 
web based applications. (We have a separate Applications development group 
who are also hiring; see our jobs page at 
http://www.northernlight.com/docs/jobs_company.html for other open positions).

About you:

You will have 2+ years software development experience using C/C++/Perl in 
a UNIX environment, plus intimate familiarity with the Apache web server, 
mod_perl, and a good understanding of system performance and tuning issues 
in a high traffic Web environment. Ability to work on multiple projects at 
once, good communications skills and a tolerance for organized chaos are 
all highly desirable.

About Northern Light:

Since it premiered as the first Web-based research engine in August of 
1997, Northern Light has grown considerably, earning accolades for its 
search engine technology. We're  now a 150 person company (pre IPO) 
headquartered in  the Kendall Square area of Cambridge, Mass. We're not new 
kids on the block. Our management team has been around a few blocks with, 
combined, over 100 years of experience in the software industry. They know 
what it takes to make the company successful. At the same time, we're very 
young at heart. We tackle interesting projects and actively encourage 
creative thinking and continuous learning. The energy, humor, and 
commitment to quality shared by people at Northern Light are unsurpassed.

Please send your resume by email, fax or ground mail to:
 Human Resources
 Northern Light Technology
 222 Third Street, Suite 1320
 Cambridge, MA 02142
 Fax: (617) 621-3459
 Email: [EMAIL PROTECTED]

Feel free to call me at (617) 621 5296 or email me if you have any questions.

-
Simon Rosenthal ([EMAIL PROTECTED])  
Web Systems Architect
Northern Light Technology   222 Third Street, Cambridge MA 02142
Phone:  (617)577-2796  :   URL:  http://www.northernlight.com
"Northern Light - Just what you've been searching for"



Re: access_log

2000-01-12 Thread Simon Rosenthal

At 11:09 AM 1/12/00 -0500, Gacesa, Petar wrote:
I was doing the stress testing of the Apache web server by simulating a
large number of http requests.  After several hours I started getting the
following line in my access_log file:

165.78.11.40 - - [11/Jan/200:22:33:45 -0500] "-" 408 -

Instead of the URL that was supposed to be accessed.

Can somebody please tell me what this means?

Petar
It's a bit off-topic... nothing to do with mod_perl.

It's reporting a situation when the client starts to send an HTTP request 
but doesn't complete it - you have an Apache process tied up waiting for 
the request to complete; it doesn't, and Apache  eventually times out the 
request and  so logs it.

So look at your simulated client.

- Simon
-
Simon Rosenthal ([EMAIL PROTECTED])  
Web Systems Architect
Northern Light Technology   222 Third Street, Cambridge MA 02142
Phone:  (617)577-2796  :   URL:  http://www.northernlight.com
"Northern Light - Just what you've been searching for"



Managing session state over multiple servers

1999-12-16 Thread Simon Rosenthal


Hi:

We're planning on migrating to an Apache::Session + mysql approach for 
managing session state, for a large-ish site hosted on multiple servers. 
While there have been many useful discussions on this list concerning the 
technologies involved, I haven't seen many war stories from the field, as 
it were.

I have some specific questions  - hopefully someone out there has had to 
address these issues and may have some good advice.

a) If your site runs on multiple servers, do you attempt to cache session 
state records on the web server for any length of time after they are 
retrieved from the DBMS ? and if so, how do you handle cache consistency 
across all your servers  - (we have rather blind load balancing hardware in 
front of our server farm with no way  of implementing any kind of server 
affinity that I am aware of)

b) Does anyone have redundant database servers ? If so ... are there any 
implementation gotchas ? and if you have a single server, how does session 
management work  when it goes down ? (I'm pretty happy with the hardware - 
Suns - which we have, but a disk can go at any time)

c) This is more of a mysql question  When do people consider a session 
to have expired ? and what is the best strategy for deleting expired 
sessions from a database, especially given that mysql's table based locking 
seems to leave a bit to be desired if you're trying to mix update 
operations with a big SELECT/DELETE to purge expired sessions  ?

TIA

- Simon
-
Simon Rosenthal ([EMAIL PROTECTED])  
Web Systems Architect
Northern Light Technology   222 Third Street, Cambridge MA 02142
Phone:  (617)577-2796  :   URL:  http://www.northernlight.com
"Northern Light - Just what you've been searching for"



FW: Apache::Resource

1999-10-29 Thread Simon Miner

Ok, I've had the chance to experiment a bit more with
BSD::Resource::setrlimit function.  After I sent my last message to the
mailing list, I again accessed the Apache::Status Resource Limits page,
and this time RLIMIT_DATA was unset.  I reloaded the page several times,
and the behavior seemed sporadic -- sometimes RLIMIT_DATA was set and
sometimes not. I added a line of code to the Apache::Resource module to
print out the PID before the resource limits table, and it seems that
only one or two of the processes have RLIMIT_DATA set.  These are child
processes, too.

I got this behavior when I put my setrlimit-calling module as a
PerlFixupHanlder or as a PerlChildInitHandler.

Can anyone tell me how to consistently set RLIMIT_DATA for all httpd
processes?

Thanks.

- Simon

 -Original Message-
 From: Simon Miner [SMTP:[EMAIL PROTECTED]]
 Sent: Thursday, October 28, 1999 3:11 PM
 To:   'Vivek Khera'; Simon Miner
 Cc:   'mod_perl Mailing List'; Win Mattina
 Subject:  RE: Apache::Resource
 
 Interesting...
 
 When I use Apache::Resource as my PerlFixupHandler, Apache::Status
 reports that there is no resource limit set for RLIMIT_DATA.  However,
 when I explicitly call BSD::Resource::setrlimit in my custom
 PerlFixupHandler, Apache::Status says that the resource limits are
 set.
 So, it still appears that there's something amiss with
 Apache::Resource.
 Any ideas?
 
 - Simon
 
  -Original Message-
  From:   Vivek Khera [SMTP:[EMAIL PROTECTED]]
  Sent:   Thursday, October 28, 1999 2:37 PM
  To: Simon Miner
  Cc: 'mod_perl Mailing List'; Win Mattina
  Subject:Re: Apache::Resource
  
   "SM" == Simon Miner [EMAIL PROTECTED] writes:
  
  SM Hi:
  SM I'm having difficulty getting Apache::Resource to work.  I've
  tried
  SM calling the module as a PerlChildInitHandler and as a
  PerlFixupHandler,
  SM and I've tried telling it which resource to limit in the
 following
  ways.
  
  Working example:
  
  # protect from runaway child processes.
  # Apache::Resource loaded in startup.perl below.
  #
  # limit CPU usage in seconds
  PerlSetEnv PERL_RLIMIT_CPU 60:600
  # limit DATA segment in MB
  PerlSetEnv PERL_RLIMIT_DATA 32:64
  PerlChildInitHandler Apache::Resource
  
  # startup.perl loads all functions that we want to use within
 mod_perl
  # this script is run while we are still "root".
  PerlScript /home/khera/proj/newprizes/website/conf/startup.perl
  
  And my startup.perl has "use Apache::Resource".
  
  If you configure Apache::Status, it will let you review the
 resources
  set this way.
  
  Now, the only question I might have is: "does Solaris 2.7 support
 BSD
  style resource limits"?  I don't know.  That may be the problem.
  
  -- 
 
 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  Vivek Khera, Ph.D.Khera Communications, Inc.
  Internet: [EMAIL PROTECTED]   Rockville, MD
 +1-301-545-6996
  PGP  MIME spoken herehttp://www.kciLink.com/home/khera/



Re: multiple cookies in Apache module.

1999-10-15 Thread Simon Tneoh Chee-Boon



Jay J wrote:

 Hey Simon,
 In order to debug.. why not temporarily send two headers, then one gets sent
 to the browser (so you can see it)?
 Either that or use telnet/lwp-request and get a look at it that way..
 -Jay J

Hello,   I already tested by using telnet. I found that CGI-header works fine,
it sends two line
of "Set-Cookie". Apache-header_out doesn't work, if I call it twice, only the
second
cookie is sent in one "Set-Cookie" line. So I wonder is it because I'm not
familiar with
the methods in Apache module, i.e. I miss out something, or Apache-header_out
does
not support this?
  Thanks.

--
Simon Tneoh Chee-Boon [EMAIL PROTECTED]
http://www.tneoh.zoneit.com/simon/
http://www.e-my.net.my/wilayahpersekutuan/simon/




Missing ORA_OCI.al file

1999-10-11 Thread Simon Miner

Good afternoon:

We've been having some trouble with our web servers' database
connections.  About once a day, our logs will be flooded with the
following error message.

[Fri Sep 17 12:38:11 1999] [error] DBD::Oracle initialisation failed:
Can't locate auto/DBD/Oracle/ORA_OCI.al in @INC (@INC contains:
/raid/staging/modules /www/modules /www/modules
/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/apache-1.3.9/
/usr/local/apache-1.3.9/lib/perl) at
/usr/local/lib/perl5/site_perl/5.005/sun4-solaris/DBD/Oracle.pm line 48.

The /raid/staging/modules and /www/modules directories have been added
to @INC via "use lib" for in-house Perl modules.

The above error occurs when users are unable to establish a connection
to our Oracle database due to a high number of TNS connections being
open at the same time.  What is this ORA_OCI.al file, and what
information does it contain?  Should DBD::Oracle have installed it when
the module was built?  It seems to me that the only logical place for
the file to be is in the
/usr/local/lib/perl5/site_perl/5.005/sun4-solaris/auto/DBD/Oracle/
directory, since that's where the Oracle.bs and Oracle.so files reside
for DBD::Oracle.  But it's not there, nor can I find it anywhere else on
our system.

Can anyone shed some light on this ORA_OCI.al file for me?

System Specifics:

Solaris 2.7
Perl 5.005_03
Apache 1.3.9
mod_perl 1.21
DBI 1.13
DBD::Oracle 1.03

Thanks in advance for your help.

- Simon


*
Simon D. Miner
Web Developer
Christian Book Distributors
http://www.christianbook.com
*