Re: Need help installing on Win32...

2001-05-02 Thread Carey Burgess



Hey,

Yeah... It's ActivePerl build 623.

What's a vanilla script? I know I can run scripts just fine with this same 
Perl when I comment out the mod_perl lines I have below.

Well, again, thanks for your help! If this is getting (or gets) too annoying 
for you, just direct me to the appropriate portion of some generic guide and 
I'll sort this out myself.


Thanks!


Carey





Original Message Follows
From: Randy Kobes [EMAIL PROTECTED]
To: Carey Burgess [EMAIL PROTECTED]
CC: [EMAIL PROTECTED]
Subject: Re: Need help installing on Win32...
Date: Tue, 1 May 2001 22:23:18 -0500 (CDT)


On Tue, 1 May 2001, Carey Burgess wrote:

 
  Now, how do I get it to work right? I added to httpd.conf like so:
  
  LoadModule perl_module modules/mod_perl.so
  #
  # (Other stuff here...)
  #
  Files ~ \.(pl|cgi)$
  SetHandler  perl-script
  PerlHandler Apache::Registry
  Options +ExecCGI
  /Files
  #
  # (Other stuff here...)
  #
  Alias /cgi-bin/ D:/serv/cgi-bin/
  Location /cgi-bin
  SetHandler  perl-script
  PerlHandler Apache::Registry
  Options +ExecCGI
  /Location
  ---
  So, I know the handler is now the perl module.
 
  But, I run into a problem at this point... Every time I run a script at 
all,
  I get one of those 'illegal error' windows for Apache and it shuts down 
the
  server alltogether. When reading the 'Details' portion of the error 
window,
  it says APACHE caused an invalid page fault in module MOD_PERL.SO at
  015f:100097bc.
 

This type of error could result from trying to load a
library with some version or compilation incompatibility.
Is the perl binary in your PATH that of ActivePerl 6xx?
With this same perl, can you run vanilla cgi scripts OK?

best regards,
randy kobes



_
Get your FREE download of MSN Explorer at http://explorer.msn.com




RE: Exception modules

2001-05-02 Thread Henrik Tougaard



 From: Paul Lindner, on Tuesday, May 01, 2001 3:04 AM:
 
 On a related note, does anyone anywhere still use
 Experimental::Exception?
 
The COPE CORBA module uses Experimental::Exception for it's exception
handling. There is an effort underway to change to Error.pm (or something
else a bit more standardized) but I don't know how far that is.

Henrik Tougaard, FOA, Denmark.



Syntax errors across multiple virtual hosts with separate codebase

2001-05-02 Thread Tommy Davis

We use a server-setup with a mod_perl enabled backend server. The server 
only runs mod_perl and mySQL for about 5 virtual hosts.

Our problem is that a syntax-error in a program used on only one virutal 
host, causes an internal server error across all virtual hosts.
I suspect it's not possible to avoid this, but I would like to be sure. 
Can anyone confirm this?

Another problem is that the solutions uses diffferent databases. That 
means we end up with 5 ttimes as many open db handles as we have 
mod_perl processes.
We have worked around this by merging all databases into a single one, 
prefixing the table_names with the former db-names and using a simple 
abstraction layer to access the database.

I would be very interested to hear how others have solved this problem ( 
without buying more servers ;-).

-- 
Med venlig hilsen

-Toem






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.




dev,ino namespace [was: Re: Apache::Registry - a thought]

2001-05-02 Thread Ime Smits

| It occurs to me that there would be no overhead to speak of in using a
| sequence number, given that Apache::Registry already maintains a hash for
| its generated package names for mtime checks. Something like:

Why not use (stat($script))[0,1] device and inode numbers of the script
being compiled? It has the advantage of code-sharing symlinked scripts - but
probably can only be used on Unix like flavours.

I got tremendous improvements in my situation where I have quite some
domains basically running the same huge stuff with some minor layout
adjustments based on HTTP Host header.

As I use Apache::ASP a lot, I have some (fairly trivial) patches submitted
for this feature to Joshua, who will probably include them in the next
release. I think it would be nice for Apache::Registry to have this feature
as well.

Anyone interested in the Apache::ASP patches, just drop me line.

Ime




Re: glimmer of hope -- cookies: www.host.tld vs host.tld

2001-05-02 Thread darren chamberlain

will trillich ([EMAIL PROTECTED]) said something to this effect on 05/02/2001:
 Cookies are restricted to certain domains, for security reasons.
 (Why have a microsoft.com cookie sent to debian.org, right?)
 So all cookies need
 
   domain=box.subnet.intralan.organization.tld

*snip*

A similar thread happened a while ago (see, e.g.,
[EMAIL PROTECTED]">http://forum.swarthmore.edu/epigone/modperl/blixnortix/[EMAIL PROTECTED]);
Rusty Foster (of kuro5hin.org fame) explained his solution pretty well
here:
[EMAIL PROTECTED]">http://forum.swarthmore.edu/epigone/modperl/blixnortix/[EMAIL PROTECTED]

(darren)

-- 
How is it possible to find meaning in a finite world, given my waist
and shirt size?
-- Woody Allen



Re: Syntax errors across multiple virtual hosts with separate codebase

2001-05-02 Thread G.W. Haywood

Hi there,

On Wed, 2 May 2001, Tommy Davis wrote:

 We use a server-setup with a mod_perl enabled backend server. The server 
 only runs mod_perl and mySQL for about 5 virtual hosts.
 
 Our problem is that a syntax-error in a program used on only one virutal 
 host, causes an internal server error across all virtual hosts.
 I suspect it's not possible to avoid this, but I would like to be sure. 
 Can anyone confirm this?

Nope.  I suspect your code isn't as separate as you think it is.

73,
Ged.





Re: Syntax errors across multiple virtual hosts with separate codebase

2001-05-02 Thread Chris Winters

* Tommy Davis ([EMAIL PROTECTED]) [010502 04:11]:
 We use a server-setup with a mod_perl enabled backend server. The server 
 only runs mod_perl and mySQL for about 5 virtual hosts.

 ...

 Another problem is that the solutions uses diffferent databases. That 
 means we end up with 5 ttimes as many open db handles as we have 
 mod_perl processes.
 We have worked around this by merging all databases into a single one, 
 prefixing the table_names with the former db-names and using a simple 
 abstraction layer to access the database.

I'm not sure how you create your database handles (in a central
location then passed around, or in each handler as you need it), but
in MySQL (as with other databases) you can execute a 'use dbname' to
start using a different database.

So your definition can be the same for all virtual hosts but you can
define a variable via PerlSetVar or in a configuration file that has
the database name. When you ask for a database handle you can then
create it using a common database name (e.g, 'mysql') and then
execute the 'use dbname' statement:

package MyServer::DB;

use strict;
use DBI;

my $DB_USER = '';
my $DB_PASS = '';

sub connect {
my ( $class, $dbname ) = @_;
my $dbh = DBI-connect( 'DBI:mysql:mysql', $DB_USER, $DB_PASS,
{ RaiseError = 1 } )
   || die $DBI::errstr\n;
$dbh-do( use $dbname ) if ( $dbname );
return $dbh;
}

We do something like this in OpenInteract and, for MySQL at least, it
works fine.

Chris

-- 
Chris Winters ([EMAIL PROTECTED])
Building enterprise-capable snack solutions since 1988.



Re: Syntax errors across multiple virtual hosts with separate codebase

2001-05-02 Thread darren chamberlain

Chris Winters ([EMAIL PROTECTED]) said something to this effect on 05/02/2001:
 package MyServer::DB;
 
 use strict;
 use DBI;
 
 my $DB_USER = '';
 my $DB_PASS = '';
 
 sub connect {
 my ( $class, $dbname ) = @_;
 my $dbh = DBI-connect( 'DBI:mysql:mysql', $DB_USER, $DB_PASS,
 { RaiseError = 1 } )
|| die $DBI::errstr\n;
 $dbh-do( use $dbname ) if ( $dbname );
 return $dbh;
 }

I wrote something like this once:

###
package MyDB;
use DBI;
use base 'DBI::db';

{
my $dsn;
sub import {
my $class = shift;
while (@_) {
my ($n, $v) = splice @_, 0, 2;
$dsn-{$n} = $v;
}
}

sub new {
my $class = shift;
my $dbh = DBI-connect(
sprintf('dbi:mysql:%s:%s', @{$dsn}{'database','hostname'}),
$dsn-{'username'}, $dsn-{'password'},
{ RaiseError = 1 });
bless $dbh, $class;
}
}

sub DESTROY { shift-disconnect }

1;
###

(With a little sanity checking inside import to make sure all
the required entries at least have reasonable defaults).

Which gets used like so:

#!/usr/bin/perl
use MyDB username = 'foo', password = 'bar';
my $db = MyDB-new;

It makes all the database stuff a little cleaner, and a little
better encapsulated.

(darren)

-- 
Pessimests are right more often, but optimists are happy more often.



Re: modify Server header via a handler

2001-05-02 Thread Alistair Mills

On Tue, 1 May 2001, will trillich wrote:

 On Tue, May 01, 2001 at 12:10:34PM -0700, Randal L. Schwartz wrote:
   newsreader == newsreader  [EMAIL PROTECTED] writes:
  
  newsreader randal s. posted a way to do that
  newsreader sometime back.  search for it in
  newsreader the archive.  his stonehenge
  newsreader website apparently uses the same trick.
  
  If he's already doing it in the fixup phase, that's where I'm doing it
  too, so that's probably not going to work.
 
 is it actually possible via perl?
 
 according to doug at
   http://www.geocrawler.com/archives/3/182/1997/6/0/1014229/
 we shouldn't get our hopes up.
 

I struggled to find a way of sending out a custom server response using
Perl.

Instead I want into into the Apache source to get it to print out a
non-stanard server Apache response - I'm sure there might be an easier
way though?

--
[EMAIL PROTECTED]
http://www.kplworks.com/

 -- 
 [EMAIL PROTECTED]
 http://sourceforge.net/projects/newbiedoc -- we need your brain!
 http://www.dontUthink.com/ -- your brain needs us!
 






Re: modify Server header via a handler

2001-05-02 Thread Mark Maunder

You can get the server string in the header down to a minimum (Just 'Apache')
by putting
ServerTokens ProductOnly
on your httpd.conf. (Only supported after 1.3.12)
You can then use ap_add_version_component (C API) to add stuff after that.

IMHO you should at least mention  'Apache' and 'mod_perl' in the header so we
look good on netcraft. Or if you must, you can change the whole thing in the
src, I think it's src/include/httpd.h

~mark.

Alistair Mills wrote:

 On Tue, 1 May 2001, will trillich wrote:
 
  On Tue, May 01, 2001 at 12:10:34PM -0700, Randal L. Schwartz wrote:
newsreader == newsreader  [EMAIL PROTECTED] writes:
  
   newsreader randal s. posted a way to do that
   newsreader sometime back.  search for it in
   newsreader the archive.  his stonehenge
   newsreader website apparently uses the same trick.
  
   If he's already doing it in the fixup phase, that's where I'm doing it
   too, so that's probably not going to work.
 
  is it actually possible via perl?
 
  according to doug at
http://www.geocrawler.com/archives/3/182/1997/6/0/1014229/
  we shouldn't get our hopes up.
 

 I struggled to find a way of sending out a custom server response using
 Perl.

 Instead I want into into the Apache source to get it to print out a
 non-stanard server Apache response - I'm sure there might be an easier
 way though?

 --
 [EMAIL PROTECTED]
 http://www.kplworks.com/

  --
  [EMAIL PROTECTED]
  http://sourceforge.net/projects/newbiedoc -- we need your brain!
  http://www.dontUthink.com/ -- your brain needs us!
 

--
Mark Maunder
[EMAIL PROTECTED]
http://swiftcamel.com/

 Try not.
 Do.
 Or do not.
 There is no try.
 ~yoda





Re: modify Server header via a handler

2001-05-02 Thread Matt Sergeant

On Wed, 2 May 2001, Mark Maunder wrote:

 You can get the server string in the header down to a minimum (Just 'Apache')
 by putting
 ServerTokens ProductOnly
 on your httpd.conf. (Only supported after 1.3.12)
 You can then use ap_add_version_component (C API) to add stuff after that.

Right, but the problem is you can't do this after module initialization
(which is where mod_perl adds it's bits), but the PerlModule's are loaded
after that time, so you can't do it from Perl, at least not without a
major re-design of the mod_perl internals. You can't even do it from XS
loaded from Perl, because of that reason.

-- 
Matt/

/||** Founder and CTO  **  **   http://axkit.com/ **
   //||**  AxKit.com Ltd   **  ** XML Application Serving **
  // ||** http://axkit.org **  ** XSLT, XPathScript, XSP  **
 // \\| // ** mod_perl news and resources: http://take23.org  **
 \\//
 //\\
//  \\




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

2001-05-02 Thread Randy Kobes

On Wed, 2 May 2001, Simon Duduica wrote:

 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.

You can just delete the line indicating this path in mod_perl.dsp,
or remove it from within Visual Studio - it was there
to indicate that ApacheCore.lib must be added, which you've done.

best regards,
randy kobes




Re: modify Server header via a handler

2001-05-02 Thread Richard Chen

On Wed, May 02, 2001 at 03:22:51PM +0100, Matt Sergeant wrote:
 On Wed, 2 May 2001, Mark Maunder wrote:
 
  You can get the server string in the header down to a minimum (Just 'Apache')
  by putting
  ServerTokens ProductOnly
  on your httpd.conf. (Only supported after 1.3.12)
  You can then use ap_add_version_component (C API) to add stuff after that.
 
 Right, but the problem is you can't do this after module initialization
 (which is where mod_perl adds it's bits), but the PerlModule's are loaded
 after that time, so you can't do it from Perl, at least not without a
 major re-design of the mod_perl internals. You can't even do it from XS
 loaded from Perl, because of that reason.
 

That is right, modperl cannot do this. I guess we have
to live with certain limitations of modperl. However, I just
found out that it is trivial to change this Server header to
whatever you want by changing just a single line in the apache
source file http_main.c:

API_EXPORT(const char *) ap_get_server_version(void)
{
return (server_version ? server_version : SERVER_BASEVERSION);
}

Just replace the return statement above with

return My Customized Web Server;

and rebuild your new httpd. I have even tried this on the
old stronghold server running apache 1.3.6 and it worked.
Since the apache source is always available, this customization
is not a big deal.

The reason I wanted to do this was not to let people find out
(not easily that is) what we are running so that they cannot 
exploit known security holes of the past version.

Richard Chen



middle tier like j2ee only in mod_perl, possible?

2001-05-02 Thread Matthew Kennedy

I've been experimenting with what's possible in terms of having mod_perl
interface with a system of business logic rather than a relational
database. ie. I am try to find the find the mod_perl equivalent of
Java's EJB tier in the following:

(web brower + servlets) --- (ejb) --- (relational dbms)

I've searched CPAN. Here are some better candidates:
RPC::PlClient/PlServer/Simple, XMLRPC/SOAP, CORBA::ORBit/Mico. The most
promising route seems to be a CORBA interface since such objects could
be easily used by other systems.

The feeling I'm left with is that although these could be used to
implement a middle tier, it ain't exactly the playground filled with
toys that J2EE has become. So I'm interested... Has anyone had success
with implementing a middle tier for mod_perl? What with? And how
successful was it?

Matthew




Re: modify Server header via a handler

2001-05-02 Thread Alistair Mills

On Wed, 2 May 2001, Richard Chen wrote:

 On Wed, May 02, 2001 at 03:22:51PM +0100, Matt Sergeant wrote:
  On Wed, 2 May 2001, Mark Maunder wrote:
  
   You can get the server string in the header down to a minimum (Just 'Apache')
   by putting
   ServerTokens ProductOnly
   on your httpd.conf. (Only supported after 1.3.12)
   You can then use ap_add_version_component (C API) to add stuff after that.
  
  Right, but the problem is you can't do this after module initialization
  (which is where mod_perl adds it's bits), but the PerlModule's are loaded
  after that time, so you can't do it from Perl, at least not without a
  major re-design of the mod_perl internals. You can't even do it from XS
  loaded from Perl, because of that reason.
  
 
 That is right, modperl cannot do this. I guess we have
 to live with certain limitations of modperl. However, I just
 found out that it is trivial to change this Server header to
 whatever you want by changing just a single line in the apache
 source file http_main.c:
 
 API_EXPORT(const char *) ap_get_server_version(void)
 {
 return (server_version ? server_version : SERVER_BASEVERSION);
 }
 
 Just replace the return statement above with
 
 return My Customized Web Server;

I found the following to work better, I tried the same fix as above and it 
caused a few problems with 1.3.17:

API_EXPORT(const char *) ap_get_server_version(void)
{
strcpy(server_version, My Mod_perl Server);
return (server_version ? server_version : SERVER_BASEVERSION);
}

--
[EMAIL PROTECTED]
http://www.kplworks.com/

 
 and rebuild your new httpd. I have even tried this on the
 old stronghold server running apache 1.3.6 and it worked.
 Since the apache source is always available, this customization
 is not a big deal.
 
 The reason I wanted to do this was not to let people find out
 (not easily that is) what we are running so that they cannot 
 exploit known security holes of the past version.
 
 Richard Chen
 




Re: Syntax errors across multiple virtual hosts with separate codebase

2001-05-02 Thread Tommy Davis
G.W. Haywood wrote:
[EMAIL PROTECTED]">
  We use a server-setup with a mod_perl enabled backend server. The server only runs mod_perl and mySQL for about 5 virtual hosts.Our problem is that a syntax-error in a program used on only one virutal host, causes an "internal server error" across all virtual hosts.I suspect it's not possible to avoid this, but I would like to be sure. Can anyone confirm this?
Nope.  I suspect your code isn't as separate as you think it is.

I'm quite sure the they are separate, but I'll try some simple test-scenarios tonight to double-check.
-- 
Med venlig hilsen

-Toem

Tommy Davis,  Technical Director
Adapt A/S,  Havnegade 41, 2. sal,  1058 Kbenhavn K
Tel +45 3341 1050,  Fax +45 3341 1069,  http://www.adapt.dk/



Re: modify Server header via a handler

2001-05-02 Thread Matt Sergeant

On Wed, 2 May 2001, Richard Chen wrote:

 On Wed, May 02, 2001 at 03:22:51PM +0100, Matt Sergeant wrote:
  On Wed, 2 May 2001, Mark Maunder wrote:
 
   You can get the server string in the header down to a minimum (Just 'Apache')
   by putting
   ServerTokens ProductOnly
   on your httpd.conf. (Only supported after 1.3.12)
   You can then use ap_add_version_component (C API) to add stuff after that.
 
  Right, but the problem is you can't do this after module initialization
  (which is where mod_perl adds it's bits), but the PerlModule's are loaded
  after that time, so you can't do it from Perl, at least not without a
  major re-design of the mod_perl internals. You can't even do it from XS
  loaded from Perl, because of that reason.
 

 That is right, modperl cannot do this. I guess we have
 to live with certain limitations of modperl.

Actually I lied! It is possible, though only from XS. I just added a
module_init section to AxKit's config directives, and now I get:

# HEAD http://axkit.org/ | grep Server
Server: Apache/1.3.17 (Unix) AxKit (1.3_96) mod_perl/1.25

Neato!

-- 
Matt/

/||** Founder and CTO  **  **   http://axkit.com/ **
   //||**  AxKit.com Ltd   **  ** XML Application Serving **
  // ||** http://axkit.org **  ** XSLT, XPathScript, XSP  **
 // \\| // ** mod_perl news and resources: http://take23.org  **
 \\//
 //\\
//  \\




XML::Parser Expat cause segfaults

2001-05-02 Thread Oskari 'Okko' Ojala


Got a problem: About 250 of 1000 requests cause a segfault (11) when using
XML::Parser::parse() under mod_perl. In FAQs it is stated that this is
because of the bundled Expat in Apache.

I've tried disabling Apache's Expat with --disable-rule=EXPAT, but it
doesn't help.

Have you found any workarounds or patches, or is the reason to my
segfaults somewhere else?

Platform:

Red Hat 7.0
Apache 1.3.19
mod_perl 1.25
perl 5.6.0
expat 1.95.1
HTML::Mason 1.02
XML::Parser 2.30


I compiled mod_perl with

perl Makefile.PL APACHE_SRC=../apache_1.3.19/src DO_HTTPD=1 USE_APACI=1
PREP_HTTPD=1 EVERYTHING=1

and Apache with

./configure --disable-rule=EXPAT
--activate-module=src/modules/perl/libperl.a --enable-module=so
--enable-module=unique_id --enable-module=rewrite --enable-module=info
--enable-module=usertrack --enable-module=expires
--prefix=/usr/local/apache


All tips appreciated!

Oskari Ojala
Frantic Media




Re: Syntax errors across multiple virtual hosts with separate codebase

2001-05-02 Thread Tommy Davis
Chris Winters wrote:
[EMAIL PROTECTED]">* Tommy Davis ([EMAIL PROTECTED]) [010502 04:11]:
  We use a server-setup with a mod_perl enabled backend server. The server only runs mod_perl and mySQL for about 5 virtual hostsAnother problem is that the solutions uses diffferent databases. That means we end up with 5 ttimes as many open db handles as we have mod_perl processes.We have worked around this by merging all databases into a single one, prefixing the table_names with the former db-names and using a simple abstraction layer to access the database.
I'm not sure how you create your database handles (in a centrallocation then passed around, or in each handler as you need it), butin MySQL (as with other databases) you can execute a 'use dbname' tostart using a different database.So your definition can be the same for all virtual hosts but you candefine a variable via PerlSetVar or in a configuration file that hasthe database name. When you ask for a database handle you can thencreate it using a common database name (e.g, 'mysql') and thenexecute the 'use dbname' statement:

Thanks a bunch - I never thought about using "use dbname" in a mod_perl/DBI context. It's obvious when you know it ;-).

-- Med venlig hilsen-ToemTommy Davis,  Technical DirectorAdapt A/S,  Havnegade 41, 2. sal,  1058 Kbenhavn KTel +45 3341 1050,  Fax +45 3341 1069,  http://www.adapt.dk/



Re: XML::Parser Expat cause segfaults

2001-05-02 Thread Matt Sergeant

On Wed, 2 May 2001, Oskari 'Okko' Ojala wrote:

 I compiled mod_perl with

 perl Makefile.PL APACHE_SRC=../apache_1.3.19/src DO_HTTPD=1 USE_APACI=1
 PREP_HTTPD=1 EVERYTHING=1

Try changing PREP_HTTPD=1 to APACHE_PREFIX=/usr/local/apache, and add
APACI_ARGS='...' where ... are your --enable-module bits. Then mod_perl
will compile and install Apache for you. That's the way I've found works
best.

-- 
Matt/

/||** Founder and CTO  **  **   http://axkit.com/ **
   //||**  AxKit.com Ltd   **  ** XML Application Serving **
  // ||** http://axkit.org **  ** XSLT, XPathScript, XSP  **
 // \\| // ** mod_perl news and resources: http://take23.org  **
 \\//
 //\\
//  \\




Re: XML::Parser Expat cause segfaults

2001-05-02 Thread Oskari 'Okko' Ojala

On Wed, 2 May 2001, Matt Sergeant wrote:

 Try changing PREP_HTTPD=1 to APACHE_PREFIX=/usr/local/apache, and add
 APACI_ARGS='...' where ... are your --enable-module bits.

Tried that too, but it doesn't seem to help. Still segfaults. :(




OT: Re: glimmer of hope -- cookies: www.host.tld vs host.tld

2001-05-02 Thread ___cliff rayman___

u can also use the rewrite engine - for our domain genwax.com:
RewriteCond %{HTTP_HOST}^genwax\.com$ [NC]
RewriteRule ^(.+)   http://www.genwax.com$1 [R,L]

notice that it also makes sure to convert any case such as:
GeNwAx.com to www.genwax.com

--
___cliff [EMAIL PROTECTED]http://www.genwax.com/

darren chamberlain wrote:

 will trillich ([EMAIL PROTECTED]) said something to this effect on 05/02/2001:
  Cookies are restricted to certain domains, for security reasons.
  (Why have a microsoft.com cookie sent to debian.org, right?)
  So all cookies need
 
domain=box.subnet.intralan.organization.tld

 *snip*

 A similar thread happened a while ago (see, e.g.,
 
[EMAIL PROTECTED]">http://forum.swarthmore.edu/epigone/modperl/blixnortix/[EMAIL PROTECTED]);
 Rusty Foster (of kuro5hin.org fame) explained his solution pretty well
 here:
 [EMAIL PROTECTED]">http://forum.swarthmore.edu/epigone/modperl/blixnortix/[EMAIL PROTECTED]

 (darren)







Re: glimmer of hope -- cookies: www.host.tld vs host.tld

2001-05-02 Thread will trillich

On Wed, May 02, 2001 at 07:28:05AM -0400, darren chamberlain wrote:
 will trillich ([EMAIL PROTECTED]) said something to this effect on 05/02/2001:
  Cookies are restricted to certain domains, for security reasons.
  (Why have a microsoft.com cookie sent to debian.org, right?)
  So all cookies need
  
  domain=box.subnet.intralan.organization.tld
 
 *snip*
 
 A similar thread happened a while ago (see, e.g.,
 
[EMAIL PROTECTED]">http://forum.swarthmore.edu/epigone/modperl/blixnortix/[EMAIL PROTECTED]);
 Rusty Foster (of kuro5hin.org fame) explained his solution pretty well
 here:
 [EMAIL PROTECTED]">http://forum.swarthmore.edu/epigone/modperl/blixnortix/[EMAIL PROTECTED]

here's the solution rusty posted:

NameVirtualHost 216.181.35.174  # IP of www.kuro5hin.org

# Redirect all hostless requests to www VHost
VirtualHost 216.181.35.174
ServerName kuro5hin.org
Redirect permanent / http://www.kuro5hin.org/
/VirtualHost

# Proper URI for www.kuro5hin.org
VirtualHost 216.181.35.174
  ServerName www.kuro5hin.org
  ...etc...
/VirtualHost

how is that different from 

UseCanonicalName on

-- 
don't visit this page. it's bad for you. take my expert word for it.
http://www.salon.com/people/col/pagl/2001/03/21/spring/index1.html

[EMAIL PROTECTED]
http://sourceforge.net/projects/newbiedoc -- we need your brain!
http://www.dontUthink.com/ -- your brain needs us!



[JOB SEEKER] mod_perl expert for hire

2001-05-02 Thread Matt Sergeant

I feel bad that, with the dot-bomb, all we see now are job seekers, not
job adverts, but here I am, in need of some work to keep food on my table.

My skills are fairly well known here. I'm an expert in XML and mod_perl. I
built the take23.org mod_perl news and resources site. And I'm the
developer of AxKit.

I'd be especially interested in AxKit and/or XML work, but I'm interested
in all comers. My full CV is available on the AxKit.org site under
examples, for those who don't know my work.

I'm mainly looking for contract work, 3 or 6 months preferably, but I'd be
willing to look at something permanent if it was a really good company.

Oh, and I'm based in Scotland, but have a leased line and permanent IP at
home.

-- 
Matt/

/||** Founder and CTO  **  **   http://axkit.com/ **
   //||**  AxKit.com Ltd   **  ** XML Application Serving **
  // ||** http://axkit.org **  ** XSLT, XPathScript, XSP  **
 // \\| // ** mod_perl news and resources: http://take23.org  **
 \\//
 //\\
//  \\





RE: glimmer of hope -- cookies: www.host.tld vs host.tld

2001-05-02 Thread Rob Bloodgood

 Or at the very least, two segments thereof:

   domain=.org.tld

 Which would be sent to any of these hosts:

   www.org.tld
   some.obscure.server.org.tld
   even.here.org.tld

 BUT NOT TO

   ord.tlg

 Thank you very four-borking-days-lost-forever much.

 So, patient gurus laughing-up-your-sleeves, who've known this
 from the beginning and have only been waiting for grashopper to
 come to the epiphany on his own, would you mind sharing with us
 lesser folk... HOW to have cookies work for bare-domain hosts
 such as

   this.org
   something.net
   my.tld

 to operate as aliases for more specific-style sites such as

   www.this.org
   www.something.net
   a.very.deep.and.remote.server.my.tld

you have it right at the top.
assuming you are operating in org.tld, so www.org.tld and modperl.org.tld
are valid boxes, then you send the domain string as .$domain.  This one
cost me about a week, so don't feel too bad!

Until now, you've been dealing with not even seeing the cookie header (in
the raw req).  Once the raw req has the right info, (e.g. the Set-Cookie:
header), then it comes down to verifying the info IN the headers. sigh

DON'T EXPECT TO SET A COOKIE FOR MULTIPLE DOMAINS.  If you set a cookie for
.this.org, it's not a part of the technology to allow the same cookie to
work w/ .something.net as well.  ALTHO: There's nothing stopping you from
setting cookies from perl.this.org for the .something.org domain if you
expect to go back and forth.

HTH, and good luck!

L8r,
Rob

#!/usr/bin/perl -w
use Disclaimer qw/:standard/;





ProxyPass based on file ext, not by path

2001-05-02 Thread Surat Singh Bhati

I want to use the mod_perl apache as backend to my 
public non mod_perl Apache server as Stats says,
we can use the ProxyPass/ProxyPassReverse directives 
as below:

ProxyPass/modperl/ http://localhost:81/modperl/
ProxyPassReverse /modperl/ http://localhost:81/modperl/
 
But in my case all the mod_perl scripts are not in a 
particular directly , mod_perl scrips may be located 
anywhere below doc root with a particular extension.

I need somthing like:

ProxyPass*.mcgi http://localhost:81/*.mcgi
ProxyPassReverse *.mcgi http://localhost:81/*.mcgi

Here I want to say that a request like
http://www.server.com/anypath/amy-sub-path/filename.mcgi 
should be serverd through the 
http://localhost:81/anypath/amy-sub-path/filename.mcgi 
using the proxy module.

Is any trick to do it? 
Using any combination of mod_rewrite and proxyPass?

Regards,

-Surat singh Bhati











files having same ext, different handler based on partial name

2001-05-02 Thread Surat Singh Bhati

I want to configure mod_perl in such a way 

a. files like *.cgi (but not *mod.cgi)  should be run using the PerlRun, 
and 
b. files like *mod.cgi should run using the Apache Registry.

The settings:

FilesMatch *\.cgi$
SetHandler perl-script
PerlHandler Apache::PerlRun 
PerlSendHeader On
Options +ExecCGI
/FilesMatch

FilesMatch *mod\.cgi$
SetHandler perl-script
PerlHandler Apache::Registry
PerlSendHeader On
Options +ExecCGI
/FilesMatch

But the first FilesMatch *\.cgi$ is true for both (*.cgi and *mod.cgi), 
How apache will treat it? 

Any trick to find out that a given CGI is working under Apache::PerlRun  
or Apache::Registry. The $ENV{MOD_PERL} says that script is working under
mod_perl, but it does not says it is working under Perlrun or Registry.

TIA,

-Surat Singh Bhati








 





Re: glimmer of hope -- cookies: www.host.tld vs host.tld

2001-05-02 Thread ___cliff rayman___

Rob Bloodgood wrote:

  Or at the very least, two segments thereof:
 
domain=.org.tld
 
 --- lots of snippage ---
 you have it right at the top.
 assuming you are operating in org.tld, so www.org.tld and modperl.org.tld
 are valid boxes, then you send the domain string as .$domain.  This one
 cost me about a week, so don't feel too bad!


if someone enters our site with domain.tld (no hostname), everything works
fine as long as they keep using relative links.  as soon as they select or get
redirected to an absolute link (usually when changing schemes http = https),
then the domain of the cookie fails, and the cookie data is lost (as far as the
browser is concerned).  this problem is avoidable if u insure that a proper
hostname is used along with a domain.tld.  i do this with mod_rewrite. there
are probably many ways to do it, but the effect is the same, insure that the
cookie domain matches through the user's entire session.  someone suggested
using the apache directive canonical hostname.  my canonical hostname does not
always match the host and domain.tld of my server.  if it does, then this directive
will probably eliminate the no hostname cookie domain matching problem (a technical
term ;-) ).

--
___cliff [EMAIL PROTECTED]http://www.genwax.com/





Re: Syntax errors across multiple virtual hosts with separate codebase

2001-05-02 Thread Pete Jordan

Chris Winters [EMAIL PROTECTED] wrote:

 I'm not sure how you create your database handles (in a central
 location then passed around, or in each handler as you need it), but
 in MySQL (as with other databases) you can execute a 'use dbname' to
 start using a different database.

FWIW, MySQL is quite happy performing queries on foreign databases through 
DBI; I've needed to do this to perform queries that span tables on 
multiple databases. Not sure of the performance overhead, but if you fully 
qualify your fields (as in db.table.field) it shouldn't matter what 
database your handle is actually opened on.

Pete



Re: files having same ext, different handler based on partial name

2001-05-02 Thread Pete Jordan

Surat Singh Bhati [EMAIL PROTECTED] wrote:

 Any trick to find out that a given CGI is working under
 Apache::PerlRun or Apache::Registry. The $ENV{MOD_PERL} says
 that script is working under mod_perl, but it does not says it
 is working under Perlrun Registry.

Use caller - at the top of your script:

my @env=caller;
my $env=@env ? $env[0] : 'CGI';

$env will be one of 'CGI', 'Apache::Registry' or 'Apache::PerlRun'. Use 
$env=(caller)[0] if you always run under mod_perl.

Pete



Re: modify Server header via a handler

2001-05-02 Thread Larry Leszczynski

Hi Matt -

 Actually I lied! It is possible, though only from XS. I just added a
 module_init section to AxKit's config directives, and now I get:
 
 # HEAD http://axkit.org/ | grep Server
 Server: Apache/1.3.17 (Unix) AxKit (1.3_96) mod_perl/1.25

Now you just need the Netcraft folks to start scanning for AxKit  :-)

Could you share the code you used to do this?


Thanks!
Larry Leszczynski
[EMAIL PROTECTED]




Re: modify Server header via a handler

2001-05-02 Thread Matt Sergeant

On Wed, 2 May 2001, Larry Leszczynski wrote:

 Hi Matt -
 
  Actually I lied! It is possible, though only from XS. I just added a
  module_init section to AxKit's config directives, and now I get:
  
  # HEAD http://axkit.org/ | grep Server
  Server: Apache/1.3.17 (Unix) AxKit (1.3_96) mod_perl/1.25
 
 Now you just need the Netcraft folks to start scanning for AxKit  :-)
 
 Could you share the code you used to do this?

Yep, it'll be in AxKit 1.4 ;-)

-- 
Matt/

/||** Founder and CTO  **  **   http://axkit.com/ **
   //||**  AxKit.com Ltd   **  ** XML Application Serving **
  // ||** http://axkit.org **  ** XSLT, XPathScript, XSP  **
 // \\| // ** mod_perl news and resources: http://take23.org  **
 \\//
 //\\
//  \\




Re: [PATCH] [phil@fifi.org: Bug#86964: One more method ( patch) for libapache-mod-perl]

2001-05-02 Thread Daniel Jacobowitz

On Tue, May 01, 2001 at 11:15:30AM -0700, Doug MacEachern wrote:
 On Sun, 4 Mar 2001, Daniel Jacobowitz wrote:
 
  Here's another reasonable-looking patch from Philippe Troin; it exposes
  child_num() in Apache::Connection.
 
 i hesitate adding this to Connection.xs at this point since it is 1.3
 specific.  but i would be happy to include it as an new method
 Apache::Scoreboard.

Eh?  mod_perl 1.25 doesn't have a Scoreboard.xs...  Are you talking
about 2.0?

-- 
Daniel Jacobowitz   Debian GNU/Linux Developer
Monta Vista Software  Debian Security Team



PerlAccessHandler via set_handlers()?

2001-05-02 Thread will trillich

thanks one and all for the pointers on cookies. i probably grok
738% more than i did, but i have a feeling it's still only 13% of
the pie. or in this case, cookie...

so how's this PerlAccessHandler, for twisted logic? hole-punching
and pitfall-warning equally welcome:

#httpd.conf
PerlAccessHandler My::TrollUnderTheBridge
PerlHandler Something::OrOther

#perl
package My::TrollUnderTheBridge;

sub handler {
my $r = shift;

if ( logging_in($r) ) {

my $h = $r-get_handlers( 'PerlHandler' );
unshift @{$h},\checkUser ; # do checkUser first
$r-set_handlers( PerlHandler = $h );

} elsif ( needs_login($r) ) {

$r-set_handlers( PerlHandler = [ \login ] );
#   return AUTH_REQUIRED; or not ?

}

return OK;
}

sub checkUser {
my $r = shift;
if ( bad_passwd( $r ) ) {
# generate html for username/password login screen, again
login( $r );
# we handled it, other handlers won't be called (right?)
return OK;
} else {
$r-headers_out-add( 'Set-Cookie' = make_ticket( $r ) );
# let normal handler do its thing
return DECLINED;
}
}

so i can keep the same url for all three stages, with no need for
preliminary cookies:

3. valid ticket - show web pages
else
2. validate user/pass - make ticket  show pages
else
1. login - get user/pass

is this sound? or am i fuxnored?

--

but then from within login() i'd like to be able to abort, like
so--



Urgent: remove password from server cert?

2001-05-02 Thread Paul

In a sudden (and late) moment of epiphany, I just realized (while
writing a note to our CSA to please put the new server's startup in the
machines boot cycle) that when we reboot (*every* monday morning in the
wee hours) it's not terribly likely that anyone's going to be around to
feed the password to the startup query.

This really needs to be automated.
Help? =o)

Paul
=
Friends are those who,
when you must inconvenience them,
are less bothered by it than you. ;o]

__
Do You Yahoo!?
Send instant messages  get email alerts with Yahoo! Messenger.
http://im.yahoo.com/


__
Apache Interface to OpenSSL (mod_ssl)   www.modssl.org
User Support Mailing List  [EMAIL PROTECTED]
Automated List Manager[EMAIL PROTECTED]



Re: [PATCH] [phil@fifi.org: Bug#86964: One more method ( patch)for libapache-mod-perl]

2001-05-02 Thread Stas Bekman

On Wed, 2 May 2001, Daniel Jacobowitz wrote:

 On Tue, May 01, 2001 at 11:15:30AM -0700, Doug MacEachern wrote:
  On Sun, 4 Mar 2001, Daniel Jacobowitz wrote:
 
   Here's another reasonable-looking patch from Philippe Troin; it exposes
   child_num() in Apache::Connection.
 
  i hesitate adding this to Connection.xs at this point since it is 1.3
  specific.  but i would be happy to include it as an new method
  Apache::Scoreboard.

 Eh?  mod_perl 1.25 doesn't have a Scoreboard.xs...  Are you talking
 about 2.0?

it's on CPAN: Apache::Scoreboard

_
Stas Bekman  JAm_pH --   Just Another mod_perl Hacker
http://stason.org/   mod_perl Guide  http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://eXtropia.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/





Re: [PATCH] [phil@fifi.org: Bug#86964: One more method ( patch) for libapache-mod-perl]

2001-05-02 Thread Daniel Jacobowitz

On Thu, May 03, 2001 at 11:10:59AM +0800, Stas Bekman wrote:
 On Wed, 2 May 2001, Daniel Jacobowitz wrote:
 
  On Tue, May 01, 2001 at 11:15:30AM -0700, Doug MacEachern wrote:
   On Sun, 4 Mar 2001, Daniel Jacobowitz wrote:
  
Here's another reasonable-looking patch from Philippe Troin; it exposes
child_num() in Apache::Connection.
  
   i hesitate adding this to Connection.xs at this point since it is 1.3
   specific.  but i would be happy to include it as an new method
   Apache::Scoreboard.
 
  Eh?  mod_perl 1.25 doesn't have a Scoreboard.xs...  Are you talking
  about 2.0?
 
 it's on CPAN: Apache::Scoreboard

Oh, duh.  Thanks.

-- 
Daniel Jacobowitz   Debian GNU/Linux Developer
Monta Vista Software  Debian Security Team



mod_perl subs defined, but DON'T EXIST? wtf?!

2001-05-02 Thread will trillich

long version--

okay, i'm confused, and this time it's not related to cookies.
it happens to be the same bloinkin' project, but this time it's
perl in general, that's got me baffled...

if have a subroutine that's defined, but it's not showing up as
defined. i used the *Symbol::Table::name{CODE} method myself and
sure enough, there's no CODE for the defined subroutine...

here's my debug snippet, in context--

###

package My::Access;
# File: My/Access.pm

use strict;
use Apache::Constants qw(OK SERVER_ERROR);
use Apache::TicketTool;
use Apache::Log;

sub handler {
my $r = shift;

{
no strict;
# see camel book, page 282
my $x = '';
my @key = qw(
SCALAR ARRAY HASH
CODE FILEHANDLE
);  # ignore GLOB, PACKAGE, NAME
foreach my $item ( sort keys %My::Access:: ) {
my $descr = '';
foreach ( @key ) {
$descr .= \t$_\n
if defined( *{$item}{$_} );
}
$x .= $item\n$descr;
}
#$r-log-debug('My::Access::handler -- ' . join '/',grep 
*{$_}{CODE},sort keys %My::Access::);
$r-log-debug(My::Access::handler -- \n$x);
}

if ( needs_login($r) ) {

if ( logging_in($r) ) {

# currently trying to log in (user/password supplied)
$r-log-debug('My::Access::handler logging in 
(PerlHandler=checkUser())');

my $h = $r-get_handlers( 'PerlHandler' );
unshift @{$h},\checkUser ; # do checkUser first
$r-set_handlers( PerlHandler = $h );

} else {

# no ticket, no username -- so ask for login
$r-log-debug('My::Access::handler needs login 
(PerlHandler=ask_login())');

$r-set_handlers( PerlHandler = [ \ask_login ] );

}
}

return OK;
}

sub logging_in { #exists, but not as code?
...
}

sub needs_login {#exists, but not as code?
...
}

sub ask_login {  #exists, but not as code?
...
}

sub make_login {# doesn't exist at all???
...
}

sub checkUser {  #exists, but not as code?
...
}

sub make_welcome {  # doesn't exist at all???
...
}

sub need_cookies {  # doesn't exist at all???
...
}

1;

__END__


###

and here's the resulting log output, which gives my mind a
temporal inversion tachyon matrix pulse*:

###

[Thu May  3 00:09:04 2001] [notice] Apache/1.3.9 configured -- resuming normal 
operations
[Thu May  3 00:09:04 2001] [notice] suEXEC mechanism enabled (wrapper: 
/usr/lib/apache/suexec)
[Thu May  3 00:09:05 2001] [debug] /usr/local/lib/site_perl/My/Access.pm(52): [client 
208.33.90.85] My::Access::handler -- 
BEGIN
SCALAR
OK
SCALAR
CODE
SERVER_ERROR
SCALAR
CODE
ask_login
SCALAR
checkUser
SCALAR
handler
SCALAR
CODE
logging_in
SCALAR
needs_login
SCALAR

[Thu May  3 00:09:05 2001] [error] Undefined subroutine My::Access::needs_login 
called at /usr/local/lib/site_perl/My/Access.pm line 55.

where's make_login? make_welcome? need_cookies? hmm? aaugh!

if it was a non-terminated string or something of that nature 1)
the perl tokenizer would object and 2) it would then be all are
screwy from line X on downward which ain't the case (checkUser
seems to show up on the radar, and it comes after make_login,
which is nowhere to be seen).

###

*star trek speak for i have no *#$! idea what's happening here.

any wild-ass guesses would be appreciated.  (do i win a prize for
the most difficulty with a simple situation? or at least an
honorable mention for most belligerent refusal to move on and get
a life?)

###

short version--

WTF?

-- 
[EMAIL PROTECTED]
http://sourceforge.net/projects/newbiedoc -- we need your brain!
http://www.dontUthink.com/ -- your brain needs us!



Re: mod_perl subs defined, but DON'T EXIST? wtf?!

2001-05-02 Thread will trillich

On Thu, May 03, 2001 at 12:29:53AM -0500, will trillich wrote:
 long version--
 
 I have a subroutine that IS DEFINED, but it's not showing up as
 defined. I used the *Symbol::Table::name{CODE} method myself and
 sure enough, there's no CODE for the defined subroutine...

[snip]

 ANY wild-ass guesses would be appreciated.  (Do i win a prize for
 the most difficulty with a simple situation? Or at least an
 honorable mention for most belligerent refusal to move on and get
 a life?)
 
 ###
 
 short version--
 
 WTF?

how can a defined subroutine NOT have any code in the symbol
table? grr! this is quite a puzzle...

my version info is as follows, in case it's germane:

$ apache -v
Server version: Apache/1.3.9 (Unix) Debian/GNU
Server built:   Apr 30 2000 12:54:24

$ cat /etc/debian_version
2.2

$ perl -MTie::DBI -MCGI::Cookie -MMD5 -MLWP::Simple \
-MApache::File -MApache::URI -MApache \
-e 'print map {s/.pm$//;s%/%::%g;$_ = .${$_.::VERSION}.\n} sort keys 
%INC'
Apache = 1.26
Apache::Connection = 1.00
Apache::Constants = 1.09
Apache::Constants::Exports = 
Apache::File = 1.01
Apache::Server = 1.01
Apache::URI = 1.00
AutoLoader = 
CGI::Cookie = 1.20
CGI::Util = 1.2
Carp = 
DBI = 1.13
Digest::MD5 = 2.09
DynaLoader = 1.03
Exporter = 
Fcntl = 1.03
HTTP::Status = 1.26
LWP::Simple = 1.34
MD5 = 2.01
Tie::DBI = 0.91
mod_perl = 1.2103
overload = 
strict = 1.01
vars = 

-- 
[EMAIL PROTECTED]
http://sourceforge.net/projects/newbiedoc -- we need your brain!
http://www.dontUthink.com/ -- your brain needs us!



cvs commit: modperl-2.0/lib/ModPerl WrapXS.pm

2001-05-02 Thread dougm

dougm   01/05/02 21:01:53

  Modified:lib/ModPerl WrapXS.pm
  Log:
  somehow the recent change to base.pm requires us to have a $VERSION in the generated 
.pms
  
  Revision  ChangesPath
  1.12  +1 -0  modperl-2.0/lib/ModPerl/WrapXS.pm
  
  Index: WrapXS.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/ModPerl/WrapXS.pm,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- WrapXS.pm 2001/04/30 07:17:45 1.11
  +++ WrapXS.pm 2001/05/03 04:01:53 1.12
  @@ -458,6 +458,7 @@
   package $module;
   $isa
   use XSLoader ();
  +our \$VERSION = '0.01';
   XSLoader::load __PACKAGE__;
   
   $code
  
  
  



cvs commit: modperl-2.0/lib/ModPerl TypeMap.pm

2001-05-02 Thread dougm

dougm   01/05/02 21:35:45

  Modified:lib/ModPerl TypeMap.pm
  Log:
  assume void return type if not defined
  
  Revision  ChangesPath
  1.7   +1 -1  modperl-2.0/lib/ModPerl/TypeMap.pm
  
  Index: TypeMap.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/ModPerl/TypeMap.pm,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- TypeMap.pm2001/04/28 22:35:18 1.6
  +++ TypeMap.pm2001/05/03 04:35:44 1.7
  @@ -205,7 +205,7 @@
   my $mf = {
  name= $func-{name},
  return_type = $self-map_type($map-{return_type} ||
  -  $func-{return_type}),
  +  $func-{return_type} || 'void'),
  args= $self-map_args($func),
  perl_name   = $map-{name},
   };
  
  
  



cvs commit: modperl-2.0/lib/ModPerl FunctionMap.pm WrapXS.pm

2001-05-02 Thread dougm

dougm   01/05/02 21:56:32

  Modified:lib/ModPerl FunctionMap.pm WrapXS.pm
  Log:
  more better prefix guessing
  
  Revision  ChangesPath
  1.7   +4 -3  modperl-2.0/lib/ModPerl/FunctionMap.pm
  
  Index: FunctionMap.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/ModPerl/FunctionMap.pm,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- FunctionMap.pm2001/04/20 03:07:53 1.6
  +++ FunctionMap.pm2001/05/03 04:56:31 1.7
  @@ -65,12 +65,13 @@
   my($name, $class) = ($entry-{name}, $entry-{class});
   my $prefix = ;
   $name =~ s/^DEFINE_//;
  +$name =~ s/^mpxs_//i;
   
   (my $guess = lc($entry-{class} || $entry-{module}) . '_') =~ s/::/_/g;
  -$guess =~ s/apache_/ap_/;
  +$guess =~ s/(apache)_/($1|ap)_{1,2}/;
   
  -if ($name =~ /^$guess/) {
  -$prefix = $guess;
  +if ($name =~ s/^($guess).*/$1/i) {
  +$prefix = $1;
   }
   else {
   if ($name =~ /^(apr?_)/) {
  
  
  
  1.13  +1 -0  modperl-2.0/lib/ModPerl/WrapXS.pm
  
  Index: WrapXS.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/ModPerl/WrapXS.pm,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- WrapXS.pm 2001/05/03 04:01:53 1.12
  +++ WrapXS.pm 2001/05/03 04:56:31 1.13
  @@ -87,6 +87,7 @@
 @{ $func } {qw(dispatch orig_args)};
   
   if ($dispatch =~ /^MPXS_/) {
  +$name =~ s/^mpxs_//;
   $name =~ s/^$func-{prefix}//;
   push @{ $self-{newXS}-{ $module } },
 [$class\::$name, $dispatch];
  
  
  



cvs commit: modperl-2.0/lib/ModPerl FunctionMap.pm WrapXS.pm

2001-05-02 Thread dougm

dougm   01/05/02 22:41:02

  Modified:lib/ModPerl FunctionMap.pm WrapXS.pm
  Log:
  add BOOT keyword to indicate a function should be called at BOOT time
  
  Revision  ChangesPath
  1.8   +4 -1  modperl-2.0/lib/ModPerl/FunctionMap.pm
  
  Index: FunctionMap.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/ModPerl/FunctionMap.pm,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- FunctionMap.pm2001/05/03 04:56:31 1.7
  +++ FunctionMap.pm2001/05/03 05:41:02 1.8
  @@ -57,7 +57,7 @@
   return @missing ? \@missing : undef;
   }
   
  -my $keywords = join '|', qw(MODULE PACKAGE PREFIX);
  +my $keywords = join '|', qw(MODULE PACKAGE PREFIX BOOT);
   
   sub guess_prefix {
   my $entry = shift;
  @@ -129,6 +129,9 @@
   }
   if ($cur{ISA}) {
   $self-{isa}-{ $cur{MODULE} }-{$package} = delete $cur{ISA};
  +}
  +if ($cur{BOOT}) {
  +$self-{boot}-{ $cur{MODULE} } = delete $cur{BOOT};
   }
   }
   else {
  
  
  
  1.14  +12 -0 modperl-2.0/lib/ModPerl/WrapXS.pm
  
  Index: WrapXS.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/ModPerl/WrapXS.pm,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- WrapXS.pm 2001/05/03 04:56:31 1.13
  +++ WrapXS.pm 2001/05/03 05:41:02 1.14
  @@ -378,6 +378,17 @@
   $str;
   }
   
  +sub boot {
  +my($self, $module) = @_;
  +my $str = ;
  +
  +if (my $boot = $self-typemap-{function_map}-{boot}-{$module}) {
  +$str = 'mpxs_' . $self-cname($module) . _BOOT(aTHXo);\n;
  +}
  +
  +$str;
  +}
  +
   sub write_xs {
   my($self, $module, $functions) = @_;
   
  @@ -428,6 +439,7 @@
   
   print $fh PROTOTYPES: disabled\n\n;
   print $fh BOOT:\n;
  +print $fh $self-boot($module);
   print $fh items = items; /* -Wall */\n\n;
   
   if (my $newxs = $self-{newXS}-{$module}) {
  
  
  



cvs commit: modperl-2.0/xs/Apache/Log - New directory

2001-05-02 Thread dougm

dougm   01/05/02 23:02:50

  modperl-2.0/xs/Apache/Log - New directory