RE: Apache 1.3.20, modperl 1.25, win32

2001-06-15 Thread Tom Gioconda

Okay, I'm confused now.  I thought those binaries were just for people who 
didn't have a win32 compiler handy.  Don't they just use the regular source 
tree?  I build mod_perl off of the apache source using nmake and visual c++.

Here's a test:  make a frameset with three panes.  In the first two, call a 
mod_perl script that prints the time, pauses for 5 seconds, then prints the 
time again.  The third one should just be a static image.  When you try to 
load the page, you'll know if isn't running multithreaded if the panes in 
the frameset load sequentially; as in the second pane loads only after the 
first is finished.  This request takes 10 seconds on my build, instead of 
the 5 it should take if both scripts ran concurrently.

The problem I have is that my site uses a mod_perl content handler on nearly 
every html page for dynamic content.  Obviously, running requests one a time 
would not work.  I really hope there is a solution for this, because 
otherwise I have to figure out how to duplicate this in IIS (which means 
make an ISAPI extension and embedding perl in it... multithreaded perl at 
that).  I'd like to stick with Apache, because I can move to Apache 2 
eventually, if I change to IIS, I probably can never go back.

What's the verdict: am I simply damned to IIS?

-Tom

From: Ender Josef [EMAIL PROTECTED]
To: 'Tom Gioconda' [EMAIL PROTECTED]
Subject: RE: Apache 1.3.20, modperl 1.25, win32
Date: Fri, 15 Jun 2001 08:18:18 +0200

Hi Tom

Don't know anything about this problem. I'm using Randy Kobes Win32 binary
from: ftp://theoryx5.uwinnipeg.ca/pub/other/

  -Original Message-
  From: Tom Gioconda [mailto:[EMAIL PROTECTED]]
  Sent: Friday, 15 June, 2001 01:31 AM
  To: [EMAIL PROTECTED]
  Subject: Apache 1.3.20, modperl 1.25, win32
 
 
  In my continuing quest to figure out how to port my
  Apache/modperl stuff to
  Windows per my company's all win2k servers mandate, I've
  been playing with
  Apache 1.3.20 and modperl on Windows.  I was wondering if
  there is anyway to
  get this thing to handle more than one request at a time,
  without waiting
  for Apache2/modperl2 to be finished.  I've noticed that
  several people seem
  to be using win32 and mod_perl.  How are you guys dealing with the
  single-request problem?  Oh, my Perl is ActiveState build 626 (binary
  distribution).  I'm not attached to it though and can get a
  different build,
  if I can just get this thing to work.
 
  -Tom
  _
  Get your FREE download of MSN Explorer at http://explorer.msn.com
 

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




RE: Apache::DB fatal error U1077 on Win32

2001-06-15 Thread Ender Josef

Hi Randy

Many thanks for your help

Assuming your disk isn't really full, this error can result by

It is not :-)

 library it's trying to link against. Would you happen to have
 VC++ 5, and are using ActivePerl build 6xx? There is an 
 incompatibility
 there, as ActiveState uses VC++ 6. If so, you could
 - upgrade to VC++ 6

You're right. I used VC++ 5. Now I installed VC++ 6 SP4 and get a new error:

---snip---
DB.obj : error LNK2001: unresolved external symbol _Perl_rsignal_state
blib\arch\auto\Apache\DB\DB.dll : fatal error LNK1120: 1 unresolved
externals
NMAKE : fatal error U1077: 'link' : return code '0x460'
Stop.
---snip---

So I tried your next hint to install it with ppm. But unfortunatlely it
seems, there is a wrong link at:
ftp://theoryx5.uwinnipeg.ca/pub/ppmpackages/Apache-DB.ppd
CODEBASE
HREF=http://theoryx5.uwinnipeg.ca/ppmpackages/http://theoryx5.uwinnipeg.ca/
ppmpackages/x86/Apache-DB.tar.gz /

Now I installed this package manually and it's working! Great!

Many thanks!

Josi

 -Original Message-
 From: Randy Kobes [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, 14 June, 2001 05:48 AM
 To: Ender Josef
 Cc: '[EMAIL PROTECTED]'
 Subject: Re: Apache::DB fatal error U1077 on Win32 
 
 
 On Wed, 13 Jun 2001, Ender Josef wrote:
 
  Hello
 
  When I tried to install Apache::DB on NT 4.0, Perl 5.6.1, 
 Apache 1.3.20
  mod_perl/1.25_01-dev
  the following error occured:
 
  C:\Perl\lib\CORE\perl56.lib : fatal error LNK1106: invalid 
 file or disk
  full: cannot seek to 0x3afe435e
  NMAKE : fatal error U1077: 'link' : return code '0xc'
  Stop.
  (full listing at the end)
 
  I already applied the WIN32 patch (#ifndef WIN32   if (ApacheSIGINT)
  *ApacheSIGINT)(SIGINT); #endif)
 
  Any ideas how to fix this?
 [ ... ]
 
 Hi,
Assuming your disk isn't really full, this error can result by
 from using a compiler that generates code incompatible with the
 library it's trying to link against. Would you happen to have
 VC++ 5, and are using ActivePerl build 6xx? There is an 
 incompatibility
 there, as ActiveState uses VC++ 6. If so, you could
 - upgrade to VC++ 6
 - compile Perl with VC++ 5
 - install Apache-DB thru the ppm utility: within your ppm 
 utility shell,
 set the repository to
   http://theoryx5.uwinnipeg.ca/cgi-bin/ppmserver?urn:/PPMServer
 and then install Apache-DB.
 
 best regards,
 randy kobes
 



RE: Apache 1.3.20, modperl 1.25, win32

2001-06-15 Thread John Reid

 In my continuing quest to figure out how to port my
 Apache/modperl stuff to
 Windows per my company's all win2k servers mandate, I've been
 playing with
 Apache 1.3.20 and modperl on Windows.  I was wondering if there
 is anyway to
 get this thing to handle more than one request at a time, without waiting
 for Apache2/modperl2 to be finished.  I've noticed that several
 people seem
 to be using win32 and mod_perl.  How are you guys dealing with the
 single-request problem?  Oh, my Perl is ActiveState build 626 (binary
 distribution).  I'm not attached to it though and can get a
 different build,
 if I can just get this thing to work.

Hi Tom

I can sympathise. We have rolled out a system on Win32 Apache/mod_perl. We
ran into the problem of sequential requests and have had to abandon mod_perl
for a particular section of the system. We have found the mod_perl stuff to
be satisfactory for dynamic pages with only one or two db lookups. The
sections that required a lot of processing we have moved back to standard
CGI figuring that the processing overhead for process startup was a small
enough percentage to be acceptable.

Our systems use a custom tag parser that is run as a mod_perl content
handler. This originally worked as a CGI and was ported to a handler. I have
ported the CGI to PerlEx with acceptable results but we haven't rolled it
out yet.

There are ways of doing things with other technologies. We went with the
mod_perl thing because we deliver on a variety of platforms - W2K, NT, AIX,
Solaris, Linux and some of the other Unices. Win32 is always the problem. I
hesitate to say it on this list, but I am becoming more of the opinion that
Win32 problems require Win32 solutions. I can't wait for version 2.

John Reid
OpenConnect (Ireland) Ltd

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.256 / Virus Database: 129 - Release Date: 31/05/2001




RE: Apache 1.3.20, modperl 1.25, win32

2001-06-15 Thread Ender Josef

Sorry, my fault.
You're right. Same Problem there.

 -Original Message-
 From: Tom Gioconda [mailto:[EMAIL PROTECTED]]
 Sent: Friday, 15 June, 2001 08:35 AM
 To: [EMAIL PROTECTED]
 Subject: RE: Apache 1.3.20, modperl 1.25, win32
 
 
 Okay, I'm confused now.  I thought those binaries were just 
 for people who 
 didn't have a win32 compiler handy.  Don't they just use the 
 regular source 
 tree?  I build mod_perl off of the apache source using nmake 
 and visual c++.
 
 Here's a test:  make a frameset with three panes.  In the 
 first two, call a 
 mod_perl script that prints the time, pauses for 5 seconds, 
 then prints the 
 time again.  The third one should just be a static image.  
 When you try to 
 load the page, you'll know if isn't running multithreaded if 
 the panes in 
 the frameset load sequentially; as in the second pane loads 
 only after the 
 first is finished.  This request takes 10 seconds on my 
 build, instead of 
 the 5 it should take if both scripts ran concurrently.
 
 The problem I have is that my site uses a mod_perl content 
 handler on nearly 
 every html page for dynamic content.  Obviously, running 
 requests one a time 
 would not work.  I really hope there is a solution for this, because 
 otherwise I have to figure out how to duplicate this in IIS 
 (which means 
 make an ISAPI extension and embedding perl in it... 
 multithreaded perl at 
 that).  I'd like to stick with Apache, because I can move to Apache 2 
 eventually, if I change to IIS, I probably can never go back.
 
 What's the verdict: am I simply damned to IIS?
 
 -Tom
 
 From: Ender Josef [EMAIL PROTECTED]
 To: 'Tom Gioconda' [EMAIL PROTECTED]
 Subject: RE: Apache 1.3.20, modperl 1.25, win32
 Date: Fri, 15 Jun 2001 08:18:18 +0200
 
 Hi Tom
 
 Don't know anything about this problem. I'm using Randy 
 Kobes Win32 binary
 from: ftp://theoryx5.uwinnipeg.ca/pub/other/
 
   -Original Message-
   From: Tom Gioconda [mailto:[EMAIL PROTECTED]]
   Sent: Friday, 15 June, 2001 01:31 AM
   To: [EMAIL PROTECTED]
   Subject: Apache 1.3.20, modperl 1.25, win32
  
  
   In my continuing quest to figure out how to port my
   Apache/modperl stuff to
   Windows per my company's all win2k servers mandate, I've
   been playing with
   Apache 1.3.20 and modperl on Windows.  I was wondering if
   there is anyway to
   get this thing to handle more than one request at a time,
   without waiting
   for Apache2/modperl2 to be finished.  I've noticed that
   several people seem
   to be using win32 and mod_perl.  How are you guys dealing with the
   single-request problem?  Oh, my Perl is ActiveState build 
 626 (binary
   distribution).  I'm not attached to it though and can get a
   different build,
   if I can just get this thing to work.
  
   -Tom
   _
   Get your FREE download of MSN Explorer at http://explorer.msn.com
  
 
 _
 Get your FREE download of MSN Explorer at http://explorer.msn.com
 



Re: Charset woes

2001-06-15 Thread Robin Berjon

On Thursday 14 June 2001 23:40, Ged Haywood wrote:
 On Thu, 14 Jun 2001, Robin Berjon wrote:
  The problem is simply that I need to mix that data with other data
  in another encoding, which means I have to convert it.

 Do you send a charset specification to the client?  This was often
 overlooked until the cross-site scripting thing blew up early last
 year.  I wonder if browsers seeing that might be more forthcoming if
 they want to use a something different.

Yes I am, AxKit doesn't give you much of a choice there (rightfully so) :) 
After doing a number of tests, I've found that browsers (even totally 
non-compliant ones) tend to POST back in the same charset you used to send 
the page to them, unless the user types characters that don't fit into that 
charset (people usually post in the language in which the page is written, 
but sometimes their names will not fit into the charset). The spec says they 
_may_ do that if accept-charset is set to UNKNOWN (its default value), but 
then the spec is moot when it comes to browsers.

So now if I could find a way to send UTF-8 to Netscape 4 without it blowing 
up, I might have found a workable solution to this problem :-)

-- 
___
Robin Berjon [EMAIL PROTECTED] -- CTO
k n o w s c a p e : // venture knowledge agency www.knowscape.com
---
Chance is irrelevant. We will succeed. 
-- 7o9




RE: Apache::DB fatal error U1077 on Win32

2001-06-15 Thread Randy Kobes

On Fri, 15 Jun 2001, Ender Josef wrote:

 Hi Randy

   [...] Would you happen to have
  VC++ 5, and are using ActivePerl build 6xx? There is an
  incompatibility
  there, as ActiveState uses VC++ 6. If so, you could
  - upgrade to VC++ 6

 You're right. I used VC++ 5. Now I installed VC++ 6 SP4 and get a new error:

 ---snip---
 DB.obj : error LNK2001: unresolved external symbol _Perl_rsignal_state
 blib\arch\auto\Apache\DB\DB.dll : fatal error LNK1120: 1 unresolved
 externals
 NMAKE : fatal error U1077: 'link' : return code '0x460'
 Stop.
 ---snip---

Hi,
Doug suggests to comment out this call to rsignal_state in
Apache-DB for Win32, and then it will build OK.


 So I tried your next hint to install it with ppm. But unfortunatlely it
 seems, there is a wrong link at:
 ftp://theoryx5.uwinnipeg.ca/pub/ppmpackages/Apache-DB.ppd
 CODEBASE
 HREF=http://theoryx5.uwinnipeg.ca/ppmpackages/http://theoryx5.uwinnipeg.ca/
 ppmpackages/x86/Apache-DB.tar.gz /

Sorry about that - that's been fixed now.

 Now I installed this package manually and it's working! Great!

Great ...

best regards,
randy




Mod-Perl Installed next Q

2001-06-15 Thread Purcell, Scott

Hello,
Thank you all and Ron for the link to savage.net to get my
Apache/Perl/ModPerl installed.
I was successful about 10 minutes ago and my machine looks happy.

Well, now that the package is running, how do I use the persistant memory,
do the .pl files need to be named something different. Or how does this
mechanism work by putting them in the cgi-bin? Do I just call a module in my
code?  I want to just play with the server but need to use the mod-perl
(persistant behavior). I have some clean code that I would like to move into
a bin dir and check. 

What does one have to do to make this occur. Any links, or examples would be
helpful.

Thanks again,
Scott



Re: Mod-Perl Installed next Q

2001-06-15 Thread Mike Cameron

You should be able to find just about all the answers here:
http://perl.apache.org/guide
--
From: Purcell, Scott [EMAIL PROTECTED]
To: '[EMAIL PROTECTED]' [EMAIL PROTECTED]
Subject: Mod-Perl Installed next Q
Date: Fri, Jun 15, 2001, 4:43 PM


Hello,
Thank you all and Ron for the link to savage.net to get my
Apache/Perl/ModPerl installed.
I was successful about 10 minutes ago and my machine looks happy.

Well, now that the package is running, how do I use the persistant memory,
do the .pl files need to be named something different. Or how does this
mechanism work by putting them in the cgi-bin? Do I just call a module in my
code?  I want to just play with the server but need to use the mod-perl
(persistant behavior). I have some clean code that I would like to move into
a bin dir and check. 

What does one have to do to make this occur. Any links, or examples would be
helpful.

Thanks again,
Scott




Re: Mod-Perl Installed next Q

2001-06-15 Thread Randy Kobes

On Fri, 15 Jun 2001, Purcell, Scott wrote:

 Hello,
 Thank you all and Ron for the link to savage.net to get my
 Apache/Perl/ModPerl installed.
 I was successful about 10 minutes ago and my machine looks happy.

 Well, now that the package is running, how do I use the persistant memory,
 do the .pl files need to be named something different. Or how does this
 mechanism work by putting them in the cgi-bin? Do I just call a module in my
 code?  I want to just play with the server but need to use the mod-perl
 (persistant behavior). I have some clean code that I would like to move into
 a bin dir and check.

 What does one have to do to make this occur. Any links, or examples would be
 helpful.

 Thanks again,
 Scott


If you installed the binary package from theoryx5.uwinnipeg.ca,
there's already a simple example of a script (contained in
/Apache/mod_perl/printenv.pl, and accessed as
http://localhost/mod_perl/printenv.pl) which uses Apache::Registry -
see C:/Apache/conf/httpd.conf for the directives setting this
up. Also, check httpd.conf and the readme files for descriptions
of the installed working examples of Apache::ASP, HTML::Embperl, and
HTML::Mason, as well as a stupid Apache::Hello handler. Beyond
this, as was also mentioned, http://perl.apache.org/, especially
the guide, and http://take23.org/, are your friends.

best regards,
randy kobes




Setting an auth realm dynamically

2001-06-15 Thread Rodney Broom



I (like everybody else) have a site that is wholy 
dynamically generated. As such, I can't alway set an auth realm in the config or 
in .htaccess. What I'd like to do is an access handler like this:

sub handler { my $r = 
shift; if ($r-uri =~ 
m/$some_magic_pattern/|) { 
$r-auth_name($custom_realm); 
$r-auth_type('Basic'); 
$r-dir_config('require valid-user');

 return 
'OK'; } return DECLINED;
}

Obviously these routines don't work this way... Any 
thoughts?

---Rodney BroomProgrammer: 
Desert.Net


Help Apache::Registry Setup

2001-06-15 Thread Purcell, Scott

Hello I am trying to learn how to configure and set up the Apache::Registry
to cache a script And I am in the documentaton but still getting lost. I am
here
http://perl.apache.org/guide/porting.html#Before_you_start_to_code
And looking at the Exposting Apache::Registry Secrets
I entered the counter.pl text and I am running it out of my cgi-bin. And it
works, but it IS NOT persistant, or cached. I have been going through the
guide, but do not see how to make the counter.pl  PERSISTANT and to tie the
script to the Apache::Registry?

Did I miss something here?

Thanks
Scott



Re: Help Apache::Registry Setup

2001-06-15 Thread Rodney Broom

From: Purcell, Scott [EMAIL PROTECTED]

 ...but it IS NOT persistant, or cached.

 ...do not see how to make the counter.pl  PERSISTANT and to tie the
 script to the Apache::Registry?

What does your server config look like? Do you have .pl assosiated with
cgi-script, or perl-script? Have you placed something like this in your
config:

FilesMatch  \.mpl$
  SetHandler perl-script
  PerlHandler Apache::Registry
/FilesMatch


---
Rodney Broom
Programmer: Desert.Net






really dumb question maybe off topic

2001-06-15 Thread Michael

Have a script that was working on BSDI BSD/OS 3.0
recently upgraded sendmail 
Version 8.11.4
 Compiled with: MAP_REGEX LOG MATCHGECOS MIME7TO8 MIME8TO7 NAMED_BIND
NETINET NETISO NETUNIX NEWDB QUEUE SCANF SMTP USERDB
XDEBUG
permissions
-r-sr-xr-x  1 root  bin  629411 Jun  1 16:23 /usr/sbin/sendmail

and am now getting an error when attempting to open a pipe to 
sendmail

open(MAIL,|/usr/sbin/sendmail -oi -t);

I can duplicate the error at the shell level so apparently it is not 
directly mod_perl related. 

Error is:
main: setreuid(1, 0) failed: Operation not permitted

perl is 
This is perl, version 5.003_02
+ suidperl security patch

What's wrong??
Is this the kernel bug described in programming perl v3, and if so 
what can I do about it.
[EMAIL PROTECTED]



Re: ssl encryption

2001-06-15 Thread Kevin Schroeder

Then the question comes up of what happens if you're not storing it in a
database?  Say, for example, every night at midnight there's a report that
gets taken from the database and emailed to a manager in an Excel
spreadsheet that contains all the purchasing information from the previous
day.  Plus, most people concur that there is no such thing as a 100% secure
system, however, using a 2048 bit GPG asynchronous key would make it quite
difficult to get that information, even if the server was broken into and
all the root passwords were changed.  Then, of course, the intruder could
change the passkey for the encryption and send the reports to himself.
Then, of course you could modify su to report whenever someone uses it to
su to root, but that's only valid if they get in with su.  But then we're
getting beyond the scope of this mailing list.  I guess there really is no
such thing as absolute security, only probable security.  Oh well.

Kevin

- Original Message -
From: Vivek Khera [EMAIL PROTECTED]
Newsgroups: ml.apache.modperl
To: [EMAIL PROTECTED]
Sent: Friday, June 15, 2001 2:23 PM
Subject: Re: ssl encryption


  KS == Kevin Schroeder [EMAIL PROTECTED] writes:

 KS This would make an interesting discussion because I've had the
 KS same question come up in my mind.  How do you encrypt things on
 KS your server without giving out the passphrase?  Is it even
 KS possible to keep the key in the same location as the program using
 KS it and still maintain security?

 No; the only way to secure this would be to make the server ask you to
 type the passphrase on startup, and you never write this down.  This
 makes it impossible to have automated restart, of course.

 Better thing to do is to secure your database server a bit better.

 --
 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Vivek Khera, Ph.D.Khera Communications, Inc.
 Internet: [EMAIL PROTECTED]   Rockville, MD   +1-240-453-8497
 AIM: vivekkhera Y!: vivek_khera   http://www.khera.org/~vivek/





Re: Help Apache::Registry Setup

2001-06-15 Thread Rodney Broom

From: Purcell, Scott [EMAIL PROTECTED]

 I found that there is a folder called mod_perl and if I put my counter.cgi
 file there that it ran mod-perl (or PERSISTANT).

 I put the code block you sent me in the httpd.conf file and restarted the
 server, then renamed a file that was under cgi-bin to counter.mpl
(thinking
 that the .mpl linked the file to mod-perl), but I get an error stating:
 You don't have permission to access /cgi-bin/counter.mpl on this server.


 Anyway, should I be able to put .mpl files anywhere under the cgi-bin
 directory with that snippet of code, or do all mod-perl files have to live
 under the mod-perl folder?


The chunk of config that I sent:
 FilesMatch  \.mpl$
   SetHandler perl-script
   PerlHandler Apache::Registry
 /FilesMatch

Is one of several ways to get mod_perl to run your Perl code instead of
something else (like /usr/bin/perl). What I've done here is to tall Apache
to look for files that end in '.mpl' and hand them off to the given handler
(Apache::Registry). Try this script:

  # rodney.mpl
  printf qq{PID [$$] First is %sdefined [$first].br\n}, $first ? '' : 'not
';
  $first = time;

You'll notice that there's no reference to the Perl interpreter, that's OK.
mod_perl already has a Perl interpreter in memory and knows what to do with
your code. Make sure to set the permisions on this scrip to be executable by
your Apache daemon's user and to place the code in a place where Apache is
willing to execute it. Now view the script in a browser. Take not of the PID
and time (or lack thereof), and reload. Do this 10-20 times and you'll see
mod_perl magic (or toe stubbing, deppending on how you look at it.)

---
Rodney Broom
Programmer: Desert.Net






IOSocket Problem

2001-06-15 Thread Purcell, Scott

Hello,
I could really use some help here. I have had the following outstanding
problem for two weeks. I have read the mod_perl coding guidelines and the
code below actually comes from page 7 the counter example.

Background: My web site requires a login with a name and password, then I
create a login string and I have to open up a socket into a application that
lives on a Unix box, (so I use IO::Socket). I followed the coding guidelines
on page 7, but still have an issue. The first time they log in, the socket
is created and all is good. If I login the next time, it is as if the socket
is not being recreated, or something funny. It doesn't work after the first
time.

Now I know some of this is caused by the persistant mod-perl. But I have
used all my variables, and I have called the subroutines with a require like
the example, but it still doesn't work.

I am showing all code below. Could someone PLEASE glance at that and tell me
if you see anything silly. I tried this with ActiveStates .plex and it does
the same thing.

I usually don't try wolf, but I have been hacking on this for two weeks with
no success. 

### code I call from the browser 
#! perl -w

use CGI;
use strict;
use vars qw($q);
$q = CGI-new;
print $q-header;
print $q-start_html();

print BEGIN HEREBR;


### THE NAME AND PASSWORD COME FROM A HTML SOURCE IF NOT TESTING FOR AS.
my $password = $q-param('password');
my $username = $q-param('username');
print $password is password and $username is usernamebr\n;

open(ISCRYPT, D:/Apache/cgi-bin/plex/iscrypt \$password\ |) or
die(Problems encrypting pw: $!);
my @password = ISCRYPT;
close(ISCRYPT);
my $epwd = $password[0];
my $msg = USERLOGIN\t$username\t$epwd\n;
print $msg is msgbr\n;
require D:/Apache/mod_perl/plex/socket.cgi;
my ($status, $response) = ask($msg);
print qq{$status and $response is status and responsebr};

 the code for the require ##
my $handle;

sub ask
{

my ($message) = @_;
makeSocket;
SendMessage($message);
my ($status,$response) = GetResponse();
close($handle);
return ($status, $response);
undef $status;
undef $response;

}
sub makeSocket
{
use IO::Socket;
$counter = 0;
$handle = IO::Socket::INET-new(Proto = 'tcp',
PeerAddr = '208.238.162.204',
PeerPort = '8000',
Type = SOCK_STREAM) or die $@;
$handle-autoflush(1);
$counter++;
print $counter is counterbr\n;
print qq{preConnected: 208.238.162.204:8000/pre};
return 1;
}

sub GetResponse {
my $count = 0;
my $err = 0;
my $response;
my $cc;
my $header;
while ($err  50) {
if (read($handle, $cc, 1, 0) == 1) {
$header .= $cc;
if ($header =~ /^\%BEGIN\s+(\d+)\r?\n/) {
# we've acquired one line's worth of response
my $rspsize = $1; # how much response to read
if (read($handle, $response, $rspsize, 0)) {
if ($response =~ /RESPONSE\s*OK/) {
return (1, $response);
} else {
return (-1, $response);
}
} else {
return 0;
}
} elsif ($header =~ /\%CONTINUE\s*\r?\n/ || $header =~
/\%END\s*\r?\n/) {
undef $header;
} elsif ($header =~ /\n$/) {
die(unknown socket mediabank response: $header);
return -1;
} else {
# keep going haven't hit a newline yet
}
$count++;
} else {
$err++;
}
}
return 0;
}

sub SendMessage
{
my ($message) = @_;
unless ($message) {
die(No message in \'SendMessage\');
}
my $msgid = int(rand(1000));
$message = $msgid . \t . $message;
my $msgsize = length($message);
print $message and $msgsize is message and msgsizebr\n;
print $handle \%BEGIN\t$msgsize\n$message;
}
1;

Scott Purcell




Re: IOSocket Problem

2001-06-15 Thread Rodney Broom

Hi Scott,

If you think that this might be a mod_perl problem, and since you aren't
using any mod_perl specific functionality, then switch to straigh CGI. I'd
suggest adding a bunch of debugging messages in your code. They should be
directed to the server's error log by printing to STDERR. Run your program
once and have a look at the error log. Then repeat. Once you've got the
program working correctly under CGI, switch to mod_perl and start over.

Something to understand with mod_perl, it's often important to restart the
httpd between experiments. I  won't go into when this is or isn't required,
but basically: Restart Apache after every code changed.

---
Rodney Broom
Programmer: Desert.Net





Apache::Cookie-fetch fails silently

2001-06-15 Thread Rodney Broom



I've got this handler that calls 
Apache::Cookie-fetch, no problem. It's tested and works fine. So I installed 
the same handler (same machine) on a second Apache instance, but now 
Apache::Cookie-fetch fails, causing the handler to terminate. No messages, 
no nothin'. It doesn't even get to the next print() statement after the fetch() 
call.

Thoughts?

---Rodney BroomProgrammer: 
Desert.Net


Re: Sending Cookies from Access-Handler - Update 2

2001-06-15 Thread Nenad Steric

Ok,
i tried the push_handlers with PerlFixupHandler,
as before this gets called also , 
i get an entry in my error_log (because i use $r-warn to log)
and again no cookie is being sent ...

For the record : i am using apache 1.3.20 and modperl 1.25

Do i have to do a redirect or something similar so that the browser
sets the cookie ?
Or do i have problems with the basic configuration of apache ?


Nenad Steric wrote:
 
 I was wrong, there is no cookie being set at all.
 
 So, what happens is that the handler gets called
 i get an entry in the error_log like
 setting cookie Ticket=ID1; ... expires=Sun, 15-Jul-2001 ...
 and No Cookie being sent to the browser.
 
 Is it possible to send cookies from the Accesshandler ? or am i wasting my time ?
 Should i use push_handlers and use another phase of the request ?




Re: Sending Cookies from Access-Handler

2001-06-15 Thread Rodney Broom

From: Nenad [EMAIL PROTECTED]

  -expires = '+1M',

What's the expiration date shown in your browswer?


 $r-warn('setting cookie ',$cookie);# this shows up in the error_log

What does this show in the error log? I'm guessing setting cookie
Apache::Cookie.


---
Rodney Broom
Programmer: Desert.Net






Re: Sending Cookies from Access-Handler

2001-06-15 Thread Mike Christine


- Original Message -
From: Nenad [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, June 15, 2001 4:58 PM
Subject: Sending Cookies from Access-Handler


 Hallo,

 After reading the Writing Apache Modules ..-book,
 i took the ticketserver code as the foundation for a new Authtentication
Module.
 I want Cookies which have expired to silently refresh.

 so as a test i have code similar to this

 package Apache::PermanentTicketRenewer
 my Counter;
 sub handler {
 my $r = shift;

 $Counter += 1;
 my $cookie = CGI::Cookie-new(-name = 'Ticket',
   -path = '/',
   -domain = '.my.com',
   -expires = '+1M',
   -value = { 'ID' = $Counter }
 );

 $r-warn('setting cookie ',$cookie);# this shows up in the
error_log
 $r-headers_out-add(Set-Cookie = $cookie);
 i also tried
 $r-err_header_out(Set-Cookie = $cookie);
 and
 $r-cgi_header_out(Set-Cookie = $cookie);
 return OK;
 }

 and in httpd.conf
 Location /my_protected 
  PerlSendHeader On
  PerlAccessHandler Apache::TicketAccess
  #PerlAuthzHandler Apache::TicketAccess
 ...
 /Location


 And it doesn't work !
 The Browser does not set the new cookie , only the first ever sent cookie
is set.
 Whats wrong with this ?
 As you can see i also tried to use the AutzHandler, but somehow this does
not get called at all.

The reason for that is that there is no 'require'  directive in your
configuration. You need something like
require valid-user
in there for it to call AuthHandlers.
Someone correct me if i am mistaken please.

 Puzzled,

 Nenad





Re: Sending Cookies from Access-Handler - Update

2001-06-15 Thread Nenad Steric

I was wrong, there is no cookie being set at all.

So, what happens is that the handler gets called 
i get an entry in the error_log like
setting cookie Ticket=ID1; ... expires=Sun, 15-Jul-2001 ...
and No Cookie being sent to the browser.

Is it possible to send cookies from the Accesshandler ? or am i wasting my time ?
Should i use push_handlers and use another phase of the request ?

which my modperl doesn't like, i built it with EVERYTHING=1 but it doesn't want to 
call 
other handlers than the AccessHandler .. another Puzzle it seems.


Nenad wrote:
 package Apache::PermanentTicketRenewer
use etc. etc.
 my $Counter;
 sub handler {
 my $r = shift; 
 $Counter += 1;
 my $cookie = CGI::Cookie-new(-name = 'Ticket',
   -path = '/',
   -domain = '.my.com',
   -expires = '+1M',
   -value = { 'ID' = $Counter }
  );
 
 $r-warn('setting cookie ',$cookie);# this shows up in the error_log
 $r-headers_out-add(Set-Cookie = $cookie);
 i also tried
 $r-err_header_out(Set-Cookie = $cookie);
 and
 $r-cgi_header_out(Set-Cookie = $cookie);
 return OK;
 }
 
 and in httpd.conf
 Location /my_protected 
  PerlSendHeader On
  PerlAccessHandler  Apache::TicketAccess
  #PerlAuthzHandler  Apache::TicketAccess
 ...
 /Location
 
 And it doesn't work !
 The Browser does not set the new cookie , only the first ever sent cookie is set.
 Whats wrong with this ?
 As you can see i also tried to use the AutzHandler, but somehow this does not get 
called at all.




Re: Sending Cookies from Access-Handler - Fixed

2001-06-15 Thread Nenad Steric

Ok, 
i think i should really go to sleep now ...

It was using the wrong domain !
forgot to tell apache that it is called www.my.com
as i was sending cookies for .my.com ...

strangely under win32 this didn't work even with the right domain...

good night,

Nenad


 
 Ok,
 i tried the push_handlers with PerlFixupHandler,
 as before this gets called also ,
 i get an entry in my error_log (because i use $r-warn to log)
 and again no cookie is being sent ...
 
 For the record : i am using apache 1.3.20 and modperl 1.25
 
 Do i have to do a redirect or something similar so that the browser
 sets the cookie ?
 Or do i have problems with the basic configuration of apache ?
 
 Nenad Steric wrote:
 
  I was wrong, there is no cookie being set at all.
 
  So, what happens is that the handler gets called
  i get an entry in the error_log like
  setting cookie Ticket=ID1; ... expires=Sun, 15-Jul-2001 ...
  and No Cookie being sent to the browser.
 
  Is it possible to send cookies from the Accesshandler ? or am i wasting my time ?
  Should i use push_handlers and use another phase of the request ?
 



Sending Cookies from Access-Handler

2001-06-15 Thread Nenad

Hallo,

After reading the Writing Apache Modules ..-book,
i took the ticketserver code as the foundation for a new Authtentication Module.
I want Cookies which have expired to silently refresh.

so as a test i have code similar to this

package Apache::PermanentTicketRenewer
my Counter;
sub handler {
my $r = shift;

$Counter += 1;
my $cookie = CGI::Cookie-new(-name = 'Ticket',
  -path = '/',
  -domain = '.my.com',
  -expires = '+1M',
  -value = { 'ID' = $Counter }
 );

$r-warn('setting cookie ',$cookie);# this shows up in the error_log
$r-headers_out-add(Set-Cookie = $cookie);
i also tried
$r-err_header_out(Set-Cookie = $cookie);
and
$r-cgi_header_out(Set-Cookie = $cookie);
return OK;
}

and in httpd.conf
Location /my_protected 
 PerlSendHeader On
 PerlAccessHandler  Apache::TicketAccess
 #PerlAuthzHandler  Apache::TicketAccess
...
/Location


And it doesn't work !
The Browser does not set the new cookie , only the first ever sent cookie is set.
Whats wrong with this ?
As you can see i also tried to use the AutzHandler, but somehow this does not get 
called at all.

Puzzled,

Nenad



Unsubscribe me

2001-06-15 Thread kheeteck



email : [EMAIL PROTECTED]


Re: mod_perl DSO leaking on restart?

2001-06-15 Thread Paul G. Weiss

Don't be so willing to bet.  Still leaking.

I did as you said and just rebuilt Perl and mod_perl but didn't bother to
rebuild all the Perl modules (I would have done so had I been successful
here).

Here's what I see:

 make start_httpd_fork
../apache_1.3.19/src/httpd -f `pwd`/t/conf/httpd.conf -d `pwd`/t
 ps -o 'pid,ppid,vsz,comm' -p $(cat t/logs/httpd.pid )
  PID  PPID  VSZ COMMAND
28802 1 15528 ../apache_1.3.19/src/httpd
 kill -USR1 $(cat t/logs/httpd.pid )
 ps -o 'pid,ppid,vsz,comm' -p $(cat t/logs/httpd.pid )
  PID  PPID  VSZ COMMAND
28802 1 20016 ../apache_1.3.19/src/httpd
 kill -USR1 $(cat t/logs/httpd.pid )
 ps -o 'pid,ppid,vsz,comm' -p $(cat t/logs/httpd.pid )
  PID  PPID  VSZ COMMAND
28802 1 24544 ../apache_1.3.19/src/httpd
 kill -USR1 $(cat t/logs/httpd.pid )
 ps -o 'pid,ppid,vsz,comm' -p $(cat t/logs/httpd.pid )
  PID  PPID  VSZ COMMAND
28802 1 27224 ../apache_1.3.19/src/httpd
 make kill_httpd
kill `cat t/logs/httpd.pid`
rm -f t/logs/httpd.pid
rm -f t/logs/error_log



On Thu, 14 Jun 2001, Doug MacEachern wrote:

 On Fri, 15 Jun 2001, Paul G. Weiss wrote:
 
  alignbytes=8, usemymalloc=y, prototype=define
 ^
 ok, here's why i kept asking for perl -V.  i don't see Perl's malloc.c
 ever release its memory pool.  when usemymalloc=y, free() only puts memory
 back into Perl's pool for use by other malloc()'s.  i don't see a function
 to destroy this pool when perl cleans itself up.  willing to bet if you
 rebuild Perl with: Configure -des -Uusemymalloc ...
 and then rebuild mod_perl, the leaks will go away.
 




Re: BSDI 4.1 libperl.so problem

2001-06-15 Thread Vivek Khera

 DM == Doug MacEachern [EMAIL PROTECTED] writes:

 % apachectl configtest
 Syntax error on line 207 of
 /usr/local/apache/conf/httpd.conf:
 Cannot load /usr/local/apache/libexec/libperl.so into
 server: File not found

DM the problem is likely that the dynamic linker cannot find a shared library
DM that was linked against modperl's libperl.so.  you can find out by using
DM bsdi's equivalent of strace or truss (to trace system calls) and look for
DM failed calls of open() for .so files.

Back when I was using BSDI, I made sure mod_perl built and ran fine
on it (4.0, 4.1).  You can check the source code for BSDI-specific
twiddles, which were put there by me ;-)

Anyhow, I only ever tested it with a standard build as a DSO.  I never
built via apxs.  Currently I use FreeBSD, so I can't help debug this
one for ya.

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D.Khera Communications, Inc.
Internet: [EMAIL PROTECTED]   Rockville, MD   +1-240-453-8497
AIM: vivekkhera Y!: vivek_khera   http://www.khera.org/~vivek/



Re: DSO mod_perl HUP memory leak

2001-06-15 Thread Vivek Khera

 DM == Doug MacEachern [EMAIL PROTECTED] writes:

DM 1.21_01 had two dso fixes, one to close all .so's opened by DynaLoader and
DM one to call perl_shutdown(), both of which were large leaks.  with
DM 1.25_01-dev and Perl 5.6.1 i see a 4k growth on the first kill -USR1 and
DM no change after that.  what is your perl -V and mod_perl version?

On a FreeBSD 4.3-STABLE box, I get about 9M per HUP.  This server is
running every page through Template Toolkit.  Apache is built from the
FreeBSD ports collection with mod_ssl, and mod_perl is built via APXS
from the 1.25_01-dev on Feb 8, 2001.

I guess it's time to pull out my debuggerizer hat. ;-)


[yertle]% ps xu
USERPID %CPU %MEM   VSZ  RSS  TT  STAT STARTED  TIME COMMAND
khera 48860  0.0  0.4  1452 1016  p1  Ss   11:22AM   0:00.17 -tcsh (tcsh)
khera 20589  0.0  8.2 23404 21308 ??  Ss2:39PM   0:01.12 httpd -f /home/khe
khera 20733  0.0  8.2 23416 21316 ??  I 2:39PM   0:00.01 httpd -f /home/khe
khera 21190  0.0  8.2 23416 21316 ??  I 2:39PM   0:00.01 httpd -f /home/khe
khera 22022  0.0  8.2 23416 21316 ??  I 2:39PM   0:00.01 httpd -f /home/khe
khera 18230  0.0  0.1   392  232  p1  R+3:15PM   0:00.00 ps xu
[yertle]% kill -USR1 `cat logs/httpd.pid `
[yertle]% ps xu
USERPID %CPU %MEM   VSZ  RSS  TT  STAT STARTED  TIME COMMAND
khera 20589  5.2 11.7 32524 30392 ??  Ss2:39PM   0:02.21 httpd -f /home/khe
khera 48860  0.0  0.4  1452 1016  p1  Ss   11:22AM   0:00.18 -tcsh (tcsh)
khera 19790  0.0 11.7 32536 30400 ??  S 3:15PM   0:00.01 httpd -f /home/khe
khera 19955  0.0 11.7 32536 30400 ??  S 3:15PM   0:00.01 httpd -f /home/khe
khera 20280  0.0 11.7 32536 30400 ??  S 3:15PM   0:00.01 httpd -f /home/khe
khera 21037  0.0  0.1   392  232  p1  R+3:15PM   0:00.00 ps xu
[yertle]% kill -USR1 `cat logs/httpd.pid `
[yertle]% ps xu
USERPID %CPU %MEM   VSZ  RSS  TT  STAT STARTED  TIME COMMAND
khera 20589  7.6 15.2 41644 39480 ??  Ss2:39PM   0:03.31 httpd -f /home/khe
khera 48860  0.0  0.4  1452 1016  p1  Ss   11:22AM   0:00.18 -tcsh (tcsh)
khera 22075  0.0 15.2 41656 39488 ??  S 3:15PM   0:00.01 httpd -f /home/khe
khera 22621  0.0 15.2 41656 39488 ??  S 3:15PM   0:00.01 httpd -f /home/khe
khera 22851  0.0 15.2 41656 39488 ??  S 3:15PM   0:00.01 httpd -f /home/khe
khera 24543  0.0  0.1   392  232  p1  R+3:15PM   0:00.00 ps xu


-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D.Khera Communications, Inc.
Internet: [EMAIL PROTECTED]   Rockville, MD   +1-240-453-8497
AIM: vivekkhera Y!: vivek_khera   http://www.khera.org/~vivek/



Re: ssl encryption

2001-06-15 Thread Vivek Khera

 KS == Kevin Schroeder [EMAIL PROTECTED] writes:

KS This would make an interesting discussion because I've had the
KS same question come up in my mind.  How do you encrypt things on
KS your server without giving out the passphrase?  Is it even
KS possible to keep the key in the same location as the program using
KS it and still maintain security?

No; the only way to secure this would be to make the server ask you to
type the passphrase on startup, and you never write this down.  This
makes it impossible to have automated restart, of course.

Better thing to do is to secure your database server a bit better.

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D.Khera Communications, Inc.
Internet: [EMAIL PROTECTED]   Rockville, MD   +1-240-453-8497
AIM: vivekkhera Y!: vivek_khera   http://www.khera.org/~vivek/