Search the web
Sign In
New User? Sign Up
apache-asp · Apache::ASP
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Show off your group to the world. Share a photo of your group with us.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Messages 1 - 31 of 2276   Newest  |  < Newer  |  Older >  |  Oldest
Messages: Show Message Summaries   (Group by Topic) Sort by Date v  
#31 From: Szymon Juraszczyk <szymon@...>
Date: Mon Dec 24, 2001 4:24 am
Subject: Re: Is only my $Response->Flush() broken ?
szymon@...
Send Email Send Email
 
On Sun, 2001-12-23 at 20:01:04, Joshua Chamas wrote:

> Szymon Juraszczyk wrote:
> >
> >   Hi,
> >
> >   I've got serious problems with $Response->Flush() function. I searched
> > discussion forums and found quite lots of references regarding this issue.
> > However, using brand new Apache::ASP 2.29 and struggling all day long I
> > still can't make this bloody function work.
> >
>
> How does the http://www.apache-asp.org/eg/register_cleanup.asp
> script work for you?  Under IE & Netscape, I see the ... render
> one line at a time.  This is as a result of $Response->Flush().
> This script is the same as ./site/eg/register_cleanup.asp in
> the distribution.

   It works fine for me too.

> $Response->Flush is explicitly disabled in XMLSubs, since the
> content must be passed into the XMLSubs for processing, but
> otherwise it should work fine.

   I don't use XMLSubs.

> If you really get stuck, send a bit of script where you can't
> get $Response->Flush to work & I'll check it out.

   It's very simple:

<html>
<body>


<%
   for (my $i = 1; $i <= 10; $i++) {
     $Response->Write("Test $i<br>\n");
   }

   $Response->Flush();

   sleep(10);

  $Response->Write("End<br>");
%>

</body>
</html>

   I suspect that mod-perl is buffering something. Your code does
$Response->{'r'}->print() in Flush() - I checked that. Maybe my
modperl-enabled Apache is kind of lame? I use apache-perl-1.3.22-2-1.26-3
Debian package.

Regards,
--
Szymon Juraszczyk, szymon@...
Surfland Computer Systems S.A.
tel. +48 71 78-02-952, http://www.ssk.com.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#30 From: Joshua Chamas <joshua@...>
Date: Mon Dec 24, 2001 4:01 am
Subject: Re: Is only my $Response->Flush() broken ?
joshua@...
Send Email Send Email
 
Szymon Juraszczyk wrote:
>
>   Hi,
>
>   I've got serious problems with $Response->Flush() function. I searched
> discussion forums and found quite lots of references regarding this issue.
> However, using brand new Apache::ASP 2.29 and struggling all day long I
> still can't make this bloody function work.
>

How does the http://www.apache-asp.org/eg/register_cleanup.asp
script work for you?  Under IE & Netscape, I see the ... render
one line at a time.  This is as a result of $Response->Flush().
This script is the same as ./site/eg/register_cleanup.asp in
the distribution.

$Response->Flush is explicitly disabled in XMLSubs, since the
content must be passed into the XMLSubs for processing, but
otherwise it should work fine.

If you really get stuck, send a bit of script where you can't
get $Response->Flush to work & I'll check it out.

--Josh
_________________________________________________________________
Joshua Chamas                           Chamas Enterprises Inc.
NodeWorks Founder                       Huntington Beach, CA  USA
http://www.nodeworks.com                1-714-625-4051

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#29 From: Szymon Juraszczyk <szymon@...>
Date: Mon Dec 24, 2001 12:27 am
Subject: Is only my $Response->Flush() broken ?
szymon@...
Send Email Send Email
 
Hi,

   I've got serious problems with $Response->Flush() function. I searched
discussion forums and found quite lots of references regarding this issue.
However, using brand new Apache::ASP 2.29 and struggling all day long I
still can't make this bloody function work.

   Any suggestions?

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#28 From: Aaron Johnson <solution@...>
Date: Thu Dec 20, 2001 11:41 pm
Subject: [JOB] Webmaster with lite programming
solution@...
Send Email Send Email
 
The job is on site in Chicago and would require a wide range of talent,
including , but not limited to:

Ability to create/write/edit content for the web site
Ability to work in a FreeBSD or Linux server environment
Able to troubleshoot and modify existing code that someone else has created
Able to extend other peoples work.

The company looking to fill the position is currently running a
mod_perl/Apache::ASP driven site so the amount of hard core mod_perl
programming is almost null, I am hoping however that someone on this
list may be the right person or know the right person to apply for this
position.

Please send resume and expected salary to solution@...


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#27 From: Dariusz Pietrzak <dariush@...>
Date: Thu Dec 20, 2001 12:19 pm
Subject: RE: Canned ASP applications / applets
dariush@...
Send Email Send Email
 
> Are you aware of any "standards", de-facto or otherwise, for sharing
> calendar information?  For example, I participate in several groups that
> host monthly events, board of directors meetings, and other activities.
> Does RSS support an "event start" and "event end" fields?
There is something called 'iCalendar' that some apps seem to refer as to
standard.

> Has this problem already been solved?
it is so common that is should have been solved years ago, but all I've
seen is a bunch of calendaring apps doing great job, but terribly
incompatible between themselves ( what I'd like is single calendar in
web/gui and console form, and the console one should be stdin/stdout so I
can pipe it to speach syntheziser )

  --
Dariusz Pietrzak
snafu


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#26 From: Joshua Chamas <joshua@...>
Date: Mon Dec 17, 2001 8:15 pm
Subject: Re: Bug report
joshua@...
Send Email Send Email
 
"John D. Leonard II" wrote:
>
> In order to make AuthDBI work on Win32, I had to remove all references to
> the IPC::SysV calls.  Attached is my modified AuthDBI.pm.
>
> I believe that problem lies with the caching logic within AuthDBI, but I
> haven't tracked it down yet.  I believe that the cache is disabled in the
> attached code.
>

I would at least let the author of the module know about these
things: Edmund Mergl <E.Mergl at bawue dot de> ... maybe even the mod_perl
list if Edmund is unresponsive privately.

--Josh

_________________________________________________________________
Joshua Chamas                           Chamas Enterprises Inc.
NodeWorks Founder                       Huntington Beach, CA  USA
http://www.nodeworks.com                1-714-625-4051

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#25 From: Joshua Chamas <joshua@...>
Date: Mon Dec 17, 2001 8:01 pm
Subject: Re: Random thought about ParanoidSession
joshua@...
Send Email Send Email
 
Philip Mak wrote:
>
> I think that it may actually be harmful to power users in some cases if
> you "PerlSetVar ParanoidSession 1". If the session key is stored in as a
> URL string, and someone has two different kinds of web browsers open and
> legitimately copies and pastes the URL from one web browser to another
> (because your glitzy DHTML site won't work in Opera or something),
> ParanoidSession will break it.
>

You are right.  This implementation was necessitated before by the
ASP session implementation stating that a session had to be created
if did not already exist for the incoming session id...

... but I change the Apache::ASP session implementation a while ago
to create a new session id when an invalid one is incoming.
I could use this approach here to fix the behavior you describe.
The security effect would be the same for a hacker trying to
guess session ids.

I'll put this on my TODO.

--Josh

_________________________________________________________________
Joshua Chamas                           Chamas Enterprises Inc.
NodeWorks Founder                       Huntington Beach, CA  USA
http://www.nodeworks.com                1-714-625-4051

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#24 From: Philip Mak <pmak@...>
Date: Mon Dec 17, 2001 3:36 am
Subject: Random thought about ParanoidSession
pmak@...
Send Email Send Email
 
I think that it may actually be harmful to power users in some cases if
you "PerlSetVar ParanoidSession 1". If the session key is stored in as a
URL string, and someone has two different kinds of web browsers open and
legitimately copies and pastes the URL from one web browser to another
(because your glitzy DHTML site won't work in Opera or something),
ParanoidSession will break it.


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#23 From: "John D. Leonard II" <john.leonard@...>
Date: Sun Dec 16, 2001 12:20 pm
Subject: RE: Bug report
john.leonard@...
Send Email Send Email
 
Joshua;

> I would not necessarily use $Session for this however, but create
> an alias to these vars like:
>
>   use vars qw($Env);
>   sub Script_OnStart {
>      $Env = $Request->ServerVariables;
>   }

Actually, I do want these data to persist between requests.  My goal is to
retain the REMOTE_GROUPS variable set by AuthDBI and use it by unprotected
pages to provide different views, depending on the REMOTE_GROUPS
permissions.

> Let me know if you continue to think there is a real bug here
> and we'll get to the bottom of it.

Actually, I do think that there is a bug.  However, it is NOT with Apache
nor Apache::ASP.  After several tests, my session On_Start event, and
session variables all appear to work properly across sessions.

The problem only appears AFTER I perform an authentication and authorization
using Apache::DBI.  After I authenticate, the REMOTE_GROUPS and REMOTE_USER
(but NOT the REMOTE_GROUP) are ALWAYS set to the last user's information,
regardless of the session.  That is, even after closing the browser and
opening the browser again, the last REMOTE_GROUPS and REMOTE_USERS (or
REDIRECT_REMOTE_GROUPS) variables are set to the last values.  This is a
naughty security hole.

In order to make AuthDBI work on Win32, I had to remove all references to
the IPC::SysV calls.  Attached is my modified AuthDBI.pm.

I believe that problem lies with the caching logic within AuthDBI, but I
haven't tracked it down yet.  I believe that the cache is disabled in the
attached code.

JL
---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#22 From: Joshua Chamas <joshua@...>
Date: Sun Dec 16, 2001 11:09 am
Subject: Re: Bug report
joshua@...
Send Email Send Email
 
"John D. Leonard II" wrote:
>
> Joshua (and others...):
>
> This is difficult bug to describe, but appears to relate to the
> initialization of the $Request->ServerVariables object.
>
> I have the following OnStart event defined in my global.asa:
>
> sub Script_OnStart{
>   foreach my $key (qw( REMOTE_USER REMOTE_GROUPS REDIRECT_REMOTE_GROUPS) ){
>     $Session->{$key} = $Request->ServerVariables($key) if
> ($Request->ServerVariables($key) ne "");
>   }

From your description of the problem, I would probably write your
code like this:


  sub Script_OnStart{
    foreach my $key (qw( REMOTE_USER REMOTE_GROUPS REDIRECT_REMOTE_GROUPS) ){
      $Session->{$key} = $Request->ServerVariables($key);
    }
  }

because the REMOTE_* keys should always be set outside of Apache::ASP.
You said you just wanted to copy them into $Session for reuse in other
parts of your application.

Because your code would use old session info even if there was no
REMOTE_* data, what you see as a core system bug might just be
a programming one in this case.

I would not necessarily use $Session for this however, but create
an alias to these vars like:

   use vars qw($Env);
   sub Script_OnStart {
      $Env = $Request->ServerVariables;
   }

or I might create a special $Auth object/hash for this data for
easy referencing later.  Use $Session only when you need data
to persist in a transparent way from one request to another.
If the data is already in auth headers being sent by the client,
then you can init this per request, and not take the performance
hit of using $Session to store this data ( memory vs. disk storage )

Let me know if you continue to think there is a real bug here
and we'll get to the bottom of it.

--Josh

_________________________________________________________________
Joshua Chamas                           Chamas Enterprises Inc.
NodeWorks Founder                       Huntington Beach, CA  USA
http://www.nodeworks.com                1-714-625-4051

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#21 From: Joshua Chamas <joshua@...>
Date: Sun Dec 16, 2001 10:47 am
Subject: Re: Undefined subroutine &Apache::ASP::handler called.
joshua@...
Send Email Send Email
 
Dariusz Pietrzak wrote:
>
> > Sounds like the kind of bug that would occur to a DSO build
> > of mod_perl + apache, use of Apache::StatINC or use of Apache::Reload.
> The next day problem dissapeared so I am having problems with locating the
> cause now - maybe there was sth wrong with the system, I couldn't locate
> it though.
>
>  This was not on DSO build as I said, strange thing is that it works with
> both apache-perl and apache + DSO mod_perl ( and this is the first time
> DSO mod_perl works for Apache::ASP for me, now I changed my home system
> from static to DSO and it works. )
> It is said in FAQ/webpage that DSO build would randomly fail - until now
> DSO builds have ALWAYS failed me, and now they are working OK.
> Has something changed in mod_perl as DSO status?
>

I think Doug & others attempt patches to make DSO behave better from
time to time, but I don't know that anyone has ever figured out why
DSO configurations behave so chaotically.  Some swear by them, and
generally if it works, I won't ask why.  If it doesn't I won't ask
why not either, I usually just compile a static apache/mod_perl anyway.

-- Josh
_________________________________________________________________
Joshua Chamas                           Chamas Enterprises Inc.
NodeWorks Founder                       Huntington Beach, CA  USA
http://www.nodeworks.com                1-714-625-4051

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#20 From: "John D. Leonard II" <john.leonard@...>
Date: Sun Dec 16, 2001 3:10 am
Subject: RE: Canned ASP applications / applets
john.leonard@...
Send Email Send Email
 
Dariusz:

> This one here is just repackaged rss2html from XML::RSS module,
> made to fit style suggested by John Leonard.

Nice applet!

Are you aware of any "standards", de-facto or otherwise, for sharing
calendar information?  For example, I participate in several groups that
host monthly events, board of directors meetings, and other activities.
Does RSS support an "event start" and "event end" fields?

It would be nice to be able to merge these common calendars across (assuming
one or more sites) use the same calendar.

Has this problem already been solved?

Thanks,

JL


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#19 From: Dariusz Pietrzak <dariush@...>
Date: Sat Dec 15, 2001 5:26 pm
Subject: RE: Canned ASP applications / applets
dariush@...
Send Email Send Email
 
This one here is just repackaged rss2html from XML::RSS module,
made to fit style suggested by John Leonard.

I still think it would be better to make those applets as regular perl
modules - that way it's trivial to precompile them into apache and solves
namespace problems.

--
Dariusz Pietrzak
snafu
<%

#
--------------------------------------------------------------------------------\
---
#
# - rss.inc  - Apache::ASP applet
# -
#
#
--------------------------------------------------------------------------------\
---
#
# INCLUDES
use strict;
use XML::RSS;
use LWP::Simple;

# Declare variables
my $content;
my $file;

# MAIN

# get the command-line argument
my ($arg) = @_;

# create new instance of XML::RSS
my $rss = new XML::RSS;

# argument is a URL
if ($arg=~ /http:/i) {
     $content = get($arg);
     die "Could not retrieve $arg" unless $content;
     # parse the RSS content
     $rss->parse($content);

# argument is a file
} else {
     $file = $arg;
     die "File \"$file\" does't exist.\n" unless -e $file;
     # parse the RSS file
     $rss->parsefile($file);
}

# print the HTML channel
&print_html($rss);

# SUBROUTINES
sub print_html {
     my $rss = shift;
     print <<HTML;
<table bgcolor="#000000" border="0" width="200"><tr><td>
<TABLE CELLSPACING="1" CELLPADDING="4" BGCOLOR="#FFFFFF" BORDER=0 width="100%">
   <tr>
   <td valign="middle" align="center" bgcolor="#EEEEEE"><font color="#000000"
face="Arial,Helvetica"><B><a
href="$rss->{'channel'}->{'link'}">$rss->{'channel'}->{'title'}</a></B></font></\
td></tr>
<tr><td>
HTML

     # print channel image
     if ($rss->{'image'}->{'link'}) {
	 print <<HTML;
<center>
<p><a href="$rss->{'image'}->{'link'}"><img src="$rss->{'image'}->{'url'}"
alt="$rss->{'image'}->{'title'}" border="0"
HTML
         print " width=\"$rss->{'image'}->{'width'}\""
	     if $rss->{'image'}->{'width'};
	 print " height=\"$rss->{'image'}->{'height'}\""
	     if $rss->{'image'}->{'height'};
	 print "></a></center><p>\n";
     }

     # print the channel items
     foreach my $item (@{$rss->{'items'}}) {
	 next unless defined($item->{'title'}) && defined($item->{'link'});
	 print "<li><a href=\"$item->{'link'}\">$item->{'title'}</a><BR>\n";
     }

     # if there's a textinput element
     if ($rss->{'textinput'}->{'title'}) {
	 print <<HTML;
<form method="get" action="$rss->{'textinput'}->{'link'}">
$rss->{'textinput'}->{'description'}<BR>
<input type="text" name="$rss->{'textinput'}->{'name'}"><BR>
<input type="submit" value="$rss->{'textinput'}->{'title'}">
</form>
HTML
     }

     # if there's a copyright element
     if ($rss->{'channel'}->{'copyright'}) {
	 print <<HTML;
<p><sub>$rss->{'channel'}->{'copyright'}</sub></p>
HTML
     }

     print <<HTML;
</td>
</TR>
</TABLE>
</td></tr></table>
HTML
}



=head1 NAME

rss.inc - Apache::ASP applet

=head1 SYNOPSIS

   $Response->Include( "rss.inc" ,"/path/to/file.rdf" );
   $Response->Include( "showdir.inc", "http://slashdot.org/slashdot.rdf"); -don't
abuse this!

=head1 DESCRIPTION
  This little ASP applet produces html table from RDF file.
It can fetch it from network using LWP agent, but watch out for this solution -
webmasters often
place limits on how often you can fetch their site.rdf file.

=head1 SIDE EFFECTS

Outputs resulting HTML string using print.

=head1 AUTHOR

Jonathan Eisenzopf.
Apache::ASP version - Eyck;)

=cut



%>
---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#18 From: Dariusz Pietrzak <dariush@...>
Date: Thu Dec 13, 2001 9:14 pm
Subject: RE: Canned ASP applications / applets
dariush@...
Send Email Send Email
 
> The file includes =head1 =cut POD documentation (for use by "pod2html")
>
> You should be able to drop this INC into your "Global" directory and fire it
> up with:
>
> $Response->Include( "showdir.inc" );
This is great example,
  however here come the issue of namespaces - one couldn't use one's own
showdir.inc .. and with growing number of canned apps this would only
become worse.
  So how about some ugly standarisation - like aspplet_*sth*.inc or maybe
better - Apache::ASP::applets::showdir() .
  I hope someone comes up with something shorter and nicer ;)

--
Dariusz Pietrzak
snafu


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#17 From: Dariusz Pietrzak <dariush@...>
Date: Thu Dec 13, 2001 9:05 pm
Subject: Re: Undefined subroutine &Apache::ASP::handler called.
dariush@...
Send Email Send Email
 
> Sounds like the kind of bug that would occur to a DSO build
> of mod_perl + apache, use of Apache::StatINC or use of Apache::Reload.
The next day problem dissapeared so I am having problems with locating the
cause now - maybe there was sth wrong with the system, I couldn't locate
it though.

  This was not on DSO build as I said, strange thing is that it works with
both apache-perl and apache + DSO mod_perl ( and this is the first time
DSO mod_perl works for Apache::ASP for me, now I changed my home system
from static to DSO and it works. )
It is said in FAQ/webpage that DSO build would randomly fail - until now
DSO builds have ALWAYS failed me, and now they are working OK.
Has something changed in mod_perl as DSO status?



> be interested in hearing what seems to make this problem go away!
I think this was my fault - missconfiguration problem. Just didn't figured
what exactly did I do wrong.

  Sorry for this thread.

--
Dariusz Pietrzak
snafu


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#16 From: "Mark T. Dame" <mdame@...>
Date: Wed Dec 12, 2001 8:14 pm
Subject: Re: Perl functionality in ASP files
mdame@...
Send Email Send Email
 
"Howell, Steven" wrote:
>
> Is the normal range of Perl functionality available from the Perlscript
> which makes up an Apache::ASP file? For example, can you read and write to
> files on your server, use pattern matching, link in other modules to perform
> specific operations (like database access, XML document parsing) etc?

For one thing, Apache::ASP doesn't use PerlScript.  It uses real Perl.
That means that you have access to all the features and capabilities of
your currently installed version of Perl (including all of your
installed modules).  You also have access to all the features of your
currently installed version of mod_perl and Apache via the Apache
object.


-m
--
## Mark T. Dame, Vice President, Internet Operations
## MFM Communication Software:  http://www.mfm.com/
## E-mail: mailto:mdame@...  WWW: http://www.mfm.com/~mdame/
"A programmer and his mind are soon parted."

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#15 From: Mark Seger <seger@...>
Date: Wed Dec 12, 2001 6:45 pm
Subject: Re: Perl functionality in ASP files
seger@...
Send Email Send Email
 
I program in perlscript on IIS all the time as have yet to find any
functionality NOT there.  I have recently moved a perlscript LDAP app from IIS
to apache and it works like a champ, so I think the answer to your question is
yes, it's all there.

as a curiousity, why would you use VBScript when you can use perlscript?  8-)

-mark

"Howell, Steven" wrote:

> Hi folks,
>
> Is the normal range of Perl functionality available from the Perlscript
> which makes up an Apache::ASP file? For example, can you read and write to
> files on your server, use pattern matching, link in other modules to perform
> specific operations (like database access, XML document parsing) etc?
>
> I ask this because when writing ASP files to run on Microsoft IIS, if you
> use VBScript, this is a cut-down version of the Visual Basic language, with
> a lot of the useful functionality removed. I am hoping that this is not the
> case with Perlscript.
>
> Thanks,
>
> Steve Howell
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: asp-unsubscribe@...
> For additional commands, e-mail: asp-help@...


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#14 From: "Howell, Steven" <Steven_Howell@...>
Date: Wed Dec 12, 2001 6:43 pm
Subject: Perl functionality in ASP files
Steven_Howell@...
Send Email Send Email
 
Hi folks,

Is the normal range of Perl functionality available from the Perlscript
which makes up an Apache::ASP file? For example, can you read and write to
files on your server, use pattern matching, link in other modules to perform
specific operations (like database access, XML document parsing) etc?

I ask this because when writing ASP files to run on Microsoft IIS, if you
use VBScript, this is a cut-down version of the Visual Basic language, with
a lot of the useful functionality removed. I am hoping that this is not the
case with Perlscript.

Thanks,

Steve Howell


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#13 From: "John D. Leonard II" <john.leonard@...>
Date: Wed Dec 12, 2001 3:11 pm
Subject: Bug report
john.leonard@...
Send Email Send Email
 
Joshua (and others...):

This is difficult bug to describe, but appears to relate to the
initialization of the $Request->ServerVariables object.

I have the following OnStart event defined in my global.asa:

sub Script_OnStart{
   foreach my $key (qw( REMOTE_USER REMOTE_GROUPS REDIRECT_REMOTE_GROUPS) ){
     $Session->{$key} = $Request->ServerVariables($key) if
($Request->ServerVariables($key) ne "");
   }
}

The purpose of this script is to set up a "sticky" REMOTE_GROUP and
REMOTE_USER login.  I ask users to visit a /membersonly directory, which
uses Apache::DBI to authenticate and authorize the user.  The authentication
info gets stored into the REMOTE_USER and REMOTE_GROUPS server variables.
If these values are non-zero, I copy them to the $Session for use by my
other scripts.  In this manner, my ASP scripts can display different
information to users, depending on whether they are logged in, and what
their site permissions happen to be.

REMOTE_GROUP and REMOTE_USER variables should only appear in
$Request->ServerVariables when a file in one of the protected directories is
accessed.  These values should be empty when accessing a non-protected file.

--> BUG: When I comment out the "foreach" transfer in the "OnStart" script
above, $Request->ServerVariables returns the correct values (i.e.,
REMOTE_GROUP and REMOTE_USER values don't exist.)  HOWEVER, when the loop is
executed in "OnStart", the REMOTE_USER and REMOTE_GROUPS keys appear, and
assume the last known values (even from a different session!)

It appears that the act of referencing a non-existent key (e.g.,
REMOTE_GROUPS) in the $Request->ServerVariables object, forces the server to
return an incorrect value.  I noticed this behavior on my Win32 apache
server, but have yet tested this behavior on a unix box.

Does $Request->ServerVariables keep a "local" copy of the %ENV?  Could there
be something funny in the Win32 implementation (garbage collection, for
example) that would cause a old piece of hash memory to be accessed?

Does anyone see anything grossly incorrect?  Is there a better way to
achieve my goals?

Here is my server setup:

Server Software:  Apache/1.3.22 (Win32) mod_perl/1.26_01-dev
     Apache::ASP: 2.29
            Perl: 5.6.1 (ActiveState build 630)

Thanks,

JL


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#12 From: Joshua Chamas <joshua@...>
Date: Wed Dec 12, 2001 1:58 am
Subject: Re: Undefined subroutine &Apache::ASP::handler called.
joshua@...
Send Email Send Email
 
Dariusz Pietrzak wrote:
>
> Ehlo,
>  I need help with tracking down this error, it occurs randomly -
> everything works fine.. then I get 'internal server...' with error
> mentioned above.. refresh.. and everything works fine again.
>  this is very fresh install of debian woody, and I haven't run apache::asp
> on new machine for a long time, so maybe i'm just missing something.
> This is without PerlRequire, so no modules are loaded..
>

Hey Dariusz,

Sounds like the kind of bug that would occur to a DSO build
of mod_perl + apache, use of Apache::StatINC or use of Apache::Reload.

I would make sure to do "PerlModule Apache::ASP" in your httpd.conf
for good measure, though this should not be necessary.  I would
be interested in hearing what seems to make this problem go away!

--Josh
_________________________________________________________________
Joshua Chamas                           Chamas Enterprises Inc.
NodeWorks Founder                       Huntington Beach, CA  USA
http://www.nodeworks.com                1-714-625-4051

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#11 From: Dariusz Pietrzak <dariush@...>
Date: Tue Dec 11, 2001 7:00 pm
Subject: Undefined subroutine &Apache::ASP::handler called.
dariush@...
Send Email Send Email
 
Ehlo,
  I need help with tracking down this error, it occurs randomly -
everything works fine.. then I get 'internal server...' with error
mentioned above.. refresh.. and everything works fine again.
  this is very fresh install of debian woody, and I haven't run apache::asp
on new machine for a long time, so maybe i'm just missing something.
This is without PerlRequire, so no modules are loaded..

--
Dariusz Pietrzak
snafu


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#10 From: "John D. Leonard II" <john.leonard@...>
Date: Tue Dec 11, 2001 2:04 pm
Subject: RE: Canned ASP applications / applets
john.leonard@...
Send Email Send Email
 
All:

Attached is an example Apache::ASP applet that generates the following
strings:

   Home >> Membersonly >> Minutes

based on an input REQUEST_URI.  Each of the items (e.g., Home, Minutes) are
hyperlinked to the "/" default file in the respective subdirectories.
Through the argument list, the programmer has control over separator
character, and string substitutions for the directory names.  See the
documentation for examples and details.

The file includes =head1 =cut POD documentation (for use by "pod2html")

You should be able to drop this INC into your "Global" directory and fire it
up with:

$Response->Include( "showdir.inc" );

--> Joshua:  What are the next steps to create this applet library?

JL
---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#9 From: Joshua Chamas <joshua@...>
Date: Sun Dec 9, 2001 8:35 pm
Subject: Re: mod_perl 2.0 compatibility?
joshua@...
Send Email Send Email
 
Philip Mak wrote:
>
> Is Apache::ASP compatible with mod_perl 2.0 and Apache 2.0? If so, are
> there any problems I should be aware of?
>

I am not sure whether Apache::ASP is thread safe, but probably
would not take much work to get it that way.  I have not set up
mod_perl 2.0 and cannot vouch for it, but if you were to get
it running, I would recommend Apache::ASP to run in the mode
that has been mentioned where each thread has its own perl
interpreter, that should at least be safe, as long as other
core modues are like:

   Digest::MD5
   MLDBM::Sync
   MLDBM
   Data::Dumper

I would believe all of these latter modules to be thread safe
as well, but won't know until they are tried.

--Josh

_________________________________________________________________
Joshua Chamas                           Chamas Enterprises Inc.
NodeWorks Founder                       Huntington Beach, CA  USA
http://www.nodeworks.com                1-714-625-4051

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#8 From: Joshua Chamas <joshua@...>
Date: Sun Dec 9, 2001 8:29 pm
Subject: Re: Canned ASP applications / applets
joshua@...
Send Email Send Email
 
"John D. Leonard II" wrote:
>
> > Any more thoughts anyone?
>
> Your response just blew me away!  I can appreciate most of the nuances that
> you describe, however, most of it was well beyond my skill level.
>
> I think that the hardest part of this will be to develop a simple way for
> people to share their applets (and let people know that they have it to
> share.)
>

Let me get back to you on this.  I'll experiment some on what might
be the best way to develop simple applets like this for reusability.
Admittedly what I was talking about before needs to be simplified
greatly to cover a simple include like you are talking about.

Please understand though that the difference between a home grown
solution, and one that is well documented and reusable might be
anywhere from 3-9 times the work to produce, as suggested by
"The Mythical Man-Month", by Frederick P. Brooks, Jr.  I reference
it because I found it to be an extraordinary book about
software development.

--Josh

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#7 From: Joshua Chamas <joshua@...>
Date: Sun Dec 9, 2001 8:19 pm
Subject: Re: Using Apache::ASP with offline scripts- HOW???
joshua@...
Send Email Send Email
 
Dariusz Pietrzak wrote:
>
> > I'm wondering if there is a neat and clever way to utilize the functionality
of
> > Apache::ASP in an offline capacity...
> how about 'asp' script,
> i think it's included in Apache::ASP distribution
>
> eyck@ghost:~$ asp
>

Exactly... the asp script is at ./cgi/asp in the distribution.

-- Josh

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#6 From: Dariusz Pietrzak <dariush@...>
Date: Sun Dec 9, 2001 1:07 pm
Subject: Re: Using Apache::ASP with offline scripts- HOW???
dariush@...
Send Email Send Email
 
> I'm wondering if there is a neat and clever way to utilize the functionality
of
> Apache::ASP in an offline capacity...
how about 'asp' script,
i think it's included in Apache::ASP distribution

eyck@ghost:~$ asp

Usage: asp [-hsdb] [-o directory] file1 @arguments file2 @arguments ...

     -h  Help you are getting now!
     -s  Setup $Session and $Application state for script.
     -d  Set to debug code upon errors.
     -b  Only return body of document, no headers.
     -o  Output directory, writes to files there instead of STDOUT

This program will run asp scripts from the command line.
Each file that is specified will be run, and the
$Request->QueryString() and $Request->Form() data will
be initialized by the @arguments following the script file
name.  The @arguments will be written as space separated
words, and will be initialized as an associate array where
%arguments = @arguments.



---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#5 From: "John D. Leonard II" <john.leonard@...>
Date: Sun Dec 9, 2001 12:36 pm
Subject: RE: Using Apache::ASP with offline scripts- HOW???
john.leonard@...
Send Email Send Email
 
John:

The beauty of Apache::ASP is that it is all written in "perl".  I often
implement the off-line functionality that you describe through a "cron" job
and a perl script (or a makefile.)  See the LWP library (to pull data from
other web sites,) the DBI library (to pull data from local data bases,) and
perhaps the CGI library (to create your HTML outputs.)

If you want to share code between your CRON scripts and your Apache::ASP
applications, then you can create your own perl modules (.pm files.)  Then,
either your perl scripts or Apache::ASP applications can "use mymodule;" and
access the same perl subs.

JL

> -----Original Message-----
> From: root@... [mailto:root@...]On Behalf Of
> Brat Wizard
> Sent: Sunday, December 09, 2001 7:26 AM
> To: ASP Mailing List
> Subject: Using Apache::ASP with offline scripts- HOW???
>
>
>
>
> Howdy-
>
> I'm wondering if there is a neat and clever way to utilize the
> functionality of
> Apache::ASP in an offline capacity...
>
> This isn't as hair-brained a request as it might seem-- I am attempting to
> create a background processor script to dig through a database and send
> html-formatted email to appropriate folks. So it is an
> html-related thing, its
> just that apache isn't involved ;)
>
> I would very much like it if I could "think" in Apache::ASP style
> as I write my
> background processes as they are much more html than they are
> anything else-
> they just happen to take place offline and are scheduled by cron.
>
> Is this possible??
>
> Thanks
>
> John Whitten
> brat@...
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: asp-unsubscribe@...
> For additional commands, e-mail: asp-help@...


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#4 From: "John D. Leonard II" <john.leonard@...>
Date: Sun Dec 9, 2001 12:32 pm
Subject: RE: Canned ASP applications / applets
john.leonard@...
Send Email Send Email
 
> Any more thoughts anyone?

Your response just blew me away!  I can appreciate most of the nuances that
you describe, however, most of it was well beyond my skill level.

I think that the hardest part of this will be to develop a simple way for
people to share their applets (and let people know that they have it to
share.)

Here are some implementation questions:

--> If I have a "tidy" .INC file (one that doesn't use GLOBAL.ASA), how can
I share it?

--> Is it "safe" if the script compiles under "use strict" or must I do
something else to help minimize namespace polution?

--> How do I start the POD documentation?  Simply put a "<% __END__ %>"
after my last </HTML>?

JL


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#3 From: Brat Wizard <brat@...>
Date: Sun Dec 9, 2001 12:25 pm
Subject: Using Apache::ASP with offline scripts- HOW???
brat@...
Send Email Send Email
 
Howdy-

I'm wondering if there is a neat and clever way to utilize the functionality of
Apache::ASP in an offline capacity...

This isn't as hair-brained a request as it might seem-- I am attempting to
create a background processor script to dig through a database and send
html-formatted email to appropriate folks. So it is an html-related thing, its
just that apache isn't involved ;)

I would very much like it if I could "think" in Apache::ASP style as I write my
background processes as they are much more html than they are anything else-
they just happen to take place offline and are scheduled by cron.

Is this possible??

Thanks

John Whitten
brat@...



---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#2 From: Philip Mak <pmak@...>
Date: Sat Dec 8, 2001 7:59 am
Subject: mod_perl 2.0 compatibility?
pmak@...
Send Email Send Email
 
Is Apache::ASP compatible with mod_perl 2.0 and Apache 2.0? If so, are
there any problems I should be aware of?

I'm getting a new server and I'm thinking of playing with mod_perl 2.0.


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

Messages 1 - 31 of 2276   Newest  |  < Newer  |  Older >  |  Oldest
Advanced
Add to My Yahoo!      XML What's This?

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help