[input] mod_perl and ISPs in the real world

2000-06-28 Thread Stas Bekman

Hi,

In the mod_perl Guide's chapter "mod_perl for ISPs" that you can read at
http://perl.apache.org/guide/multiuser.html I go through various scenarios
that can be deployed by ISPs who want to provide mod_perl services. The
chapter talks about things to watch after, security issues and similar
stuff.

In one of the future articles for apachetoday.com I want to cover this
issue more extensively, educating ISPs to provide mod_perl services, thus
allowing more users to join the wonderful world where mod_perl rules. What
I really miss is real world testimonies, experiences and probably new
implementation ideas not covered in the chapter.

If you work for an ISP that already successfully provides mod_perl
services (preferably not co-locating, co-locating is a no-brainer) please
help me present various practical solutions to make mod_perl more
accessible to people who want to use it online and cannot yet afford a
co-location scheme.

If you know about people, who work for an ISP who does that, but are not
subscribed to this list, please forward this request to them.

Your input is very important... and hey there is nothing better than a
free advertisemnt and a few more new clients :)

Thank you!

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





Re: Apache::Config module

2000-06-28 Thread Piers Cawley

  Perhaps
  
   3. multi-level hash, i.e.
 $conf-{directory}-{'/'}-{sethandler}
  
  This is, afaik, more in-line with what the Perl.../Perl sections do.  I
  would suggest making it so the output of this module could easily be fed into
  the mod_perl configuration engine in the Perl sections.  This gives us the
  ease of the second example with the programming simplicity of the first (i.e.,
  no new functions).
 
 I actually like this alot. My question would be how to parse something
 that didn't have one element, or that had multiple ones, for example I
 can envision:
 
 Perl /Perl
 SomeContext "/a" "/b" /SomeContext
 
 The first one exists, while the second one is (as far as I'm aware) only
 theoretical. However, should they be solved as:
 
 $conf-{perl}-{somesetting}
 $conf-{somecontext}-{'/a'}-{'/b'}-{somesetting}

Not sure about the 'multi' context version. It's ugly though and I
hope it doesn't happen. However, for the 'no context' version, I
suggest: 

Perl
foo();
/Perl
Perl
bar();
/Perl

The you could have either:

   $conf-{perl}

returns

   foo();
   bar();

or

   ["foo();\n", "bar();\n"];

I *think* I prefer the latter.

-- 
Piers
BEGIN {$^H {integer} = sub {chr shift}; $^H=3312}
print 74,117,115,116,32,97,110,111,116,104,101,114;
print 32,80,101,114,108,32,72,97,99,107,101,114,10;





Re: [input] mod_perl and ISPs in the real world

2000-06-28 Thread Shane Nay

Well, as most of us know mod_perl doesn't really lend itself well to the
"hosted" world because of the way it operates.  However there is I think a
conceivable solution.  This might sound a little crazy (or a lot), but I've
been messing around with vmware, and it's really cool/stable.  One thought is
instead of hosting a "site" or a "machine" host a "virtual machine".  It might
be more economical to use one of those IBM s/who knows how many machines that
can run many many copies of linux internally for large hosts, but for a smaller
hosting service they might want to give VMWare a shot.  I have no personal
connection with VMware, but it is a really cool product and I have been testing
a lot of different things with it and it's VERY impressive.

Of course hosting on a virtual machine wouldn't be $40/month..., but at least
you _could_ have modperl and a machine of your own without paying the hefty
cost of a colocation service.  (You can restrict memory for each VM, and each
VM has bios and all that jazz..., check it out vmware.com)

Thanks,
Shane.

(Credit where credit is due: This was originally Josh Chamas's idea)

On Wed, 28 Jun 2000, you wrote:
 Hi,
 
 In the mod_perl Guide's chapter "mod_perl for ISPs" that you can read at
 http://perl.apache.org/guide/multiuser.html I go through various scenarios
 that can be deployed by ISPs who want to provide mod_perl services. The
 chapter talks about things to watch after, security issues and similar
 stuff.
 
 In one of the future articles for apachetoday.com I want to cover this
 issue more extensively, educating ISPs to provide mod_perl services, thus
 allowing more users to join the wonderful world where mod_perl rules. What
 I really miss is real world testimonies, experiences and probably new
 implementation ideas not covered in the chapter.
 
 If you work for an ISP that already successfully provides mod_perl
 services (preferably not co-locating, co-locating is a no-brainer) please
 help me present various practical solutions to make mod_perl more
 accessible to people who want to use it online and cannot yet afford a
 co-location scheme.
 
 If you know about people, who work for an ISP who does that, but are not
 subscribed to this list, please forward this request to them.
 
 Your input is very important... and hey there is nothing better than a
 free advertisemnt and a few more new clients :)
 
 Thank you!
 
 _
 Stas Bekman  JAm_pH --   Just Another mod_perl Hacker
 http://stason.org/   mod_perl Guide  http://perl.apache.org/guide 
 mailto:[EMAIL PROTECTED]   http://perl.org http://stason.org/TULARC
 http://singlesheaven.com http://perlmonth.com http://sourcegarden.org
-- 





Re: [input] mod_perl and ISPs in the real world

2000-06-28 Thread David Hodgkinson


Shane Nay [EMAIL PROTECTED] writes:

 Well, as most of us know mod_perl doesn't really lend itself well to the
 "hosted" world because of the way it operates

Hmmm...what about a variant of the proxied mod_perl?

Picture a lite bulk front-end apache doing the usual stuff then
proxying the mod_perl stuff back to a serverly (chargeably?)
process-limited apache with a different httpd.conf per site?

Nah, not good, you still have to budget a fair few meg per mod_perl
site.


-- 
Dave Hodgkinson, http://www.hodgkinson.org
Editor-in-chief, The Highway Star   http://www.deep-purple.com
  Apache, mod_perl, MySQL, Sybase hired gun for, well, hire
  -



Re: [input] mod_perl and ISPs in the real world

2000-06-28 Thread Shane Nay


 Hmmm...what about a variant of the proxied mod_perl?
 
 Picture a lite bulk front-end apache doing the usual stuff then
 proxying the mod_perl stuff back to a serverly (chargeably?)
 process-limited apache with a different httpd.conf per site?
 
 Nah, not good, you still have to budget a fair few meg per mod_perl
 site.
 
Yea, that's the problem as I see it..., modperl processes can be _huge_, so you
need a finite way to control with an absolute hand the size of those processes.
 Due to other things you really need your own apache config too..., so there in
lies the problem.  I mean you could just have a series of scripts which checked
up on the total mem consumption of each hosted users modperl and then just kill
them and send an email to the site owner, but this is a tre-crappy way to go. 
That's whats cool about the VM, it distinctly only allows "X amount" of memory,
and then it digs into its own swap rather than tearing down everyone elses
modperl.

Shane.



Re: [input] mod_perl and ISPs in the real world

2000-06-28 Thread David Hodgkinson


Shane Nay [EMAIL PROTECTED] writes:

  Hmmm...what about a variant of the proxied mod_perl?
  
  Picture a lite bulk front-end apache doing the usual stuff then
  proxying the mod_perl stuff back to a serverly (chargeably?)
  process-limited apache with a different httpd.conf per site?
  
  Nah, not good, you still have to budget a fair few meg per mod_perl
  site.
  


 Yea, that's the problem as I see it..., modperl processes can be
 _huge_, so you need a finite way to control with an absolute hand
 the size of those processes.

Limiting by number of threads on that users own dinky little apache
seemed a plausible way to go. At least apache and mod_perl are
shared. But every user will end up with a CGI.pm or somesuch in this
scenario.

Plus, I've fixated on Apache::Registry type stuff, not dinky little
per-site bits of code.

-- 
Dave Hodgkinson, http://www.hodgkinson.org
Editor-in-chief, The Highway Star   http://www.deep-purple.com
  Apache, mod_perl, MySQL, Sybase hired gun for, well, hire
  -



Re: [input] mod_perl and ISPs in the real world

2000-06-28 Thread darren chamberlain

David Hodgkinson ([EMAIL PROTECTED]) said something to this effect:
 Hmmm...what about a variant of the proxied mod_perl?
 
 Picture a lite bulk front-end apache doing the usual stuff then
 proxying the mod_perl stuff back to a serverly (chargeably?)
 process-limited apache with a different httpd.conf per site?

We are using a decent solution to handle hosting for employees personal
domains, although it is on a pretty small scale:

A single public address, with all the names pointing to this address. It has
mod_proxy and mod_rewrite enabled (and very little else) and each VirtualHost
section is merely a ProxyPass directive.

The actual domains themselves are running on dedicated high ports on virtual
addresses attached eth0 (eth0:1 is bound to 192.168.0.1, eth0:2 is bound to 
192.168.0.2, etc). The VirtualHost directives look like, sometimes with a 
ServerAlias directive, but never more than that:

VirtualHost 12.34.56.78:80
  ServerName www.foobar.com
  ProxyPass  / http://192.168.0.2:8000/
/VirtualHost

And each server (running on dedicated private addresses, on high ports so
that the user can start and stop the server without root access) maintains
its own configs and setup. We get a bunch of traffic, with 6 hosted domains,
and about 45 httpd processes. The server is a Penguin Computer box (plug!
plug!) with a PIII-500 and 128 Megs of RAM; a decent box, but not a huge
one.

darren

-- 
Kill Ugly Radio



[new module] Apache::Regex

2000-06-28 Thread Geoffrey Young

Hi all...

I posted to the list a little while ago a simple regular expression
PerlHandler implementation.  I've cleaned it up since then and thought I
might post it to CPAN if there is any interest.  I was thinking of
Apache::Regex as the release name.  I know it's a basic module, and people
who need the functionality usually do it themselves, but...

Apache::Regex accepts PerlAddVar directives and applies
s/$change/$to/eeg the requested HTML file on a line by line basis.  Features
include: Apache::Filter aware, accepts multiple change/to pairs, only tries
to process HTML files.  It requires mod_perl 1.24.

While overhead intensive, a I originally wrote it for a friend who
wanted to be able to use a js enabled page in a plaintext version of the
site without having to maintain two pages.  Since the plaintext page
requests are minimal, the added overhead is negligable.  I guess I can see
it as also being an easy way to migrate a site when a company changes names
once a week :)

Anyway, the pre-release can be seen at
http://morpheus.laserlink.net/~gyoung/modules/Apache-Regex-0.01.tar.gz

constructive comments welcome

--Geoff



[admin] new list: dev@perl.apache.org

2000-06-28 Thread Ask Bjoern Hansen

Hi,

We have created a new list, [EMAIL PROTECTED], to discuss development
issues. We have usually had that distributed in some way between private
mail, the -cvs list and the modperl list which is way overloaded.

subscribe by sending mail to [EMAIL PROTECTED]

I've subscribed the list of subscribers to [EMAIL PROTECTED]


enjoy,

 - ask

-- 
ask bjoern hansen - http://www.netcetera.dk/~ask/
more than 70M impressions per day, http://valueclick.com




Re: Apache::Config module

2000-06-28 Thread James G Smith

Nathan Wiger [EMAIL PROTECTED] wrote:

  UseCanonicalName   On# = 1
  UseCanonicalName   Off   # = 0
  #UseCanonicalName  On# = undef (commented out)

That way, the logic in your script/module/whatever can set a default
value:

   if ( ! defined($conf-{usecanonicalname}) ) {
  # not specified, set default(s)
   } elsif ( ! $conf-{usecanonicalname} ) {
  # explicitly turned off
   } else {
  # explicitly turned on
   }

I think I would prefer it not exist in the hash if it is commented out in the 
config file (the same as not existing in the config file).  Then

  UseCanonicalName   On# = 1
  UseCanonicalName   Off   # = 0
  UseCanonicalName # = undef
  #UseCanonicalName  On# = non-existant (commented out)

Otherwise, we can't distinguish between the last two possibilities.
-- 
James Smith [EMAIL PROTECTED], 979-862-3725
Texas AM CIS Operating Systems Group, Unix





RE: Upgrade

2000-06-28 Thread Geoffrey Young

as long as you have mod_so compiled into apache, you should be able to add
mod_perl as a DSO.  you can check with httpd -l

the advice you will get the most from this list is to recompile apache with
a static mod_perl and forget DSO, but DSO stability is reported to have
improved of late so it may not give you much grief.  If you really can't
recompile apache, DSO is for you...

see 
http://perl.apache.org/guide/install.html
specifically
http://perl.apache.org/guide/install.html#Build_mod_perl_as_a_DSO_inside_t

HTH

--Geoff


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, June 28, 2000 3:01 PM
 To: [EMAIL PROTECTED]
 Subject: Upgrade
 
 
 I have to get mod_perl into a currently runnning apache 
 server. How does
 one go about adding mod_perl if not done at compile time?
 
 Sysinfo:
 FreeBSD 4.0-stable
 Apache 1.3.6  - source install not ports collection.
 
 
 
 =
 Keith W.
 
 At the helm for better or worse
 =
 
 



Upgrade

2000-06-28 Thread keith

I have to get mod_perl into a currently runnning apache server. How does
one go about adding mod_perl if not done at compile time?

Sysinfo:
FreeBSD 4.0-stable
Apache 1.3.6  - source install not ports collection.



=
Keith W.

At the helm for better or worse
=





Re: Apache::Upload ?

2000-06-28 Thread drfrog

i to need an upload solution

to get Apache::Request::upload in i just
cpan'd it down as
install Bundle::Apache
there was quite a few dependencies
that it needed

i then restarted apache

and perl-status had it in there

now my question is does anyone have a example script using this upload
feature?

i saw some snippets in perldoc Apache::Request
that are quite usable 
but if someone has an example
it would simply save me some time!

thanks



RE: Apache::Upload ?

2000-06-28 Thread Geoffrey Young

the documentation in Apache::Request is pretty complete.  I've only tested
Apache::Upload and don't use it in production (because I don't need to
support uploads) but you can start your script like this:

use strict;
my $r = Apache::Request-new(shift);
my $upload = $r-upload;

now you have an Apache::Upload object.  use the various methods on $upload
as are in the docs.  for instance, the perldoc shows you how to get back a
filehandle that you can use to read the file:

my $fh = $upload-fh;
my $lines = 0;
while($fh) {
  ++$lines;
  ...
}

HTH

--Geoff

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, June 28, 2000 3:31 PM
 To: Geoffrey Young
 Cc: 'Casey Bristow'; [EMAIL PROTECTED]
 Subject: Re: Apache::Upload ?
 
 
 i to need an upload solution
 
 to get Apache::Request::upload in i just
 cpan'd it down as
 install Bundle::Apache
 there was quite a few dependencies
 that it needed
 
 i then restarted apache
 
 and perl-status had it in there
 
 now my question is does anyone have a example script using this upload
 feature?
 
 i saw some snippets in perldoc Apache::Request
 that are quite usable 
 but if someone has an example
 it would simply save me some time!
 
 thanks
 



Re: [admin] new list: dev@perl.apache.org

2000-06-28 Thread Autarch

On Wed, 28 Jun 2000, Ask Bjoern Hansen wrote:

 We have created a new list, [EMAIL PROTECTED], to discuss development
 issues. We have usually had that distributed in some way between private
 mail, the -cvs list and the modperl list which is way overloaded.

Is this just for development of mod_perl or also for development of
Apache::* modules.  I ask because I'm interested in the latter but not
being a C programmer I can't really contribute to the former.


-dave

/*==
www.urth.org
We await the New Sun
==*/





Re: [Mason]Filling in input tag values

2000-06-28 Thread darren chamberlain

Perrin Harkins ([EMAIL PROTECTED]) said something to this effect:
 On Wed, 28 Jun 2000, Jim Peters wrote:
 
  Embperl does it all for you in that it recognises all the various form
  input tags, and puts default values in for you if they are missing, by
  whichever means necessary (value=, checking items, or whatever), using
  values out of your %fdat hash.  This makes things very easy.  What I
  was looking for was a similarly easy catch-all solution for Mason, but
  it looks like I would have to code it all up by hand to do this.
 
 You could look into adapting HTML::FillInForm for this.  It isn't designed
 for use in Mason, but it seems like it could work.
 - Perrin

Isn't this what HTML::StickyForm is designed to do? It's still pretty fresh
(verison 0.02, I think), and it pretty small in size.

darren

-- 
An idea is not responsible for the people who believe in it.



Pinning down panic: POPSTACK

2000-06-28 Thread JoshNarins

The modperl archives are pretty clear that
  panic: POPSTACK errors
caused by dies called in a eval is a perl bug.

The archives are also clear that this is often a result
of an interaction with Apache::Session, which I *was*
getting, but have since fixed(?)

My new problem is that I am getting the error
between my PerlAccessHandler and HTML::Mason module.
I repeat, the PerlAccessHandler is completely done, and
the HTML::Mason handler hasn't been called at all.
This is NOT a case of a tied Apache::Session going out
of scope when the PerlAccessHandler ends.
I think I proved this by putting debugging lines in
subs DESTROY and 'save' of Apache::Session.pm.

That's what my problem USED to be. :)

Doesn't this mean it is happening in mod_perl itself?

I'm using

Perl 5.005_03
modperl CVS from today
Apache 1.3.12

and importing only these modules...

HTML::Mason 0.87
Apache::Session::MySQL 1.00
Apache::DBI 0.87
DBD::mysql 2.0414
Carp

I'd be happy to recompile modperl to give me some more
debugging output, but I haven't a clue yet as to what
is happening on the inside.

-Josh Narins

PS I'll be reading some more Eagle book (on the
   internals) in the meantime. Didn't parse the first
   time.




Re: Apache::Upload ?

2000-06-28 Thread drfrog

Geoffrey Young wrote:
 
 the documentation in Apache::Request is pretty complete.  I've only tested
 Apache::Upload and don't use it in production (because I don't need to
 support uploads) but you can start your script like this:
 
 use strict;
 my $r = Apache::Request-new(shift);
 my $upload = $r-upload;
 
 now you have an Apache::Upload object.  use the various methods on $upload
 as are in the docs.  for instance, the perldoc shows you how to get back a
 filehandle that you can use to read the file:
 
 my $fh = $upload-fh;
 my $lines = 0;
 while($fh) {
   ++$lines;
   ...
 }
 
 HTH
 
 --Geoff
 
  -Original Message-
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, June 28, 2000 3:31 PM
  To: Geoffrey Young
  Cc: 'Casey Bristow'; [EMAIL PROTECTED]
  Subject: Re: Apache::Upload ?
 
 
  i to need an upload solution
 
  to get Apache::Request::upload in i just
  cpan'd it down as
  install Bundle::Apache
  there was quite a few dependencies
  that it needed
 
  i then restarted apache
 
  and perl-status had it in there
 
  now my question is does anyone have a example script using this upload
  feature?
 
  i saw some snippets in perldoc Apache::Request
  that are quite usable
  but if someone has an example
  it would simply save me some time!
 
  thanks
 

hmm , ive been try for the last while based on your suggestions and the
preldoc man

here are the files ive been using
can you tell me whats wrong?

PerlRun: `Can't locate object method "new" via package "Apache::Request"
at /home/www/perl/uploadstuff.pl line 8.

is what i get
Title: uploadtest


  

  
uploadtest








Last modified: Wed Jun 28 14:31:10 PDT 2000

  

 uploadstuff.pl


Re: Apache::Upload ?

2000-06-28 Thread Greg Cope


Geoffrey Young wrote:



 I think lots of people are hoping libapreq gets integrated into the
 mod_perl-2.0 distribution :)

 --Geoff
 
excellent idea - What does everyone else think (Doug ?)
 
Greg Cope
 
snippage





Apache::Session

2000-06-28 Thread Jerrad Pierce

Has anybody started/interested in an imnplementation using DBD::RAM?



Re: Win32

2000-06-28 Thread Randy Kobes

On Wed, 28 Jun 2000, Drabb, James wrote:

 
 Is there anywhere I can go for info on getting started with mod_perl on
 win32 platform?
 I want to switch to Apache and Perl, but most info is on setting up on a
 *nix box.

At http://perl.apache.org/distributions.html, there's links
to Win32 mod_perl binaries. These include apache+perl+mod_perl -
at present you must use the included perl binary, as opposed to
ActiveState's perl. An example httpd.conf file for Apache 
is included that illustrates a basic mod_perl on Win32
configuration. These binaries are self-extracting
archives, and include instructions for installation. Also
in the readmes there's some Win32 specific things. However,
taking into account the basic limitations and differences
of Win32 as applied also to Perl and Apache in general, 
much of the basic mod_perl docs, and in particular the
guide at http://perl.apache.org/guide/, apply also to Win32.

best regards,
randy kobes




can't properly append to file from mod_perl script

2000-06-28 Thread Rob Egan

Hi,

I am relocating content from a non-mod_perl Apache site to a new
mod_perl/1.24 enabled Apache server and I have a problems getting one of the
CGI scripts to behave in mod_perl. All it does is capture e-mail addresses,
and place them in a text file so we can gather them up later and drop them
into a database. If you run the script as a regular CGI (without mod_perl
enabled) it works great. But on the mod_perl enabled server, the script
throws garbage into the file and overwrites previous entries if a user
submits more than one e-mail address in a single session (i.e. they enter
one address, click "Back", then enter another address). However, if the user
submits one e-mail address, then quits their browser, restarts the browser
and enters another e-mail, it works just fine. Does anybody have any idea
why this would happen? I've included the CGI script below with actual URL's
omitted (which was written by some consultant who no longer works here).
Thanks!

-Rob
[EMAIL PROTECTED]

-begin script text
#!/usr/local/bin/perl

$|=1;

# Enumerate the locking options for clarity...
$LOCK_EX = 2;
$LOCK_UN = 8;
$results_file = "./results.csv";
$cl = $ENV{'CONTENT_LENGTH'};
$rqm = $ENV{'REQUEST_METHOD'};

sub lock {
# print "lockingBR";
flock(RESULTS, $LOCK_EX);
# print "seekingBR";
# seeks to the end of the file in case
# someone got while we were waiting for the lock
seek(RESULTS, 0, 2);
# print "lockedBR";
}

sub unlock {
# print "unlockingBR";
flock(RESULTS, $LOCK_UN);
# print "unlockedBR";
}

sub web_die {
print "Location:  http://omitted";
die("\n");
}

sub web_die_action {
print "Location:  http://omitted";
die("\n");
}

sub return_error
{
local ($status, $keyword, $message) = @_;

print "Content-type: text/html", "\n";
print "Status: ", $status, " ", $keyword, "\n\n";

print End_of_Error;

HTMLHEADTITLEUnexpected CGI Error/TITLE/HEAD
BODY
H1$keyword/H1
HR$message/HR
/BODY
/HTML
End_of_Error
exit(1);
}
sub write_entry
{
# Lock after you open
lock();

$count = 0;
foreach (keys %FORM)
{
 $count++;
}

for ($i = 0; $i  $count; $i++)
{
  $index = $i + 1;
  if ($FORM{"FIELD_$index"} eq "")
   {
$FORM{"FIELD_$index"} = "NO ENTRY";
   }
  $FORM{"FIELD_$index"} =~ s/\"/\"\"/g;  # ...change " to ""
  $FORM{"FIELD_$index"} =~ s/\r//g;  # ...kill line feeds
  $FORM{"FIELD_$index"} =~ s/\n/ /g; # ...change cr to 
whitespace
  $FORM{"FIELD_$index"} = "\"" . $FORM{"FIELD_$index"} . "\"";
  print RESULTS $FORM{"FIELD_$index"};
  print RESULTS ","
 }
print RESULTS "\n";

# Unlock before you close
unlock();

close(RESULTS);

location;
}

if ($rqm eq "POST")
 {
  read(STDIN, $buffer, $cl);
  @pairs = split(//, $buffer);
  $q = 0;
  foreach $pair (@pairs)
   {
$q++;
($name, $value) = split(/=/, $pair);
$FORM{"FIELD_$q"} = $value;
$FORM{"FIELD_$q"} =~ tr/+/ /;
$FORM{"FIELD_$q"} =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
if ($FORM{"FIELD_$q"} eq "0-12")
 {
   location;
   exit(0);
 }
   }
 }
elsif ($cl  0)
 {
  web_die_action;
# Error: form results must be submitted with method POST
 }

###
if (! (-e $results_file))
{
if (open (RESULTS, "results.csv"))
{
write_entry;
}
else
{
return_error (500, "Results Error", "Cannot create results.csv to 
store
entries.");
}
}

else
{
if (! ((-r $results_file)  (-w $results_file)) )
{
return_error (500, "Results Error", "Cannot read or write to
results.csv.");
}
else
{
open(RESULTS, "results.csv") || web_die;
write_entry;
}
}
exit(0);
sub location
{
print "Location:  http://omitted";
}




Re: [input] mod_perl and ISPs in the real world

2000-06-28 Thread Michael

 If you know about people, who work for an ISP who does that, but are
 not subscribed to this list, please forward this request to them.
 
 Your input is very important... and hey there is nothing better than
 a free advertisemnt and a few more new clients :)
 

I run a small hosting service for "select" clients. Our servers run 
mod_perl, but I have not addressed the security implications of this 
since none of the clients so any of the work on the servers 
themselves. It is all done by our staff or consultants. I'd be very 
interested in more info on how to safely set this up for general use.

Michael
[EMAIL PROTECTED]



CHECK blocks under mod_perl?

2000-06-28 Thread Michael J Schout

Hi.

I would like to use a CHECK { } block under mod_perl, but have so far not had
any luck.  It seems like mod_perl does not know how to deal with CHECK { }
blocks.  Is this true?  If so, can it be remedied?   I cant use a BEGIN block
for what I am doing because it must happen after compilation is completed.  I
know that CHECK blocks are a 5.6.0 feature so this is why I think maybe
mod_perl doesnt know how to deal with them.

I'm using mod_perl 1.24, apache 1.3.12, perl 5.6.0

Mike




Re: [admin] new list: dev@perl.apache.org

2000-06-28 Thread Ask Bjoern Hansen

On Wed, 28 Jun 2000, Autarch wrote:

  We have created a new list, [EMAIL PROTECTED], to discuss development
  issues. We have usually had that distributed in some way between private
  mail, the -cvs list and the modperl list which is way overloaded.
 
 Is this just for development of mod_perl or also for development of
 Apache::* modules.  I ask because I'm interested in the latter but not
 being a C programmer I can't really contribute to the former.

Mostly just for mod_perl I think is the idea, but more "hardcore" Apache::
module issues and the "bundled" Perl modules will probably be on topic
too.

Join the list and let's see what happens. :)


 - ask

-- 
ask bjoern hansen - http://www.netcetera.dk/~ask/
more than 70M impressions per day, http://valueclick.com





Re: Apache::Config module

2000-06-28 Thread Hasanuddin Tamir

 No wonder Nathan Wiger on Jun 27 said that,

NW] Hi all-
NW] 
NW] I've written a module that can parse the Apache httpd.conf config file
NW] (and in fact any Apache-like config file). It will take a set of
NW] directive like:
NW] 
NW]  ServerName www.mydomain.com
NW]  UseCanonicalName   Off
NW]  
NW] And parse it case-insensitively, returning a ref to a hash:
NW] 
NW] my $ac = new Apache::Config;
NW] my $conf = $ac-readconf($configfile);
NW] print $conf-{servername};   # = "www.mydomain.com";
NW] print $conf-{usecanonicalname}; # = 0   (not undef so can test
NW]  #for defined() still)
NW] 
NW] I am also finishing up the ability to parse within contexts, such as
NW] Directory and Location. I am still unsure of the interface, I have
NW] two ideas:
NW]  
NW] 1. multi-level hash, i.e.
NW]   $conf-{"directory /"}-{sethandler}
NW]  
NW] 2. individual functions, i.e.
NW]   $conf-directory("/")-{sethandler}
NW] 
NW] If anyone has any input, I'm all ears. Right now I'm leaning towards the
NW] second one, if I can get it working. The first one is really flexible
NW] and easy, the problem is that it's difficult to search. The second one
NW] helps with this issue, but the downside is that new functions have to be
NW] added if new Apache contexts are defined. I'm trying to play some tricks
NW] with the AutoLoader ala Shell to get new functions defined on the fly.
NW] If anyone has good ideas for a better interface, I'd also like to hear
NW] them.
NW] 
NW] In any case, I have several questions:
NW]  
NW] 1. Does a module like this exist anywhere?  I saw Doug's
NW]Apache::httpd_conf, but this only takes care of writing
NW]a very minimal config file. I looked thru all the
NW]Apache:: modules but didn't see one.

You may want to take a look at AppConfig module. It does provide
generic capability to parse various kinds of config file. But I'll
be a happy user to have more spesific Apache related in this regard.

NW]  
NW] 2. Is the name Apache::Config a good name for this module?
NW]It seems like the obvious choice to me, and doesn't
NW]look like it's taken. I've also played around with
NW]Apache::ConfigFile and Apache::ReadConf, either of
NW]which I'm open to as well (or other suggestions?).

Apache::Config will be sufficient, IMHO, as later someone might
write another module, say Apache::Config::Deploy, that syncronize
the configuration of some httpds across some networks.

[snip]


san
-- 
trabasLabs * [EMAIL PROTECTED] * http://www.trabas.com
Zero Point * [EMAIL PROTECTED] * http://www.zp.f2s.com
--
bahkan mahasiswa yang memperjuangkan reformasi
pun masih menempatkan wanita pada posisi inferior
   --Sudjiwo Tejo 14/12/1998
 tentang kiriman ayam betina kepada Jaksa Agung