Re: Registry.pm

2003-07-05 Thread Ask Bjoern Hansen
On 3 Jul 2003, Roger Davenport wrote:

[...]
 Is there a solution other than reloading the server?  Does any one have
 patches to check used sub-modules?

http://search.cpan.org/dist/Apache-Reload/Reload.pm
http://search.cpan.org/dist/Apache-Reload/


 - ask

-- 
http://www.askbjoernhansen.com/ - http://develooper.com/



Re: speeding up CGI.pm

2003-03-26 Thread Ask Bjoern Hansen
On Tue, 25 Mar 2003, Stas Bekman wrote:

[...]
  http://marc.theaimsgroup.com/?l=apache-modperlm=95587404903236w=2

 If something can be made faster with very little effort, why not doing that?

Often because the cost of having to deal with the increased
complexity and new obscure bugs isn't worth it.


 - ask

-- 
ask bjoern hansen, http://www.askbjoernhansen.com/ !try; do();


Re: Transparent front-end proxying for many VirtualHosts

2003-03-07 Thread Ask Bjoern Hansen
On Wed, 5 Mar 2003, Andrew Ho wrote:

 I want to simplify my configuration in two ways. I'd prefer not to
 maintain two sets of VirtualHost configuration data, and I'd like it if
 the block that proxies .pl files to the backend proxy not be replicated
 per VirtualHost.

With the details you provided the best advice, as others have given,
is mod_macro or making the httpd.conf from a template.  I usually do
the latter.

If you added more details, for example a sample httpd.conf for the
proxy and the backend it would be easier to help.

Do you use 2.0 for the proxy?
http://httpd.apache.org/docs-2.0/mod/mod_proxy.html#proxypreservehost
is often helpful.

RewriteOptions inherit might also help simplify your configuration.

 The conceptual behavior I want, is for FilesMatch \.pl$ to be proxied
 by the backend server, and everything else by the frontend. I've tried
 many combinations which don't work, which I can post if it's relevant...

Please do.  :-)

[...]
 Does anybody have a pointer to a setup that looks like this?

Maybe I am completely misunderstanding the problem, but a guess
would be something like the following in the proxy:

ProxyPreserveHost yes
RewriteRule ^/(.*\.pl) http://localhost:1234/$1 [P]

virtualhost _default_
  ServerName foo.example.com
  RewriteEngine  on
  RewriteOptions inherit
/virtualhost

virtualhost _default_
...


 - ask

-- 
ask bjoern hansen, http://www.askbjoernhansen.com/ !try; do();


Re: Apache::DBI on mp2

2003-03-07 Thread Ask Bjoern Hansen
On Thu, 6 Mar 2003, Stas Bekman wrote:

 re: rollback, the DBD drivers will perform the normal disconnect(), but
 without doing the physical disconnect, and normal DESTROY, without destroying
 the datastructures which maintain the physical connection, so there shouldn't
 be much to change for this feature.

If the physical connection is still there, would the database server
do a rollback?


 - ask

ps. yes, your DBI::Pool work is great.  Thank you.  :-)

-- 
ask bjoern hansen, http://www.askbjoernhansen.com/ !try; do();


Re: Apache::DBI on mp2

2003-03-07 Thread Ask Bjoern Hansen
On Fri, 7 Mar 2003, Stas Bekman wrote:

  If the physical connection is still there, would the database server
  do a rollback?

 If earlier the rollback worked correctly with
 $dbh ||= connect();, this will work the same, since it performs the same
 operation, but rips off only parts of $dbh, because of the constraints of
 sharing Perl datastructures and underlying C structs.

Apache::DBI explicitly calls $dbh-rollback (when things are
configured so it makes sense).  Or maybe I am completely
misunderstanding you.

  ps. yes, your DBI::Pool work is great.  Thank you.  :-)

 My pleasure. Thanks for the kind words. It's quite challenging, though you
 stop getting excited about segfaults and ddd (gdb frontend) is nowadays my
 best friend ;)

:-)  You are quite the masochist if you ever got excited about
segfaults.  I only recall segfaults making me slam my head into the
wall to conceal the pain.


 - ask

-- 
ask bjoern hansen, http://www.askbjoernhansen.com/ !try; do();


Re: Apache::DBI on mp2

2003-03-05 Thread Ask Bjoern Hansen
On Wed, 5 Mar 2003, Stas Bekman wrote:

 Great. I've already committed that patch.

 Perhaps Ask could load 'Apache::compat' inside Apache::DBI if mp2 is used. Or
 to use the mp2 API if mp2 is used.

That seems like it'll be an easy solution.  I thought loading
Apache::compat would have global side effects though?  (i.e. for
people trying to make their system run without Apache::compat).


  - ask

-- 
ask bjoern hansen, http://www.askbjoernhansen.com/ !try; do();


Re: Apache::TicketAccess

2003-03-01 Thread Ask Bjoern Hansen
On Thu, 20 Feb 2003, Nick Tonkin wrote:

  Is it the cookie doesn't get sent back thru the reverse proxy?

 As Perrin said, you need to see what is actually happening. Dumping the
 headers is a great way to start. Right at the top of your handler do

Or you can use Apache::DumpHeaders.

http://search.cpan.org/dist/Apache-DumpHeaders/DumpHeaders.pm


 - ask

-- 
ask bjoern hansen, http://www.askbjoernhansen.com/ !try; do();


Re: [mp2] what is GEN1 and why is it my log?

2003-03-01 Thread Ask Bjoern Hansen
On Thu, 20 Feb 2003, Nick Tonkin wrote:

  In my logs when dumping a warn() I see this occasionally:
  
  192.168.0.24 at /home/wm/perl/WM/Auth/Access.pm line 28.
  192.168.0.24 at /home/wm/perl/WM/Auth/Access.pm line 28.
  192.168.0.24 at /home/wm/perl/WM/Auth/Access.pm line 28.
  192.168.0.24 at /home/wm/perl/WM/Auth/Access.pm line 28, GEN1 line 245.

It's a perl feature.  On warn's it'll add the filehandle and the
line number when it's relevant.

5.6.1:

$ ~perl/bin/perl -e 'warn foo; open F, .bashrc; warn Foo while F' 21 | head 
-5
foo at -e line 1.
Foo at -e line 1, F line 1.
Foo at -e line 1, F line 2.
Foo at -e line 1, F line 3.
Foo at -e line 1, F line 4.

If you set $/ so it's not reading normal lines it'll say chunk
instead of line:

$ ~perl/bin/perl -e 'warn foo; $/ = undef; open F, .bashrc; warn Foo while F' 
21 | head -5
foo at -e line 1.
Foo at -e line 1, F chunk 1.


Older perl's always said chunk.

perl 5.5.3:

$ perl -e 'warn foo; open F, .bashrc; warn Foo while F' 21 | head -5
foo at -e line 1.
Foo at -e line 1, F chunk 1.
Foo at -e line 1, F chunk 2.
Foo at -e line 1, F chunk 3.
Foo at -e line 1, F chunk 4.

 - ask

-- 
ask bjoern hansen, http://www.askbjoernhansen.com/ !try; do();


Re: Preloading DBI crashes Apache

2003-02-23 Thread Ask Bjoern Hansen
On Fri, 21 Feb 2003, Dan Brosemer wrote:

 Hi.  I'm new here, and hoping someone can help me.  I've installed the
 latest -current version of OpenBSD, and loaded mod_perl as a DSO.  That gets
 me Apache 1.3.27, Perl 5.8.0, and mod_perl 1.27.
[...]
 These are taken using DBD::mysql.  I'd be happy to provide backtraces using
 other modules if they'd be useful to someone debugging.
[...]

A backtrace with DBD::mysqlPP would be fun.

Have you upgraded mysql after you last installed DBD::mysql?  Did
DBD::mysql pass all tests when you installed it?


 - ask

-- 
ask bjoern hansen, http://www.askbjoernhansen.com/ !try; do();


RE: [ANNOUNCE] Apache::DBI 0.90_02

2003-01-11 Thread Ask Bjoern Hansen
On Fri, 10 Jan 2003, Beau E. Cox wrote:

 I had heard moving A:DBI to 2 was going to be very difficult!
 I've been waiting...

As Stas said, it really wasn't.  You might even have been able to
with Apache::compat; I did not try.

The harder part is to make the database handles shared across a pool
of threads.  But just having it work like it does in Apache 1.x is
much better than not having it work at all!  :-)


 - ask

-- 
ask bjoern hansen, http://www.askbjoernhansen.com/ !try; do();



[ANNOUNCE] Apache::DBI 0.90_02

2003-01-10 Thread Ask Bjoern Hansen

Last night I spent a bit of time making a proper test for
Apache::DBI and make it work without Apache.pm.  Just now I made it
work with mod_perl 2.0.  I have only tested that very briefly.

Until it hits your CPAN mirror, get it from:
http://develooper.com/code/Apache::DBI/

Or from CVS; instructions at
http://dev.perl.org/cvs/info?module=Apache/DBI/

Please try it out if you have a chance.  I would also like to see
more tests added to the t/ directory.


 - ask


Apache-DBI-0.90_02.tar.gz has entered CPAN as

  file: $CPAN/authors/id/A/AB/ABH/Apache-DBI-0.90_02.tar.gz
  size: 26770 bytes
   md5: e8c1082b19ad6a01bd572e13628da17d


Changes since 0.89:


0.90_02 January 10, 2003
- Changes to make Apache::DBI load and function under mod_perl
  2.0.  A few important notes: connect_on_init does not work yet
  and there's no automatic RollBack cleanup handler when
  autocommit is turned off.

0.90_01 January 10, 2003
- Only call Apache::Status if Apache.pm is completely loaded
- Make Test::More a prerequisite so we can do real tests
- Make DBI.pm a prerequisite
- Add a simple, but real, test script.  Requires DBD::mysql
  and a test database





Re: OSCON ideas - MVC talk

2003-01-08 Thread Ask Bjoern Hansen
On Wed, 8 Jan 2003, Perrin Harkins wrote:

I am planning to submit a proposal for a introduction talk on MVC in
a web environment.

It is mostly talking about why (seperation of concerns etc) it's
(sometimes) nicer than whatever you used to do and how you apply the
goals to the actual implementation.  In 90 minutes I think I can
also go briefly into examples of actual models, controllers and
templates.  I think it could also be a tutorial[1], but tutorials
bore me so much.  So I don't think I'd want to do that.

Like Perrin I would like feedback on the idea before putting in my
proposal.

:-)


 - ask

[1] Except then I would have to write many more slides; I already
have a ~70 minutes talk about it with slides, illustrations and all
sorts of things.  :-)

-- 
ask bjoern hansen, http://www.askbjoernhansen.com/ !try; do();



Re: DumpHeader Apache Perl Mod

2002-12-17 Thread Ask Bjoern Hansen
On Tue, 17 Dec 2002, Chris Dickerson wrote:

 IfModule mod_perl.c
 Location /
 PerlLogHandler  Apache::DumpHeaders
 PerlSetVar  DumpHeaders_File test.txt
 /Location
 /IfModule

 If I didn't wrap them in the IfModule.. Apache wouldn't load correctly.

Er; then mod_perl is probably not enabled in the httpd that is using
that configuration file.

 There are several
 .conf files in this Apache version:

 commonhttpd.conf  httpd.conf  httpd-perl.conf

I don't know how Mandrake has set it up.  If they change things
around, they should have documentation on how it works.

-- 
ask bjoern hansen, http://www.askbjoernhansen.com/ !try; do();




Re: Release date for mod_perl 2.0

2002-12-17 Thread Ask Bjoern Hansen
On 17 Dec 2002, Devin Heitmueller wrote:

[...]
 I'm in a difficult position because the project will be completed in a
 couple of months.  If the consensus is that mod_perl 2.0 will be
 released by that point, then everything will be fine (I'll develop using
 the beta code).  If it is still months from being stable enough for
 release, I will have to investigate alternatives.

It will get stable faster if you choose to use it. :-)


 - ask

-- 
ask bjoern hansen, http://www.askbjoernhansen.com/ !try; do();




Re: [OTish] Version Control?

2002-10-31 Thread Ask Bjoern Hansen
On Wed, 30 Oct 2002 [EMAIL PROTECTED] wrote:

 I don't believe in transfering _any_ binaries around,
 every binary recompiles on its new platform at install
 time. All modules, apache, external software etc. This
 eliminates those pesky little problems that pop up when
 you start pushing binaries.

Uhmn, if your systems are well managed you don't get any of those
pesky little problems.   Do you recompile the base system on each
server too?

In my experience, then as soon as you have more than a few handfuls
of servers you get more trouble trying to coordinate recompiling
binaries than doing it once and distributing them (in tarballs,
rpms, or with your revisioning system).


 - ask

-- 
ask bjoern hansen, http://www.askbjoernhansen.com/ !try; do();




RE: [OTish] Version Control?

2002-10-31 Thread Ask Bjoern Hansen
On Wed, 30 Oct 2002, Bill Moseley wrote:

 At 04:47 PM 10/30/02 -0500, Jesse Erlbaum wrote:
 Web development projects can map very nicely into CVS.  We have a very
 mature layout for all web projects.  In a nutshell, it boils down to this:
 
project/
  + apache/
  + bin/

 That requires binary compatibility, though.  I have a similar setup, but
 the perl and Apache are built separately on the target machine since my
 machines are linux and the production machine is Solaris.

No, you don't need binary compatibility. You just need to design
your system right and use the right tools.  :-)

With Perforce - http://www.perforce.com/ - you can map different
directories in the repository to directories on the client with
client views.  I have used that (Graham Barr came up with it
there) so we could keep the binaries version controlled too.  It's
great.  There we had all of our application software (including
perl, apache, etc) distributed with perforce.  With CVS or
Subversion you could do something similar by setting up branches
right or having a few symlinks.

We had separate installations around the world serving different
clients.  Before we migrated from CVS to perforce we had a cvs tag
for each installation, so rolling a new release was just

 o) make a new release number (r345), tag the files with that
 o) move the installation tag (LosAngeles_Production or QA
or whatever) to the new release tag (r345).
 o) tell the servers to upgrade and restart the application.

Perforce provides some features that makes it a bit neater, so the
implementation was different but the concept the same.

It worked (works actually) great.



At another place we have a script to tag the files with a build
number and then roll some tar balls.  The tar balls then go to QA
server and then to the production servers.  There all the code is
living on shared NFS servers, so rolling it out is just putting the
code there and restarting the servers.  Perl, Apache, etc are
installed with rpms there.



For a big project I like installing everything in /home/[project]/ -
including perl, apache, mod_perl, ... - and having the whole
directory version controlled.

On the perl.org we have a bunch of smaller projects.  There we use a
shared /home/perl/ installation that gets distributed to the
servers we use for production and for development.  It has perl 5.8,
various versions of Apache and other goodies.  Each project (in
/home/[project]/) then just reference that installation.

Making it easy to setup a development environment on your own box is
really really nice.  On bigger projects I often even have several
development environments installed at the same time, so I easily can
work on different sub project or test different branches at the same
time.


[...]
 Is anyone using cvs to manage updates made with web-based forms?

The Twiki system and the Faq-O-Matic are using RCS on the backend to
version control entries.


 - ask

-- 
ask bjoern hansen, http://www.askbjoernhansen.com/ !try; do();





Re: [OTish] Version Control?

2002-10-31 Thread Ask Bjoern Hansen
On Thu, 31 Oct 2002 [EMAIL PROTECTED] wrote:

[...]
 I guess in your book we suck either way eh? Life goes on
 :)

You'll change your ways when you get more servers.  :-)

It's not easy enough for the script to do anything if the base
system installations are not very similar.  If they are; then it's
much easier to distribute binaries.  If they are not then that's the
first thing you'll change as you add servers above what is managable
otherwise.

You are right, that if your software runs on many uncontrolled small
groups of servers, then it's likely easier to recompile for each
box.


 - ask

-- 
ask bjoern hansen, http://www.askbjoernhansen.com/ !try; do();




Re: [O] Re: Yahoo is moving to PHP ??

2002-10-31 Thread Ask Bjoern Hansen
On Thu, 31 Oct 2002, Franck PORCHER wrote:

 In fact, regarding the efficiency of the map construct, I often
 wondered whether Perl detects map being ran in a void context,
 so as to give it an iterative interpretation, avoiding to build
 the output list.

IIRC (but I might not) then it does since version X, where X is
relatively recent.


  - ask

-- 
ask bjoern hansen, http://www.askbjoernhansen.com/ !try; do();




Re: Thoughts on Mason?

2002-10-26 Thread Ask Bjoern Hansen
On Thu, 24 Oct 2002, Shannon Appelcline wrote:

 I see there's a new book coming out from O'Reilly on mason, which seems
 to be perl integrated into web pages and claims to support mod_perl.

 Any thoughts on mason from this esteemed community?

I use it a lot; it rocks.  You can't get stuff done faster than you
can with Mason, and it still allows you to design things properly if
you are careful.

http://dev.perl.org/, http://jobs.perl.org, http://search.cpan.org/
are using Mason.

See http://www.masonhq.com/


 - ask

-- 
ask bjoern hansen, http://www.askbjoernhansen.com/ !try; do();




Re: [mp2.0] wrong crypt behavior

2002-10-13 Thread Ask Bjoern Hansen

On Thu, 10 Oct 2002, Ask Bjoern Hansen wrote:

 On Fri, 6 Sep 2002, [iso-8859-2] Tomá¹ Procházka wrote:

  Problem:  Sometimes, although user entered correct password, is
  authentication rejected. I tried logging values of $real_pass and
  $test_pass and they differed. When I add line

 Did anyone figure this out?

Rick Bradley did, but only posted it on the dev@ list where I didn't
catch it.  It's a bug in glibc 2.2.5 on linux:
  http:[EMAIL PROTECTED]/msg85673.html


 - ask

-- 
ask bjoern hansen, http://www.askbjoernhansen.com/ !try; do();




Re: [OT] migrating from Apache to iPlanet; any mod_perl counterpart?

2002-10-10 Thread Ask Bjoern Hansen

On Wed, 9 Oct 2002, Paul wrote:


 We're out of budget

and

 insists we can't use free stuff that's *ALREADY* working.

Anyone see a pattern here? :-)

 If anyone has a miraculous suggestion, I will light many candles in
 your honor. *sigh*

Talk to whoever decides what the IT department thinks? (Or make
someone talk to some lawyers with more clue).


 - ask

-- 
ask bjoern hansen, http://www.askbjoernhansen.com/ !try; do();





Re: [mp2.0] wrong crypt behavior

2002-10-10 Thread Ask Bjoern Hansen

On Fri, 6 Sep 2002, [iso-8859-2] Tomá¹ Procházka wrote:

 Problem:  Sometimes, although user entered correct password, is
 authentication rejected. I tried logging values of $real_pass and
 $test_pass and they differed. When I add line

Did anyone figure this out?

The following content handler gives a different output everytime I
restart my threaded mod_perl 2.0.  Dm8yjkphWW352 is the correct
answer; I get that after about a third of the restarts.

 - ask


package Develooper::MT::Test;
use strict;
use warnings;

use Apache::RequestRec ();
use Apache::RequestIO ();

use Apache::Const -compile = 'OK';

my $clear = foo;
my $salt  = Dm;

sub handler {
  my $r = shift;
  $r-content_type('text/plain');
  my $crypted = crypt $clear, $salt;
  $r-print(crypt $clear, $salt = $crypted);
  return Apache::OK;
}

1;

-- 
ask bjoern hansen, http://www.askbjoernhansen.com/ !try; do();




Re: [mp2.0] wrong crypt behavior

2002-10-10 Thread Ask Bjoern Hansen

On Thu, 10 Oct 2002, Ask Bjoern Hansen wrote:

  Problem:  Sometimes, although user entered correct password, is
  authentication rejected. I tried logging values of $real_pass and
  $test_pass and they differed. When I add line

 Did anyone figure this out?

 The following content handler gives a different output everytime I
 restart my threaded mod_perl 2.0.  Dm8yjkphWW352 is the correct
 answer; I get that after about a third of the restarts.

FWIW, the following test program (also with 5.8.0 with threads
(duh)) doesn't seem to have a problem with crypt.

use threads;
for (1..50) { threads-create(test); }

map { $_-join } grep { $_-tid != threads-tid } threads-list;

sub test {
  my $salt= Dm;
  my $clear   = foo;
  for (1..1) {
my $crypted = crypt($clear,$salt);
print $crypted\n if $crypted ne Dm8yjkphWW352;
  }
}


 - ask

-- 
ask bjoern hansen, http://www.askbjoernhansen.com/ !try; do();




Re: performance regarding mod_perl vs mod_c with embedded perl

2002-09-23 Thread Ask Bjoern Hansen

On Wed, 18 Sep 2002, Peter Bi wrote:

 The linked page is great, especially the first picture.

 Problem in authentication:  if mod_perl returns cached header and
 the document is proxy cached in the plain Apache, the backend
 authentication handler (in the mod_perl server) will not be able
 to protect it.

Obviously you need to serve the pages from whatever stage that can
handle authorization.

However, even if it means you can't cache things in the proxy, you
will still get great benefits from having the light proxy process
waiting for the client to receive the data and serving static
image files and such instead of having the expensive mod_perl
process doing it.

  Raw benchmark numbers will come out a bit lower, but you don't care
  as a proper setup will save you LOTS of memory, database connections
  and what have you not.
 
  http://develooper.com/modperl/performance_tuning.html
 
  (Click Next on the top of each slide to progress ... The first few
  slides looks weird in Mozilla 1.0 on my Linux box but are fine in
  Chimera on Mac OS X - get a Mac! :-) )

-- 
ask bjoern hansen, http://www.askbjoernhansen.com/ !try; do();




Re: mod_perl 2.x vs. mod_perl 1.x benchmarks

2002-09-19 Thread Ask Bjoern Hansen

On Wed, 18 Sep 2002, Josh Chamas wrote:

[...]
 So I run it again with ServerTokens Min, and get the same results. :)
 Still something different on the mod_perl headers, looks like mod_perl
 2.x is setting Content-Length where it didn't use to.

The details evade me, but I recall something about how the buckets
work in the httpd that makes httpd 2.0 always know (and set) the
Content-Length.

There was discussion about changing it; but I don't remember the
outcome.

(yes, it has (had?) some implications for how data can be streamed
from the proxy in such a setup, which was the reason for changing
it.  Indeed it could be that it was only affecting the proxy.  Did I
mention that I forgot the details?).  :-)


 - ask

-- 
ask bjoern hansen, http://www.askbjoernhansen.com/ !try; do();




Re: Upgrading frontend apache - is it worth it?

2002-09-19 Thread Ask Bjoern Hansen

On 19 Sep 2002, Marcin Kasperski wrote:

[upgrade front end proxy to apache 2.x]
 So the question: is it really worth doing?

Because of the ProxyPreserveHost option it is easier to configure
than the 1.x setup.

http://develooper.com/modperl/performance_tuning.html#x59

You can probably get it done without too much work; so then it is
probably worth it.


 - ask

-- 
ask bjoern hansen, http://www.askbjoernhansen.com/ !try; do();




Re: performance regarding mod_perl vs mod_c with embedded perl

2002-09-18 Thread Ask Bjoern Hansen

On Thu, 12 Sep 2002 [EMAIL PROTECTED] wrote:

 Hi Josh,

 How about the dual setup, a plain Apache + a mod_perl
 Apache, which some mod_perl sites are based on?

You don't do that for raw performance as measured in a typical
simple benchmark environment.  The dual setup is used to not
needlessly waste resources in a real setup.

Raw benchmark numbers will come out a bit lower, but you don't care
as a proper setup will save you LOTS of memory, database connections
and what have you not.

http://develooper.com/modperl/performance_tuning.html

(Click Next on the top of each slide to progress ... The first few
slides looks weird in Mozilla 1.0 on my Linux box but are fine in
Chimera on Mac OS X - get a Mac! :-) )


 - ask

-- 
ask bjoern hansen, http://www.askbjoernhansen.com/ !try; do();




Re: Apache could not restart

2002-09-18 Thread Ask Bjoern Hansen

On Wed, 18 Sep 2002, Edwin D. Viñas wrote:

 Hello pipol!

 Im having an error below once apache is started:

 .../bin/apachectl stop: httpd (no pid file) not running
 noc# ../bin/apachectl start
 Syntax error on line 577 of /usr/local/apache/conf/httpd.conf:
 Invalid command 'PerlModule', perhaps mis-spelled or defined by a module not 
included in the server configuration
 .../bin/apachectl start: httpd could not be started

[...]

 Im currently using FreeBSD-4.4, Apache-1.3.26, PHP, Postgres in this machine.
 What do you think is the problem?

You compiled mod_perl as a DSO but didn't load the module.

Try adding something like the following to your httpd.conf:

LoadModule perl_modulelibexec/apache/libperl.so


  - ask

PS. You also want to upgrade FreeBSD to 4.6; or at least make sure
you have the latest security upgrades for 4.4.

-- 
ask bjoern hansen, http://www.askbjoernhansen.com/ !try; do();




Re: FW: ezmlm response

2002-09-12 Thread Ask Bjoern Hansen

On Thu, 12 Sep 2002 [EMAIL PROTECTED] wrote:

 Hi,

 is there a way to subscribe to mod_perl digest only?
 The page http://perl.apache.org/maillist/modperl.html
 lists strangely the same address as for normal subscr.

That's a typo then; it should be
[EMAIL PROTECTED] to subscribe to the digest.


 - ask

-- 
ask bjoern hansen, http://askbjoernhansen.com/  !try;
develooper llc,http://www.develooper.com/   do();




Re: Dual Apache setups

2002-09-10 Thread Ask Bjoern Hansen

On 9 Sep 2002, Jason Czerak wrote:

 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 don't think anyone have any or much real world experience with
this yet.  In theory it will probably not be needed if you are using
a threaded setup.

I'm sure anything you can tell us after trying it in a busy setup
will be greatly appreciated.  :-)

 I wish to have apache 2.0 threaded.

Don't parse stuff back and forth between threads in shared arrays
just yet, or you'll suffer memory leaks.  :-)


  - ask (suffering memory leaks)

-- 
ask bjoern hansen, http://www.askbjoernhansen.com/ !try; do();




Re: Redirecting through proxy

2002-08-29 Thread Ask Bjoern Hansen

On Thu, 29 Aug 2002, Abd El-Hamid Mohammed wrote:

 RewriteEngine on
 RewriteRule ^/abc(.*) http://abc.use-trade.com:8080$1 [P]
 ProxyPass /abc/   http://abc.use-trade.com:8080/
 ProxyPassReverse /abc/ http://abc.use-trade.com:8080/

 and it works great for redirecting http://www.mydomain.com/abc/
 but it fails with http://www.mydomain.com/abc without the trailing slash
 as the first page is the only page that displays correctly,

Because then it proxies http://www.mydomain.com/abc to
http://abc.use-trade.com:8080 - you need to add a rewrite rule in
the proxy for redirecting /abc to /abc/

  RewriteRule ^/abc /abc/ [R,L]


 - ask

-- 
ask bjoern hansen, http://www.askbjoernhansen.com/ !try; do();




Re: Apache::Session - What goes in session?

2002-08-21 Thread Ask Bjoern Hansen

On Tue, 20 Aug 2002 [EMAIL PROTECTED] wrote:

 We are investigating using IPC rather then a file based
 structure but its purely investigation at this point.

 What are the speed diffs between an IPC cache and a
 Berkely DB cache. My gut instinct always screams 'Stay Off
 The Disk' but my gut is not always right.. Ok, rarely
 right.. ;)

IPC (for many definitions of that) has all sorts of odd limitations
and isn't that fast.  Don't go there.

The disk is usually much faster than you think.  Often overlooked
for caching is a simple file based cache.

Here's a story about that:

A while ago Graham Barr and I spend some time going through a number
of iterations for a self cleaning cache system.  It would take
lots of writes and fewer reads.  In each cache entry a number of
integers would be stored.  Just storing the last thousand entries
would be enough.

We tried quite a few different approaches; the most noteworthy was a
system of semaphores to control access to a number of slots in a
BerkeleyDB.  That should be pretty fast, right?

It got a bit complicated as our systems didn't support that many
semaphores, so we had to come up with a system for sharing the
semaphores across multiple slots in the database.

Designing and writing this implementation took a few days.  It was
really cool.

Anyway, after fixing that and a few deadlocks we were benchmarking
away.  The system was so clever.  We thought it was simple and neat.
Okay, neat at least.  And it was really slow. Slow. (~200 writes a
second on a 400MHz Pentium II if I recall correctly).

First we suspected we did something wrong with the semaphores, but
further benchmarking showed that the BerkeleyDB just wasn't that
fast for writing.

30 minutes thinking and 30 minutes typing code later we had a
prototype for a simple filebased system.

Now using good old Fcntl to control access to simple flat files.
(Data serialized with pack(N*, ...); I don't think anything beats
pack and unpack for serializing data).

The expiration went into the data and purging the cache was a simple
cronjob to find files older than a few minutes and deleting them.

The performance?  I don't remember the exact figure, but it was at
least several times faster than the BerkeleyDB system.  And *much*
simpler.


The morale of the story:  Flat files rock!  ;-)


  - ask

-- 
ask bjoern hansen, http://www.askbjoernhansen.com/ !try; do();




Re: Cache::Cache issues

2002-08-20 Thread Ask Bjoern Hansen

On Tue, 20 Aug 2002, Chris wrote:

 my $timeout1 = $Cache-get_object('1')-get_expires_at();
 my $timeout2 = $Cache-get_object('1')-get_expires_at();

... ETOOMUCHCUTNPASTE.

:-)


 - ask

-- 
ask bjoern hansen, http://www.askbjoernhansen.com/ !try; do();




Re: Mod_perl Application Development

2002-08-20 Thread Ask Bjoern Hansen

On Sun, 18 Aug 2002, Jonathan Lonsdale wrote:

 Here's a few approaches I thought of:

In a previous life[1] I made a system that was configured like

perl
  my $site1 = new Foo::Site(site = 'www.example.com');
  $site1-register_handler(
new Foo::ImageHandler(path = '/images/', format = 'png');
  );
  $site1-register_handler(
new Foo::SomeOtherHandler(...);
  );
  ...
/perl

VirtualHost
   ...
   PerlHandler $site1-take_request
/VirtualHost

(it wasn't quite like that; the site configurations were all in Perl
modules dynamically utilizing perl_sections to configure Apache).

When running register_handler, the Foo::Site object would call some
method on the Handler object to figure out which namespace or which
requests it wanted to handle.  During take_request it would then
just dispatch the right handler.

This made it really easy to activate a subsystems when the customer
needed them.  The system also made it easy to customize the handlers
for each customer. (Just inherit the base Foo::BarHandler into
Customer::BarHandler and add the extra magic).

  - ask

[1] okay, not quite a previous life; but it is more than 4 years
ago. :-)

-- 
ask bjoern hansen, http://www.askbjoernhansen.com/ !try; do();




Re: [mp 2.0] v2.0.40 dev of apache

2002-07-25 Thread Ask Bjoern Hansen

On Wed, 24 Jul 2002, Jann Linder wrote:

 Any ideas?  Is there a dev cvs site for 'unreleased' modperl builds which we
 can log in on?

http://perl.apache.org/contribute/cvs_howto.html

  Is there a separate team developing mod_perl or is is still Mr.
 Stein?

I think you are a bit confused here. :-)  Greg Stein made mod_dav.
mod_perl is primarily written by Doug MacEachern.
http://perl.apache.org/about/contributors/people.html

There's a mailinglist for the development of the mod_perl internals.


  - ask

ps. if you are not receiving frequent messages from the list you are
probably not subscribed.  Send mail to
[EMAIL PROTECTED] to change that.

-- 
ask bjoern hansen, http://askbjoernhansen.com/   !try; do();




Re: Mod_perl 1.27 and Apache 1.3.26

2002-07-12 Thread Ask Bjoern Hansen

On Fri, 12 Jul 2002, Rudolf Wolf wrote:

 Not Acceptable
 An appropriate representation of the requested resource / could not be found on this 
server.
 Available variants:
 index.html.ca , type text/html, language ca
 index.html.cz , type text/html, language cz
[...]

That's not a mod_perl problem, try the httpd users list.

[EMAIL PROTECTED]


  - ask

-- 
ask bjoern hansen, http://askbjoernhansen.com/ !try; do();




Re: Apache Web Server vulnerability

2002-06-21 Thread Ask Bjoern Hansen

On Wed, 19 Jun 2002, dreamwvr wrote:

 my comments FWIW
 This means thus far does not impact as_seriously little endian NIX
 based architectures. The reason being? That Apache spawns a pool of
 child processes to serve requests. Therefore a DoS kills the child serving
[...]

This doesn't make much sense at all.

64bit binaries are exploitable.  There are also exploits for several
32bit systems.

If done right these will give the attacker shell access to the
server.  Your comments about threaded vs multi processed are only
relevant when the exploit is not done right (when the server
SEGVs).


 - ask

-- 
ask bjoern hansen, http://askbjoernhansen.com/ !try; do();




Re: [JOB WANTED] Seeking additional Perl/Mod_perl work...

2002-06-21 Thread Ask Bjoern Hansen

On Thu, 20 Jun 2002, Stas Bekman wrote:

[...]
 That's a sensitive issue. We were always welcoming posts from
 individuals looking for jobs, and companies looking to hire (in the
 mod_perl area of course). Though I tend to agree with Gunther that such
 posts from for-profit companies looking for projects is a bit unfair,
 especially if it's going to escalate into a high traffic of irrelevant
 posts (with or without special subject tags). It's important to give
 hand to individuals who don't have the power/resources for-profit
 companies have, and I believe that's where the distinction lays.

Uh, most working individuals are for-profit too.

I don't see a big problem with companies posting about availability
as long as they keep it as a rare thing (every 18 months?) and it
doesn't escalate.  If it does I am sure we can figure out to make it
stop. :-)

Posting both jobs and availability at the urls you posted sure
sounds like a better idea though.

-- 
ask bjoern hansen, http://askbjoernhansen.com/ !try; do();




Re: Question about Work Wanted ads

2002-06-21 Thread Ask Bjoern Hansen

On Wed, 19 Jun 2002, southernstar wrote:

 I was aware that on occasion individuals are welcome to post work
 wanted ads, but I have some specific questions about how I can
 actually get some short contract work here and there, since:
[...]

Get involved with some of the open source projects; that's always
good to put on your resume.


 - ask

-- 
ask bjoern hansen, http://askbjoernhansen.com/ !try; do();




[ANNOUNCE] Apache::DBI 0.89

2002-06-21 Thread Ask Bjoern Hansen


Since early 1997 Edmund Mergl has been developing and maintaining
Apache::DBI.  I would think that it's now one of the most used
Apache related modules (and one of the most stable!)

In the last almost 3 years only two bugs has been found.  Edmund no
longer has time to make releases and such, so I fixed the last bug
and made a new release which is available on CPAN.

Download here:
http://www.cpan.org/authors/id/ABH/Apache-DBI-0.89.tar.gz

Change file here;
http://cvs.perl.org/cvsweb/Apache/DBI/Changes?rev=1.2content-type=text/x-cvsweb-markup

CVS instructions here:
http://cvs.perl.org/info?module=Apache/DBI



  - ask

-- 
ask bjoern hansen, http://askbjoernhansen.com/ !try; do();




Re: libapreq: could not create/open temp file

2002-06-08 Thread Ask Bjoern Hansen

On Sat, 8 Jun 2002, Stas Bekman wrote:

  Has anybody already seen this error ???
[...]
  [libapreq] could not create/open temp file

sounds like something is running out of filehandles; or a temp file
system of some kind running out of space.

Try applying the patch Stas sent and see what it changes to.
 
 - ask

-- 
ask bjoern hansen, http://ask.netcetera.dk/ !try; do();




Re: persistent Mail::ImapClient and webmail

2002-06-08 Thread Ask Bjoern Hansen

On Fri, 7 Jun 2002, Richard Clarke wrote:

 p.s. Yes quite obviously if I have 100 children then I'll be connected to
 the IMAP server 100 times per user, hence possibly the need to have a either
 a dedicated daemon connected to the IMAP server once or some successfuly way
 of sharing IMAP objects between children.

the trivial way would be to have the mod_perl processes login (once
each) as some kind of super user and then access the folders as
[username]/INBOX etc.


 - ask

-- 
ask bjoern hansen, http://ask.netcetera.dk/   !try; do();




Re: Doing security for backend applications

2002-06-05 Thread Ask Bjoern Hansen

On Tue, 4 Jun 2002, Ken Miller wrote:

[...]
 So, php application requests would bounce from the proxy server to the mod
 perl server to the php server.

You could also make it so it's only when requests needs to be
authenticated they go to the mod_perl server.

Something like having the php server forward authentication requests
to the mod_perl server; but support the same cookie format would be
relatively simple.

 This is all related to a single sign-on environment - once the user has
 signed on an encrypted cookie will contain the application security
 information used to authorize the user int the various applications.

at perl.org we have made it so authentication requests gets
forwarded, and then we have an internal interface for the various
servers can validate and migrate authentication cookies.

You should be able to find documentation on how passport.com does
it; if nothing else then on the pages where it's described why their
implementation was insecure at some point. ;-)

 - ask

-- 
ask bjoern hansen, http://ask.netcetera.dk/   !try; do();





Apache::DBI connection cache

2002-05-22 Thread Ask Bjoern Hansen


Apache::DBI is turning the argument hashref into the cache key 
with the following code,

my ($key, $val);
while (($key,$val) = each %{$args[3]}) {
   $Idx .= $;$key=$val;
}

can anyone think of a good reason not to change that to something 
like

  map { $Idx .= $;$_=$args[3]-{$_} } sort keys %{$args[3]};

(or a similar for loop)

(My problem, obviously, was that Apache::DBI got several connections
to the same database with the same args; but the hash had the args
ordered in a different way.)


 - ask

-- 
ask bjoern hansen, http://ask.netcetera.dk/ !try; do();





Re: Apache::DBI connection cache

2002-05-22 Thread Ask Bjoern Hansen

On Wed, 22 May 2002, Perrin Harkins wrote:

  Apache::DBI is turning the argument hashref into the cache key 
  with the following code,
[...]
  can anyone think of a good reason not to change that to something 
  like
  
map { $Idx .= $;$_=$args[3]-{$_} } sort keys %{$args[3]};
 
 Good find.  That's a bug.  Fix it.

I sent a patch to Edmund.


 - ask

-- 
ask bjoern hansen, http://ask.netcetera.dk/ !try; do();




Re: [OT] Doubt on directories for development

2002-04-21 Thread Ask Bjoern Hansen

On Sat, 20 Apr 2002, F. Xavier Noria wrote:

 I am working in my first mod_perl real-life project, I would like to ask
 you for a directory layout for development.

 The fact is that developers in my team have Apache under /usr/local in
 Linux machines, but we would prefer to develop as normal users, not as
 www or nobody, though that will be the user in production.

 What is the standard way to configure things for that?

I usually just setup an httpd.conf (and apachectl) for the user and
then use mod_proxy to forward requests for the virtualhost to
whatever high port the user is using.

The serverroot is set to be /home/user/apache and the libexec
directory symlinked from /usr/local/apache/libexec (or wherever the
system apache is installed).


 - ask

-- 
ask bjoern hansen, http://ask.netcetera.dk/   !try; do();





Re: [ANNOUNCE] The New mod_perl logo - results now in...

2002-03-23 Thread Ask Bjoern Hansen

On Sat, 16 Mar 2002 [EMAIL PROTECTED] wrote:

[...]
 To make things thing even more complicated I agree the need of a name
 with a sounding image, which will help mod_perl to grow into corporate
 computing (our future jobs).
 
 Recently I had a discussion with a Java programmer, who said that
 mod_perl is a try to save the obsolete language Perl. His argument was
 that only Java programmers are searched, especially here in Europe.
 
 So I see three requirements:
  - Having a name and logo which tells the truth,
it's Perl and it was good.
  - The name should defer to Perl, should be it's own brand.
  - The sounding must be stronger then API

Please go back to the marketing people and tell them to smoke 
somewhere else.

 o) mod_perl is the perl apache module. Apache modules are called 
mod_foo.c.

 o) It is just an interface to the Apache API.

 o) We've had this discussion several times before; I even had to 
check the year on the postings to be sure that I was not 
replying to an old thread.  Please stop.
 

 - ask 

-- 
ask bjoern hansen, http://ask.netcetera.dk/ !try; do();
more than a billion impressions per week, http://valueclick.com





Re: loss of shared memory in parent httpd

2002-03-12 Thread Ask Bjoern Hansen

On Tue, 12 Mar 2002, Graham TerMarsch wrote:

[...] 
 We saw something similar here, running on Linux servers.  Turned out to be 
 that if the server swapped hard enough to swap an HTTPd out, then you 
 basically lost all the shared memory that you had.  I can't explain all of 
 the technical details and the kernel-ness of it all, but from watching our 
 own servers here this is what we saw on some machines that experienced 
 quite a high load.
 
 Our quick solution was first to reduce some the number of Mod_perls that 
 we had running, using the proxy-front-end/modperl-back-end technique,

You should always do that. :-)

 and then supplemented that by adding another Gig of RAM to the
 machine.

 And yes, once you've lost the shared memory, there isn't a way to get it 
 back as shared again.  And yes, I've also seen that when this happens 
 that it could full well take the whole server right down the toilet with 
 it (as then your ~800MB of shared memory becomes ~800MB of _physical_ 
 memory needed, and that could throw the box into swap city).

I forwarded this mail to one of the CitySearch sysadmins who had
told about seeing this.  He is seeing the same thing (using kernel
2.4.17), except that if he disables swap then the processes will get
back to reporting more shared memory.  So maybe it's really just
GTop or the kernel reporting swapped stuff in an odd way.

No, I can't explain the nitty gritty either. :-)

Someone should write up a summary of this thread and ask in a
technical linux place, or maybe ask Dean Gaudet.


 - ask 

-- 
ask bjoern hansen, http://ask.netcetera.dk/ !try; do();




Re: performance testing - emulating real world use

2002-03-12 Thread Ask Bjoern Hansen

On Tue, 12 Mar 2002, Andrew Ho wrote:

[...]
 This is extremely effective if you have enough real user data because
 you're not inventing user load. You're using real user load.

Not really; you also have to emulate the connection speeds of the
users.  Or does the tools you mentioned do that?


 - ask
 
-- 
ask bjoern hansen, http://ask.netcetera.dk/ !try; do();
more than a billion impressions per week, http://valueclick.com




Re: [Patch] Apache::ProxyPassThru

2002-03-08 Thread Ask Bjoern Hansen

On Fri, 8 Mar 2002, Tatsuhiko Miyagawa wrote:

 here is a patch for Apache::ProxyPassThru, fixing the bug that
 multiple response headers are mungled into one (like double Set-Cookie:s)

Thanks.

Look for 0.94 on a mirror near you within a day or two.


 - ask

-- 
ask bjoern hansen, http://ask.netcetera.dk/   !try; do();





modperl@apache.org is now modperl@perl.apache.org

2002-03-07 Thread Ask Bjoern Hansen


[EMAIL PROTECTED] is now [EMAIL PROTECTED]  The old
addresses should still work; but please use the new ones.

If you change any mentions on webpages and such; please always use
[EMAIL PROTECTED] instead of the posting address.

Please let me know if you notice anything odd or broken related to
this.  Thanks! :-)


 - ask

-- 
ask bjoern hansen, http://ask.netcetera.dk/   !try; do();





Re: Apache::MP3 requires PerlSetupEnv on, patch to convert toApache::Request

2002-03-05 Thread Ask Bjoern Hansen

On Mon, 4 Mar 2002, Stas Bekman wrote:

[] 
 Can CGIpm detect that 'PerlSetupEnv Off' is in effect and die if that's 
 the case? for example by testing some env var that most likely should be 
 set with 'PerlSetupEnv On'? eg:

For now I have added that check to Apache::MP3  (with warn instead
of die If it goes into CGIpm it shouldn't be with die, you might
want to use CGIpm but not any of the functions that are using
%ENV)



 - ask

-- 
ask bjoern hansen, http://asknetceteradk/ !try; do();
more than a billion impressions per week, http://valueclickcom




[ADMIN] modperl list to move!

2002-03-01 Thread Ask Bjoern Hansen

Hi,

Early next week I will move the modperl lists that are at apacheorg
to perlapacheorg; please be ready to adjust your procmail filters  
:-)  The old adresses will keep working at least for a while


 - ask

-- 
ask bjoern hansen, http://asknetceteradk/ !try; do();
more than a billion impressions per week, http://valueclickcom




Re: Mistaken identity problem with cookie

2002-02-15 Thread Ask Bjoern Hansen

On Fri, 15 Feb 2002, Rob Nagler wrote:

  small operations.  I'm pretty convinced that the problem is on their
  end.  My theory is that these proxies may have cached the cookie
  with an IP address which they provide their clients.
 
 Have you tried capturing all ethernet packets and seeing if the raw
 data supports this conclusion.  Checkout:
 
 http://www.ethereal.com/

Much easier is to just use Apache::DumpHeaders.

I usually have stuff that suspects a weird transaction log it with 
DumpHeaders. Make a nice trail to investigate for patterns or 
whatevers.

http://search.cpan.org/search?dist=Apache-DumpHeaders


 - ask

-- 
ask bjoern hansen, http://ask.netcetera.dk/ !try; do();
more than a billion impressions per week, http://valueclick.com




Re: mod_perl documentation

2002-02-14 Thread Ask Bjoern Hansen

On Wed, 13 Feb 2002, peteman wrote:

 What format are the documentation files (INSTALL, README, SUPPORT, etc)
 in, and why are they not in plain text format??  It's giving me a
 headache trying to read them.  This is horidly evil(IMO), might i
 suggest that you distribute documentation in standard text format, so
 that everyone can read them(without getting a headache).

They are in standard POD format.  Try perldoc INSTALL or pod2text
INSTALL.


 - ask

-- 
ask bjoern hansen, http://ask.netcetera.dk/   !try; do();





Re: Custom Logging and User Tracking

2002-02-13 Thread Ask Bjoern Hansen

On Wed, 13 Feb 2002, Ryan Parr wrote:

 I'm trying to setup some custom logging including the whole
 User/Session tracking thing. The problem that I'm encountering is
 how to log for the page that was requested and ignore all the
 additional files that may be included in the page. I.e. graphics.

return DECLINED if $r-content_type =~ m!^image/!;

?


 - ask

-- 
ask bjoern hansen, http://ask.netcetera.dk/ !try; do();
more than a billion impressions per week, http://valueclick.com




Re: [WOT] Google Programming Contest.

2002-02-08 Thread Ask Bjoern Hansen

On Thu, 7 Feb 2002, Medi Montaseri wrote:

 This reaminds me of a Brain Bowl competition at USC a few years
 ago, where the winner (a one man Perl speaking team) solved 4 out
 of 6 problems in the given time (compared to other multiple member
 teams) and the school of engineering decided to remove Perl as one
 of the possible languages

The myth lives on. :-)  It's not quite true.  It was at UCLA and
the story was different:

http://nntp.perl.org/group/perl.advocacy;max=961
http://nntp.perl.org/group/perl.advocacy/956

 - ask

-- 
ask bjoern hansen, http://ask.netcetera.dk/ !try; do();
more than a billion impressions per week, http://valueclick.com




Re: [OT] Unsubscribe help

2002-02-08 Thread Ask Bjoern Hansen

On Thu, 7 Feb 2002, Per Møller wrote:

 I have send a mail to [EMAIL PROTECTED] but it does not
 seem to work. I'm still getting the mails from this mailinglist.

If you are not even getting an autoreply back, it's probably because
you have misconfigured the envelope sender.  If you get a bounce
back that the address [EMAIL PROTECTED] doesn't exist, then it's
because your Outlook is messing up the address when you reply to the
confirmation mail.
 
 Who's the person responsible for this list?

I am over at [EMAIL PROTECTED]  Send mail there if you still
have problems.


 - ask

-- 
ask bjoern hansen, http://ask.netcetera.dk/ !try; do();
more than a billion impressions per week, http://valueclick.com





Re: modperl growth

2002-02-04 Thread Ask Bjoern Hansen

On Sat, 2 Feb 2002, Robin Berjon wrote:

 http://www.securityspace.com/s_survey/data/man.200201/apachemods.html?mod=cGVybA==
 
 For some reason, in December, it would seem that modperl just jumped ahead in 
 market share (from 13% to nearly 20%). [...]

At least on Netcraft big jumps are usually explained by a big 
hosting provider or a domain name parking service changing 
servers.

13% to 20% does seem odd though.

-- 
ask bjoern hansen, http://ask.netcetera.dk/ !try; do();
more than a billion impressions per week, http://valueclick.com




Re: performance coding project? (was: Re: When to cache)

2002-02-01 Thread Ask Bjoern Hansen

On Sat, 26 Jan 2002, Stas Bekman wrote:

[...]
  It's much better to build your system, profile it, and fix the bottlenecks.
  The most effective changes are almost never simple coding changes like the
  one you showed, but rather large things like using qmail-inject instead of
  SMTP, caching a slow database query or method call, or changing your
  architecture to reduce the number of network accesses or inter-process
  communications.
 
 It all depends on what kind of application do you have. If you code is 
 CPU-bound these seemingly insignificant optimizations can have a very 
 significant influence on the overall service performance. Of course if 
 you app, is IO-bound or depends with some external component, than your 
 argumentation applies.

Eh, any real system will be a combination.  Sure; when everything
works then it's worth finding the CPU intensive places and fix them
up, but for the most part the system design is far far more
important than any code optimiziation you can ever do.

My usual rhetorics: Your average code optimization will gain you at
most a few percent performance gain.  A better design can often make
things 10 times faster and use only a fraction of your memory.

 On the other hand how often do you get a chance to profile your code and 
   see how to improve its speed in the real world. Managers never plan 
 for debugging period, not talking about optimizations periods. And while 
 premature optimizations are usually evil, as they will bait you later, 
 knowing the differences between coding styles does help in a long run 
 and I don't consider these as premature optimizations.

If you don't waste time profiling every little snippet of code you 
might have more time to fix the real bottlenecks in the end. ;-)
 
[...]
 All I want to say is that there is no one-fits-all solution in Perl, 
 because of TIMTOWTDI, so you can learn a lot from running benchmarks and 
 picking your favorite coding style and change it as the language 
 evolves. But you shouldn't blindly apply the outcomes of the benchmarks 
 without running your own benchmarks.

Amen.

(And don't get me wrong; I think a repository of information about
the nitty gritty optimization things would be great - I just find it
to be bad advice to not tell people to do the proper design first).


 - ask

-- 
ask bjoern hansen, http://ask.netcetera.dk/ !try; do();
more than a billion impressions per week, http://valueclick.com





Re: performance coding project? (was: Re: When to cache)

2002-02-01 Thread Ask Bjoern Hansen

On Sat, 26 Jan 2002, Perrin Harkins wrote:

  It all depends on what kind of application do you have. If you code is
  CPU-bound these seemingly insignificant optimizations can have a very
  significant influence on the overall service performance.
 
 Do such beasts really exist?  I mean, I guess they must, but I've never
 seen a mod_perl application that was CPU-bound.  They always seem to be
 constrained by database speed and memory.

At ValueClick we only have a few BerkeleyDBs that are in the
request loop for 99% of the traffic; everything else is in fairly
efficient in-memory data structures.

So there we do of course care about the tiny small optimiziations 
because there's a direct correlation between saved CPU cycles and 
request capacity.

However, it's only that way because we made a good design for the
application in the first place. :-)  (And for all the other code we
rarely care about using a few more CPU cycles if it is
easier/cleaner/more flexible/comes to mind first). Who cares if the
perl code gets ready to wait for the database a few milliseconds
faster? :-)


 - ask

-- 
ask bjoern hansen, http://ask.netcetera.dk/ !try; do();
more than a billion impressions per week, http://valueclick.com




Re: mod_perl Developer's Cookbook

2002-02-01 Thread Ask Bjoern Hansen

On Thu, 31 Jan 2002, Paul Lindner wrote:

  I won't deal with amazon:  http://www.noamazon.com
 
 I just added a page with direct links for eight other bookstores.
 It's now available at http://www.modperlcookbook.org/order.html

Amazon are the cheapest though:  
http://www.allbookstores.com/book/compare/0672322404  :-)


 - ask

-- 
ask bjoern hansen, http://ask.netcetera.dk/ !try; do();
more than a billion impressions per week, http://valueclick.com




Re: Thumbnail generator

2002-02-01 Thread Ask Bjoern Hansen

On Mon, 21 Jan 2002, Robert Landrum wrote:

[...]
 You may want to take a look at Apache::ImageMagick (if you not already
 have). It's let's you create thumbnails very easy (just two parameters
 pic.xxx/scale?geometry=100x100) and ImageMagick supports over 80 different
 formats. It also handles conversion from 4 color pictures to RGB for your
 thumbnails and many other things, if you need them.
 
 ImageMagick is way too slow for use in a production system. 
 Especially if your resizing large images into thumbnails.  I suggest 
 sacrificing space for speed and pre-generating all your thumbnails.

I do that too (with Image::Magick).  If the pictures are large it
takes forever to scale them even with a more efficient lib.

 Most of the time libjpeg will do everything you need, including 
 scaling.  I suggestion GD with Jpeg support or Inline.pm/C/libjpeg 
 for real time conversion of jpegs.

libjpeg doesn't (afaik) do sharpening/unsharp mask and the two
billion other things that are nice to have if you are trying to get
a high quality output.

http://photo.netcetera.dk/g/snow|2002/01/01/DSC_0126.jpg;size=me

:-)
 
 
 - ask

-- 
ask bjoern hansen, http://ask.netcetera.dk/ !try; do();
more than a billion impressions per week, http://valueclick.com




Re: mod_perl site challenge: proposal to use ASF site design (fwd)

2002-01-01 Thread Ask Bjoern Hansen

-- Forwarded message --
Date: Mon, 17 Dec 2001 14:30:24 -0800 (PST)
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: mod_perl site challenge: proposal to use ASF site design

David wrote:

 (a) See if others also think that the three alternatives for a mod_perl site
 are not very desirable. If you agree, please speak up and say that you
 agree.

I don't have a strong opinion.

 (b) See if others also think that using the ASF generic site design (even
 though it's not cool and distinctive) would be a good idea. If you agree,
 please speak up and say that you agree.

I agree that using the ASF generic site is a good idea.  And why not?
mod_perl is so closely integrated with Apache, why shouldn't mod_perl's
website at least adapt the Apache website look and feel?

 Also, lets keep in mind something that Stas pointed out to me: most anything
 is a step up from our existing site design. So, if we go with one of the
 three existing options it's still a step up.

That's for sure!  :)

-- keith
[EMAIL PROTECTED]
public key:  http://wombat.san-francisco.ca.us/kkeller/public_key
alt.os.linux.slackware FAQ:  http://wombat.san-francisco.ca.us/perl/fom





Re: mod_perl site challenge: proposal to use ASF site design (fwd)

2002-01-01 Thread Ask Bjoern Hansen

-- Forwarded message --
Date: Mon, 17 Dec 2001 17:12:56 -0600
From: Carlos Ramirez [EMAIL PROTECTED]
To: David Harris [EMAIL PROTECTED], [EMAIL PROTECTED]
Subject: Re: mod_perl site challenge: proposal to use ASF site design

 From: David Harris [EMAIL PROTECTED]

 Carlos Ramirez's design is broken: broken navigation and pages that don't
 even exist. The page look is somewhat nice, but I can't really evaluate the
 navigation because it's so broken.

My purpose was to submit a proposed 'layout' and
'navigation' and not a fully function website (due to
time constraints). I think you can get the picture of
how the site will navigate without having all the content.
I mentioned this to Stas when I submitted it.

But, let's not forget that people where given a chance to
submit their designs and ideas and also to vote. I did not
have too much time to complete entry (hence the broken
links and missing content), but because I wanted some
change, I submitted a design and voted. I was very
surprised to see only three entries and even more when
Stas announced the low  turn-out. But, this does not
justify the elimination of the 'election', altogether.
We should go with the winning design and go from there.

We can always tweak the winning design abit aftwards (??).

My only suggestion is that the navigation of the site be
somewhere on the top instead of 'squishing' the menu and
the content together. You have more real estate for
content when the navigation is on top. Which is the
main purpose for sites like these. $0.02

-Carlos





Rent.com runs mod_perl (fwd)

2002-01-01 Thread Ask Bjoern Hansen

-- Forwarded message --
Date: Fri, 14 Dec 2001 14:27:41 -0800
From: Eric Hammond [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Rent.com runs mod_perl


http://www.rent.com/

Rent.com is a dynamic, database driven web site built on mod_perl.
Initial development took 3 months to replace an NT/IIS/ASP
implementation.

--
Eric Hammond
[EMAIL PROTECTED]




Re: [RFC] Apache::CacheContent - Caching PerlFixupHandler

2001-12-11 Thread Ask Bjoern Hansen

On Thu, 6 Dec 2001, Paul Lindner wrote:

  BTW -- I think where the docs are cached should be configurable.  I don't
  like the idea of the document root writable by the web process.
 
 That's the price you pay for this functionality.  Because we use
 Apache's native file serving code we need a url-directory mapping
 somewhere.

uh, why couldn't Apache::CacheContent just set 
$r-filename(/where/we/put/the/cache/$file) ?

If you add Bill's suggestion about caching on args, headers and
whatnot you would (on some filesystems) need something like that
anyway to make a hashed directory tree.


 - ask

-- 
ask bjoern hansen, http://ask.netcetera.dk/ !try; do();
more than a billion impressions per week, http://valueclick.com




Re: [OT] Re: search.cpan.org

2001-12-04 Thread Ask Bjoern Hansen

On Tue, 27 Nov 2001, Nick Tonkin wrote:

 Well, ask Ask if you want the whole truth. But when I saked him that's
 what he said. Maybe there's a problem with the architecture and some
 pre-indexing is done per session or something suboptimal like that. Ask?

No, Robert is right. It's just searches that are doing a full scan
of the database.  I know Graham is working on a better search
system.

If Bill got swish-e to support incremental database updates I'm sure
it would help. ;-) 


 - ask

-- 
ask bjoern hansen, http://ask.netcetera.dk/ !try; do();
more than a billion impressions per week, http://valueclick.com





Re: Hi

2001-12-04 Thread Ask Bjoern Hansen

On Tue, 4 Dec 2001, Robert Landrum wrote:

 If this guy is going to be sending us shit all night, I suggest we 
 deactivate his account.

I have unsubscribed him.  In general it's much more useful to send 
suggestions like that to [EMAIL PROTECTED] or [EMAIL PROTECTED] 
than to the list.


 - ask

-- 
ask bjoern hansen, http://ask.netcetera.dk/ !try; do();
more than a billion impressions per week, http://valueclick.com




Re: no_cache()

2001-11-15 Thread Ask Bjoern Hansen

On Thu, 15 Nov 2001, Rasoul Hajikhani wrote:

 I am using $request_object-no_cache(1) with no success. Isn't it
 supported any more? Can some one shed some light on this for me...

What do you mean with no success?  What are you trying to do?

-- 
ask bjoern hansen, http://ask.netcetera.dk/ !try; do();
more than a billion impressions per week, http://valueclick.com




Re: CVS

2001-11-15 Thread Ask Bjoern Hansen

On Thu, 15 Nov 2001, Jonathan M. Hollin wrote:

 I am currently developing a content management system under mod_perl, with
 data stored in an RDBMS (MySQL at present, but Oracle on the production
 server).
 
 I would like to add version control to published documents (read pages) and
 wondered if anyone has any experience of this who would be willing to offer
 me some advice. 

In a previous life I made something like that.  I just used an extra
table where I stored the RCS data with the revision history.


 - ask

-- 
ask bjoern hansen, http://ask.netcetera.dk/ !try; do();
more than a billion impressions per week, http://valueclick.com




RE: Prototype Mismatch - and AN APOLOGY

2001-11-07 Thread Ask Bjoern Hansen

On Wed, 7 Nov 2001, Jonathan M. Hollin wrote:

 APOLOGY
 -
 I posted a message to this list with a small Perl script attached (without
 ZIP-ing it first).  This has triggered off numerous bounced mail virus
 alerts and I apologise for this.  I will avoid repeating that mistake in
 future.  Thank you for your patience.

Please don't.  It's much easier to open when it's not compressed or
something like that.  

You could avoid triggering the brain dead virus checkers by just
including the script within the mail.


 - ask 

-- 
ask bjoern hansen, http://ask.netcetera.dk/ !try; do();
more than a billion impressions per week, http://valueclick.com






Re: Excellent article on Apache/mod_perl at eToys

2001-10-26 Thread Ask Bjoern Hansen

On 22 Oct 2001, Matthew Kennedy wrote:

 Why was Berkeley DB chosen for caching when a RDBMS (mysql in
 this case) was already being used?

For speed.

You want to hit the RDBMS as little as possibly; Berkeley DB makes a
good cache.
 

 - ask

-- 
ask bjoern hansen, http://ask.netcetera.dk/   !try; do();





Re: search engine module?

2001-10-15 Thread Ask Bjoern Hansen

On Fri, 12 Oct 2001, Perrin Harkins wrote:

[...]
 Plus lots of other stuff like Glimpse and Swish which interface to C-based
 engines.

I've had good luck with http://swish-e.org/2.2/


 - ask

-- 
ask bjoern hansen, http://ask.netcetera.dk/ !try; do();
more than a billion impressions per week, http://valueclick.com




Re: ANN/RFC: Apache::Session::Generate variants

2001-10-10 Thread Ask Bjoern Hansen

On Thu, 11 Oct 2001, Tatsuhiko Miyagawa wrote:

 Note that if you try to use these modules functionality,
 Apache::Session::Flex should be patched with one included in both
 tarballs.

I sent a patch to Jeffrey last week or such that (I imagine) covers
the same thing.

-- 
ask bjoern hansen, http://ask.netcetera.dk/ !try; do();
more than a billion impressions per week, http://valueclick.com




Re: ANN/RFC: Apache::Session::Generate variants

2001-10-10 Thread Ask Bjoern Hansen

On Thu, 11 Oct 2001, Tatsuhiko Miyagawa wrote:

 Here is Apache::Session::Generate::* variants, which especially
 uses Apache standard C-modules.

 Apache::Session::Generate::ModUniqueId
   http://bulknews.net/lib/archives/Apache-Session-Generate-ModUniqueId-0.01.tar.gz
   http://bulknews.net/lib/archives/Apache-Session-Generate-ModUniqueId-0.01.html

   uses mod_unique_id for session id.

Cool.

 Apache::Session::Generate::ModUsertrack
   http://bulknews.net/lib/archives/Apache-Session-Generate-ModUsertrack-0.01.tar.gz
   http://bulknews.net/lib/archives/Apache-Session-Generate-ModUsertrack-0.01.html

   uses mod_usertrack's cookie for session id.

Don't do that!  mod_usertrack is not meant to be used for secure
session ids.


 - ask

-- 
ask bjoern hansen, http://ask.netcetera.dk/ !try; do();
more than a billion impressions per week, http://valueclick.com




Apache::Request coredumps on FreeBSD

2001-10-06 Thread Ask Bjoern Hansen

Hi,

I am using FreeBSD 4.4.  My newly build httpd coredumps when I load
Apache::Request.  Any clues would be most appreciated.  bt, build
parameters for perl, apache and mod_perl and perl -V output below.

 - ask

$ gdb /home/perl/apache/bin/httpd
(gdb) run -X [...]
0x282f8f13 in boot_Apache__Request ()
   from /home/perl/lib/site_perl/5.6.1/i386-freebsd/auto/Apache/Request/Request.so
(gdb) bt
#0  0x282f8f13 in boot_Apache__Request ()
   from /home/perl/lib/site_perl/5.6.1/i386-freebsd/auto/Apache/Request/Request.so
#1  0x2826de93 in Perl_pp_entersub () from /home/allbooks/apache/libexec/libperl.so
#2  0x282687be in Perl_runops_standard () from /home/allbooks/apache/libexec/libperl.so
#3  0x2822ba0a in S_call_body () from /home/allbooks/apache/libexec/libperl.so
#4  0x2822bb46 in perl_eval_sv () from /home/allbooks/apache/libexec/libperl.so
#5  0x2821337d in perl_require_module () from /home/allbooks/apache/libexec/libperl.so
#6  0x2820ecb8 in perl_cmd_module () from /home/allbooks/apache/libexec/libperl.so
#7  0x8054433 in invoke_cmd ()
#8  0x805489d in ap_handle_command ()
#9  0x805493b in ap_srm_command_loop ()
#10 0x8054fef in ap_process_resource_config ()
#11 0x8055930 in ap_read_config ()
#12 0x805ff29 in main ()
#13 0x804e251 in _start ()


I build my perl, apache and mod_perl like the following and then
installed libapreq 0.33 with ~perl/bin/perl Makefile.PL  make 
make install.


#!/bin/sh
cd src
PERL_VERSION=5.6.1
curl -z perl-$PERL_VERSION.tar.gz -O 
ftp://ftp.perl.org/pub/CPAN/src/perl-$PERL_VERSION.tar.gz \
 tar xzf perl-$PERL_VERSION.tar.gz
 cd perl-$PERL_VERSION \
 ./Configure -Dprefix=/home/perl -Uuselargefiles -des \
 make -j5 \
 make test \
 make install

...

#!/bin/sh
APACHE_VERSION=1.3.20
MODPERL_VERSION=1.26
cd src
curl -z apache_$APACHE_VERSION.tar.gz -O 
http://www.apache.org/dist/httpd/apache_$APACHE_VERSION.tar.gz  \
curl -z mod_perl-$MODPERL_VERSION.tar.gz -O 
http://www.apache.org/dist/perl/mod_perl-$MODPERL_VERSION.tar.gz  \
tar xzf apache_$APACHE_VERSION.tar.gz  \
tar xzf mod_perl-$MODPERL_VERSION.tar.gz  \
\
cd ~/src/apache_$APACHE_VERSION  \
\
./configure --prefix=/home/perl/apache --enable-shared=max \
   --enable-module=all --disable-rule=EXPAT \
   --with-perl=/home/perl/bin/perl \
 \
make -j4  make install \
 \
cd ~/src/mod_perl-$MODPERL_VERSION  \
~/bin/perl Makefile.PL \
   APACHE_SRC=/home/perl/src/apache_$APACHE_VERSION/src/ \
   USE_APXS=1 \
   WITH_APXS=/home/perl/apache/bin/apxs \
   EVERYTHING=1  \
make  make test  make install  \
cd ~/src  \
curl -O http://develooper.com/code/mpaf/mod_proxy_add_forward.c  \
../apache/bin/apxs -i -c mod_proxy_add_forward.c



$ /home/perl/bin/perl -V

Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration:
  Platform:
osname=freebsd, osvers=4.4-rc, archname=i386-freebsd
uname='freebsd miette.develooper.com 4.4-rc freebsd 4.4-rc #5: wed sep 12 03:15:29 
pdt 2001 [EMAIL PROTECTED]:homeusrobjusrsrcsysmiette i386 '
config_args='-Dprefix=/home/perl -Uuselargefiles -des'
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
useperlio=undef d_sfio=undef uselargefiles=undef usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
  Compiler:
cc='cc', ccflags ='-fno-strict-aliasing -I/usr/local/include',
optimize='-O',
cppflags='-fno-strict-aliasing -I/usr/local/include'
ccversion='', gccversion='2.95.3 20010315 (release) [FreeBSD]', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
ld='cc', ldflags ='-Wl,-E  -L/usr/local/lib'
libpth=/usr/lib /usr/local/lib
libs=-lgdbm -ldb -lm -lc -lcrypt -liconv -lutil
perllibs=-lm -lc -lcrypt -liconv -lutil
libc=, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
cccdlflags='-DPIC -fpic', lddlflags='-shared  -L/usr/local/lib'


Characteristics of this binary (from libperl):
  Compile-time options:
  Built under freebsd
  Compiled at Oct  6 2001 03:42:33
  @INC:
/home/perl/lib/5.6.1/i386-freebsd
/home/perl/lib/5.6.1
/home/perl/lib/site_perl/5.6.1/i386-freebsd
/home/perl/lib/site_perl/5.6.1
/home/perl/lib/site_perl
.


-- 
ask bjoern hansen, http://ask.netcetera.dk/   !try; do();





Re: [OT] clp.moderated, was- Re: Backticks as fast as XS

2001-09-28 Thread Ask Bjoern Hansen

On 27 Sep 2001, Joe Schaefer wrote:

[beginners lists]
 [2]: IIRC, they are at
   http://learn.perl.org/

yup, thousands of subscribers.  Incredibly amounts of (helpful)
mails.

http:[EMAIL PROTECTED]/
http:[EMAIL PROTECTED]/


 - ask

ps. we had some network trouble around noon Thursday (PST) on the
network where onion (serving learn.perl.org and others) is
located, that's why you couldn't connect. =)

-- 
ask bjoern hansen, http://ask.netcetera.dk/ !try; do();
more than a billion impressions per week, http://valueclick.com




Re: MSIISProbes.pm v1.03

2001-09-28 Thread Ask Bjoern Hansen

On Thu, 20 Sep 2001, Mike Schienle wrote:

  thanks to patches from Brice D. Ruth and others, a new version of
  MSIISProbes.pm is available at
  http://www.tonkinresolutions.com/MSIISProbes.pm.tar.gz

 Hi all -

 Can anyone provide a couple hints on getting this going with Tenon's
 iTools on MacOS X? For Reuven's CodeRed, it was just a matter of putting
 CodeRed.pm in /Library/Perl and adding the following code to the
 iTools.conf file (equivalent to httpd.conf).
[...]
 Any suggestions are greatly appreciated.

check the code and your system configuration for the location of
sendmail (or whatever the module uses to send mail).


 - ask

-- 
ask bjoern hansen, http://ask.netcetera.dk/ !try; do();
more than a billion impressions per week, http://valueclick.com




Re: [OT] New Micro$oft vulnerability?

2001-09-24 Thread Ask Bjoern Hansen

On 19 Sep 2001, Vivek Khera wrote:

 NT http://www.torkington.com/vermicide.txt has a mod_perl handler to
 NT catch the requests as soon as they arrive, and discard them with a
 NT minimum of work to Apache.  If your web server is struggling under the
 NT load, this might help.

 Why waste your mod_perl back-end's resources?  Do it in your front end
 reverse-proxy server with mod_rewrite:

 # trap CodeRed and send them away!
 Location /default.ida
  RewriteEngine On
  RewriteRule /default.ida 
http://www.microsoft.com/technet/treeview/default.asp?url=/technet/itsolutions/security/topics/codealrt.asp
 [last]
 /Location
 # trap exploits of code-red compromized systems.
 Files *.exe
  RewriteEngine On
  RewriteRule . 
http://www.microsoft.com/technet/treeview/default.asp?url=/technet/itsolutions/security/topics/codealrt.asp
 [last]
 /Files

 I'm sure the *.exe match should use a different URL inside microsoft,
 but what the heck... I had limited info when I set this up yesterday
 afternoon.

I don't believe that the worms follow redirects.  And what would the
point be anyway?  Overload Microsofts servers if we all could get
the worms to go there?

the above that seems like way too much work; I seem to be getting
away with the following here:

 # Nimda requests
 RewriteCond  %{HTTP_HOST}   ^www\$
 RewriteRule  .  /   [F,L]
 RewriteRule  ^/default.ida  /   [F,L]

(I put the above in the reverse proxy to shield the real thing
from the requests on the sites where it matters (like one where I
get a mail for each 404; it got really old really fast with this
Nimda crap).

Of course it doesn't work if you ever access the host as www
without the domain...


 - ask

-- 
ask bjoern hansen, http://ask.netcetera.dk/ !try; do();
more than a billion impressions per week, http://valueclick.com




Re: MSIISProbes.pm

2001-09-18 Thread Ask Bjoern Hansen

On Tue, 18 Sep 2001, Nick Tonkin wrote:

 I used a real ugly mod_rewrite hack to grab the requests (I didn't want to
 lump all reqs for root.exe or cmd.exe into the same 'worm') ... I'm sure
 others can improve on that. (BTW am I right in thinking that RewriteEngine
 on needs to be specified for each virtual host?)

Yes,

RewriteEngine on
RewriteRule ...
[...]

virtualhost ...
  [...]
  RewriteEngine on
  RewriteOptions inherit
/virtualhost

or something like that for each VirtualHost is your friend.

:-)

-- 
ask bjoern hansen, http://ask.netcetera.dk/ !try; do();
more than a billion impressions per week, http://valueclick.com




Re: problems with BerkeleyDB and apache

2001-09-17 Thread Ask Bjoern Hansen

On Mon, 17 Sep 2001, Gustav Kristoffer Ek wrote:

 trying to use BerkeleyDB with Apache/1.3.21-dev, but I keep getting
 BerkeleyDB needs compatible versions of libdb  db.h ... you have db.h
 version 3.1.17 and libdb version 2.4.14

try,

  export LD_PRELOAD=/usr/local/lib/libdb3.so

before you start apache.

(substitute with the correct path to the correct libdb3.so).


 - ask

-- 
ask bjoern hansen, http://ask.netcetera.dk/ !try; do();
more than a billion impressions per week, http://valueclick.com




Re: Do virtual hosts need their own servers?

2001-08-25 Thread Ask Bjoern Hansen

On Thu, 16 Aug 2001, Jonathan Edwards wrote:

 Related to this topic, I have a question about multiple
 instances of Apache. We run two mod_perl enabled sites on two
 separate IPs. These sites rely on mod_perl heavily. Each site
 has a unique perl script that handles just about everything.
 Currently, we only have one instance of Apache running, and I've
 noticed that the httpd child processes are quite large (up to
 32megs!). We've upgraded the RAM on our server twice and now
 we're at 512, but it seems to be using all of that without a
 problem. Are these httpd processes so large because they include
 copies of both perl scripts? Would it be more efficient to set
 up two instances of Apache, one for each site/IP, and that way
 each child httpd would only contain one of the two perl scripts?

That might help some, but it all depends[tm].

What you really want is to setup a (reverse) proxy process in front
of the mod_perl process. Try looking through my slides at
http://develooper.com/modperl/


 - ask

-- 
ask bjoern hansen, http://ask.netcetera.dk/ !try; do();
more than a billion impressions per week, http://valueclick.com




Re: Do virtual hosts need their own servers?

2001-08-25 Thread Ask Bjoern Hansen

On Thu, 16 Aug 2001, Dave Baker wrote:

[...]
 p.s. The processes could also be large because of suboptimal
 coding,

Scalability problems are almost never due to bad code and almost
always due to bad design.

 or (if they grow over time) memory leaks

... with possibly that as the exception. :-)


 - ask

-- 
ask bjoern hansen, http://ask.netcetera.dk/ !try; do();
more than a billion impressions per week, http://valueclick.com




Re: mod_perl's ease of installation and the list (was: Re: Problemsinstalling libapreq)

2001-08-16 Thread Ask Bjoern Hansen

On Thu, 16 Aug 2001, Nick Tonkin wrote:

 ( In the absence of any better ideas at this time, I'm gonna nuke
   /usr/local/lib/perl5 completely and see what happens if I start over
   again. )

On FreeBSD, better do a new installation of perl somewhere else
(/home/perl, /usr/local/perl/, ... whatever) and do all the mod_perl
stuff with that (just use /home/perl/bin/perl Makefile.PL and
/home/perl/bin/perl -MCPAN -e shell and so on later).


 - ask

-- 
ask bjoern hansen, http://ask.netcetera.dk/ !try; do();
more than a billion impressions per week, http://valueclick.com




Re: Module to catch (and warn about) Code Red

2001-08-06 Thread Ask Bjoern Hansen

On Sun, 5 Aug 2001, Les Mikesell wrote:

 The descriptions I've seen indicate that it has a flaw in
 the attempt to pick random targets.

That was only the first version of Code Red I, Code Red II
(which is the one that is scanning in your neighborhood (close
netblocks)) doesn't have that flaw.

  http://www.unixwiz.net/techtips/CodeRedII.html
  http://braddock.com/cr2.html


Whatever OS you are running, make sure to install those patches!


 - ask

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




Re: Weird IE cookie behaviour

2001-08-06 Thread Ask Bjoern Hansen

On Mon, 6 Aug 2001, Christopher L. Everett wrote:

 I _must_ get this working with IE.  Does anyone have a
 clue stick for me?

try posting the Set-Cookie: line that you are sending to the
browsers.


 - ask

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




Re: BOF?

2001-07-17 Thread Ask Bjoern Hansen

On Sat, 14 Jul 2001, brian moseley wrote:

  I just noticed that there's no mod_perl BOF listed at
http://conferences.oreillynet.com/cs/os2001/pub/10/bofs.html .
  Is one scheduled?  If not, let's get one together.

 speaking of which. there should be an opening night piss-up,
 eh? somebody that knows the area should propose a place.

Yeah, I thought that was what the thread was about when I saw the
BOF subject.

Sunday evening where?


 - ask

-- 
ask bjoern hansen, http://ask.netcetera.dk/   !try; do();




Re: BOF?

2001-07-17 Thread Ask Bjoern Hansen

On Sun, 15 Jul 2001, Jeffrey W. Baker wrote:

[...]
 I'm sure SD hasn't got anything nearly as classy as the Eagle and Anchor
 or whatever the place in Monterey was.

The sign said Crown  Anchor. :-)

http://photo.tomat.dk/tpc4/dsc_4696.jpg
http://photo.tomat.dk/tpc4/dsc_4696.html

To whoever it was worrying about finding the mod_perl crowd, here's
a picture from last years Sunday,

  http://photo.tomat.dk/tpc4/dsc_4549.html
  (Joshua, Doug, Jeffrey, Randal's friend (Bill?), Randal, Eric,
   and brian moseley)

 Looks like the conference hotel might be quite a ways from
 anything interesting.

If you post your room number as soon as you get it then we'll just
all come over! :-)


 - ask

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






Performance stories

2001-07-12 Thread Ask Bjoern Hansen

Hi,

At TPC5 I'll be doing a talk on Real World Performance Tuning,
http://conferences.oreillynet.com/cs/os2001/view/e_sess/1260

I'll be talking about what things to work on to make your system
scale better by not 10% or 20%, but hundreds of percent. That sort
of thing.

If you have a cool story about how you made your system a fraction
of the memory it used to, or how it could serve thousands of
requests per second instead of hundreds, then please send them to
[EMAIL PROTECTED] :-)


 - ask

-- 
ask bjoern hansen, http://ask.netcetera.dk/   !try; do();




Jobs

2001-07-03 Thread Ask Bjoern Hansen


In case you didn't see it already, then there's a nice pile of
mod_perl related jobs posted at http://jobs.perl.org/

You can get a list of the mod_perl related ones at
http://www.take23.org/jobs/ or (if your browser supports javascript)
at http://perl.apache.org/jobs.html


 - ask

-- 
ask bjoern hansen, http://ask.netcetera.dk/   !try; do();




Re: Connection to MySQL DB fails when mod_perl enabled...

2001-05-22 Thread Ask Bjoern Hansen

On Mon, 21 May 2001, Rodney Broom wrote:

   $dbh = DBI-connect($dsn, dbusrname, dbpassword)
 or die Error: $DBI::errstr;

If you want to die then

 $dbh = DBI-connect($dsn, dbusrname, dbpassword, { RaiseError = 1});

would look neater.

s/Raise/Print/ to just have it spew the error messages to the log
without having to put 'or warn ...' after every other line.


 - ask

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




Re: [OT] Lightweight CGI.pm - Why?

2001-05-20 Thread Ask Bjoern Hansen

On Sun, 20 May 2001, Stas Bekman wrote:

[...]
 it's also about smart construction of HTML code using map() and similar
 constructs:
 
[...]

   print table(-align = 'center',
   tr( map { td($_),td($rows{$_} } keys %rows )
  );
 now try to write the same code using HERE construct... you get the idea...

eh, not really.

Without testing or really knowing what the CGI.pm functions does I
would think that it's approximately the same as:

print table,map({trtd.$_./tdtd.$rows{$_}/td/tr\n } keys 
%rows),/table;

Mixing HTML and code is ugly no matter how you do it.


For automatic formhandling I've very good experiences with
HTML::Embperl. It's magic is truly a blessing when you can use it.


 - ask

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




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

2001-04-17 Thread Ask Bjoern Hansen

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.


 - ask

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




Re: Sendmail or not?

2001-04-08 Thread Ask Bjoern Hansen

On Sun, 8 Apr 2001, Tom Mornini wrote:

I don't understand why anyone would do anything else than just
forking to qmail-inject.

At least on Linux and FreeBSD that goes reasonably fast (you're not
sending hundreds and hundreds of mails per minute, are you?), is
really simple and the mail will be delivered faster than your mail
program can login to the mail server.

And it supports VERP so you easily can do something about all those
bounces.

Try it. Try it.


 - ask

-- 
ask bjoern hansen, http://ask.netcetera.dk/   !try; do();




Re: [PATCH] X-Forwarded-For (fwd)

2001-03-27 Thread Ask Bjoern Hansen


Some day we'll have the X-Forwarded-For and friends in the default
mod_proxy module. :-)


 - ask

-- 
ask bjoern hansen, http://ask.netcetera.dk/   !try; do();


-- Forwarded message --
Date: Tue, 27 Mar 2001 12:47:12 +0200
From: Graham Leggett [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: [PATCH] X-Forwarded-For

Ask Bjoern Hansen wrote:

 As an option it would be useful to be able to forward the
 Host: header too.
 
 Lots of people find this amusingly simple module useful for that
 http://develooper.com/code/mpaf/mod_proxy_add_forward.c

I put in X-Forwarded-For and x-Forwarded-Host into mod_proxy with the
last patch. I changed X-Host to X-Forwarded-Host so that if in the
future these two become parts of HTTP and drop the X- there is not clash
with the Host header.

I also included the X-Forwarded-Server header (for X-Server-Host) - but
this functionality is duplicated by the HTTP/1.1 Via header, so I am in
two minds as to whether this should be included.

Regards,
Graham
-- 
-
[EMAIL PROTECTED]"There's a moon
over Bourbon Street
tonight..."





RE: [OT] unsubscribing was Re: Varaible scope memory under mod_perl

2001-03-20 Thread Ask Bjoern Hansen

On Wed, 14 Mar 2001, Steven Zhu wrote:

[...]
 another user (having different user email account). Now I got those emails
 from the alias of my original account. If I just send mail to
 [EMAIL PROTECTED], I believe that it does not help because [...]

well, you could at least have tried. 

then the friendly mailinglist manager would have replied back within
seconds with this message:

"To see what address you used to subscribe, look at the messages you
are receiving from the mailing list. Each message has your address
hidden inside its return path; for example, [EMAIL PROTECTED] receives
messages with return path: modperl-return-number[EMAIL PROTECTED]"

and just to make it really easy the message would also have included
specific, easy to follow instructions on how to unsubscribe an
alternate address.

Cool, huh?


 - ask (the slightly sarcastic assistant to the friendly mailinglist
manager).

-- 
ask bjoern hansen, http://ask.netcetera.dk/   !try; do();




Re: [OT] ApacheCon BOF

2001-03-20 Thread Ask Bjoern Hansen

On 19 Mar 2001, Randal L. Schwartz wrote:

  "mod_perl: 20 billion hits served"
  And turn the "m" into a stylized arch. :)
 
 Nick er, maybe 20 trillion ... ? seeing as how ValueClick alone has done a bit
 Nick over 42 billion since 6/98 ... :)
 
 yeah, I was hoping valueclick would jump out and give me a better number.

actually, then it should probably be more like 55 billion[1]. And in
the busy hours. we add more 3000 to that. Per second. :)


 - ask

[1] Nick only included numbers from one of the ValueClick divisions
running the system with mod_perl. :-)

-- 
ask bjoern hansen, http://ask.netcetera.dk/   !try; do();




Re: 1 Billion Bug 1BB - [OT] UNIX timestamp hits 1,000,000,000thisyear!

2001-03-20 Thread Ask Bjoern Hansen

On Fri, 9 Mar 2001, Gerd Kortemeyer wrote:

[bugs and design fu^H^Hchoices waiting to happen]

 I will open my consulting business on Mon, Jan 18th, 2038.

funny, I thought we all worked so hard to have a chance of retiring
before that.


 - ask

-- 
ask bjoern hansen, http://ask.netcetera.dk/   !try; do();




Re: List your software with new feature-based search engine

2001-03-15 Thread Ask Bjoern Hansen

On Fri, 16 Mar 2001, Stas Bekman wrote:

  [1] I do the same thing for the lists at perl.org and for whatever
  reason the modperl lists gets about the same amount or more spam
  than the perl.org lists combined.
 
 I suppose that's because of the multiply mirrors of the perl.apache.org,
 which includes the mod_perl list address twice (at index.html and
 guide/help.html). I don't think this is a situation with perl.org lists.
 
 Do you want me to make it harder for crawlers to grab the address? like
 should I change it to modperl at perl.apache.org?

s/perl\.// if so.

I usually just provide the subscribe address,
[EMAIL PROTECTED]


 - ask

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




  1   2   3   >