mod_perl File Extension Configuration instead of a Path Configuration

2004-04-29 Thread JupiterHost.Net
Hello group!

Super mod_perl newbie here :)

I was wondering if its possible to setup mod_perl in httpd.conf with a
File Extension Configuration instead of a Path Configuration.
IE - everything with the .mpl extension is run under mod_perl instead of 
everything in /perl/ being run under mod_perl...
Something like:
AddHandler mod_perl-script .mpl

If it is possible what benefits/problems/issues would there be to think 
about vs a Path configuration?

Where might I find good documentation about how to do this and what 
issues you'd encounter/have to consider (I didn't see anything at 
perl.apache.org... which I'm sure is my fault ;p )?

TIA

Lee.M - JupiterHost.Net

--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: mod_perl File Extension Configuration instead of a Path Configuration

2004-05-03 Thread JupiterHost.Net
Sorry to top post...
So is it (the subject/original email below) impossible then?
Or is it possible just not advisable?
TIA
JupiterHost.Net wrote:
Hello group!
Super mod_perl newbie here :)
I was wondering if its possible to setup mod_perl in httpd.conf with a
File Extension Configuration instead of a Path Configuration.
IE - everything with the .mpl extension is run under mod_perl instead of 
everything in /perl/ being run under mod_perl...
Something like:
AddHandler mod_perl-script .mpl

If it is possible what benefits/problems/issues would there be to think 
about vs a Path configuration?

Where might I find good documentation about how to do this and what 
issues you'd encounter/have to consider (I didn't see anything at 
perl.apache.org... which I'm sure is my fault ;p )?

TIA
Lee.M - JupiterHost.Net

--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: mod_perl File Extension Configuration instead of a Path Configuration

2004-05-03 Thread JupiterHost.Net

petersm wrote:
If you want to do something like this ... every file ending in .pl is run as
an Apache::Registry (mod_perl 1) script you could do something like this in
your httpd.conf
[snip]
PerlModule Apache::Registry
AddHandler perl-script .mpl
PerlHandler Apache::Registry
[/snip]
Excellent thanks!
This kind of setup is dangerous if you have users who can put .mpl scripts
anywhere inside of the document tree 'cause those scripts will run with the
If they only have access to /home/user it would be cool right?
IE: it would be just as dangerouse as running a regular perl or shell or 
OTHER_LANGUAGE_HERE script in their home dir, correct?

same permissions that your own scripts run with. If you can control the whole
document tree it's not that bad. 
mod_perl scripts are run with the permissions of the user correct?
IE if Apache its 'nobody' or otherwsie (getpwuid($>))[0]
Michael Peters
Venzia
-- Original Message ---
From: "JupiterHost.Net" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Sent: Mon, 03 May 2004 10:31:56 -0500
Subject: Re: mod_perl File Extension Configuration instead of a Path Configuration

Sorry to top post...
So is it (the subject/original email below) impossible then?
Or is it possible just not advisable?
TIA
JupiterHost.Net wrote:
Hello group!
Super mod_perl newbie here :)
I was wondering if its possible to setup mod_perl in httpd.conf with a
File Extension Configuration instead of a Path Configuration.
IE - everything with the .mpl extension is run under mod_perl instead of 
everything in /perl/ being run under mod_perl...
Something like:
   AddHandler mod_perl-script .mpl

If it is possible what benefits/problems/issues would there be to think 
about vs a Path configuration?

Where might I find good documentation about how to do this and what 
issues you'd encounter/have to consider (I didn't see anything at 
perl.apache.org... which I'm sure is my fault ;p )?

TIA
Lee.M - JupiterHost.Net

--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html
--- End of Original Message ---


--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: mod_perl File Extension Configuration instead of a Path Configuration

2004-05-03 Thread JupiterHost.Net
Thanks for your input! I really appreciate it!
Perrin Harkins wrote:
On Mon, 2004-05-03 at 12:39, JupiterHost.Net wrote:
IE: it would be just as dangerouse as running a regular perl or shell or 
OTHER_LANGUAGE_HERE script in their home dir, correct?
[...]
mod_perl scripts are run with the permissions of the user correct?
IE if Apache its 'nobody' or otherwsie (getpwuid($>))[0]

No, when you run things with mod_perl, they run in the apache server
process.  They will always have the same permissions as the apache
So if I did it the .mpl way then /usr/foo/bar.mpl and /usr/foo/baz.mpl 
will run as nobody (IE untrusted user with less privileges)

(Regular .pl scripts currently run under suexec which I know mod_perl 
can't do since you can't split up a single process like that, will that 
hiinder mod_perl from running?)

Which is just as [in]secure as /home/foo/bar.pl , 
/home/foo/stuff/baz.sh, /home/foo/public_html/luz.py, correct?

(Maybe more secure since 'nobody' has less privs than 'foo', correct?)
server.  It is not safe to run untrusted scripts under mod_perl.  (There
is all kinds of hand-waving about using Safe or something, but the only
thing I would trust is an entirely separate server running as an
unprivileged user.)
More info on configuration options is available here:
http://perl.apache.org/docs/1.0/guide/config.html
I'll definately take a look thanks!
If you want to just run .pl scripts under specific directories through
mod_perl, the docs there will tell you how (using a 
directive).
Oh, good idea! then I can limit it to cgi-bin and .mpl... h excellent :)
- Perrin 
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: mod_perl File Extension Configuration instead of a Path Configuration

2004-05-03 Thread JupiterHost.Net

Perrin Harkins wrote:
On Mon, 2004-05-03 at 17:24, JupiterHost.Net wrote:
So if I did it the .mpl way then /usr/foo/bar.mpl and /usr/foo/baz.mpl 
will run as nobody (IE untrusted user with less privileges)

If that's who your server runs as, then yes.  The "nobody" user has the
same privileges as any other user the systems I'm familiar with.  That
user typically has no login, but may have permission to write to certain
directories, etc.
cool, gotcha
(Regular .pl scripts currently run under suexec which I know mod_perl 
can't do since you can't split up a single process like that, will that 
hiinder mod_perl from running?)

I'm not sure what you're asking.  If you add something to your conf to
make all of your .pl scripts run through mod_perl, they won't run
through suexec anymore.  You would have to keep them as CGI for that to
work.  If you set it up to run some directories through CGI and some
through mod_perl, that will work fine.
That's it exactly :)
If .pl run as regular scripts under suexec they'll be run as 'foo' 
instead of 'nobody' but any mod_perl scripts will be run as 'nobody'
but neither will break the other...


Which is just as [in]secure as /home/foo/bar.pl , 
/home/foo/stuff/baz.sh, /home/foo/public_html/luz.py, correct?

Running them under mod_perl is less secure in the sense that anyone can
write a script that messes around with globals, redefines core perl
fuctions, etc. and messes up other people's scripts, since they are all
running in the same interpreter.  You really should not run untrusted
code under mod_perl without isolating it to its own apache server.
I see, perhaps I need to look into setting it up to run theri own 
mod_perl apache so they can shoot them self in the foot instead of others :)

(Maybe more secure since 'nobody' has less privs than 'foo', correct?)

Again, "nobody" is just another user.
- Perrin
Thanks for the great info!
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: mod_perl File Extension Configuration instead of a Path Configuration

2004-05-04 Thread JupiterHost.Net

DJ wrote:
I dont know if this has been answered, since i deleted my email but the 
answer is:


   SetHandler perl-script
   PerlHandler Your::Module

Thanks DJ!
I did get this earlier:
 PerlModule Apache::Registry
 AddHandler perl-script .mpl
 PerlHandler Apache::Registry
so incorporating the 2 it would be:
 
SetHandler perl-script
PerlHandler Apache::Registry
 
After mod_perl is built as a DSO in Apache?
Is either method more preferable?
I'd do either in the main config section or in an  
section?

TIA

--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Adding more locations to INC in startup.pl

2004-07-23 Thread JupiterHost.Net

David Arnold wrote:
All,
Is this OK?
# File: startup.pl
use lib qw(/home/darnold/modperl/);
use lib qw(/usr/local/apache/module/);
Sure but if you "use lib" twice all you need are single quotes instead 
of qw():

use lib '/home/blah/';
use lib '/usr/local/';
1;
but even better:
use lib qw(/home/blah /usr/local);
1;
HTH
Lee.M - JupiterHost.Net
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: APR::Base64 uses

2004-08-11 Thread JupiterHost.Net

This sounds really awesome. Thanks. just what we need.
Can one key decrypt the whole batch of cards?
I didn't look to close but I'm thinking "no" since it was randomly 
generated, and a single key for them all would again make it pointless 
to do anything with it because all they need now is one piece of data to 
see all the CC info. Instead of one per record.

Just my .02 ;p
Lee.M - JupiterHost.Net
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: APR::Base64 uses

2004-08-11 Thread JupiterHost.Net
You used paper?  Did someone break Google? :)
http://www.google.com/search?q=define%3Aencode
http://www.google.com/search?q=define%3Aencrypt

[snip]
stuff on the way to what i'm looking for.  Doing a web
search , i see a little on what i was looking for only
and a great deal of ads. 
You don't use google then do you?
;p probably msn or yahoo, or gulp AOL :)
google had ads but they are way more discreet and talk about relevant 
results, wow its awesome!

Anyway I can see the Dead Tree approach of course, the smell is nice :)
Lee.M - JupiterHost.Net
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: APR::Base64 uses

2004-08-11 Thread JupiterHost.Net
You don't use google then do you?
;p probably msn or yahoo, or gulp AOL :)
CMON, would Bart Simpson use anything but the Google?
Never used yahoo but MSN,AOL ??? That's insulting. EAt
my shorts man . LOL =)
HAHA good one :) !

google had ads but they are way more discreet and
talk about relevant 
results, wow its awesome!


Google is awesome. The ads i was refering to were ads
on webpages at google's results. IN the comparison i
was making Google results is book or TOC, Web page
correlates to Book page -- get it?? .  most web pages
have ads, Except modperls and other open source
projects which  is a good reason to be thankful for
developing with open source. Speaking of developing,
i'd better get back to work. ONe more thing below.
I see ;p
Anyway I can see the Dead Tree approach of course,
the smell is nice :)
Lee.M - JupiterHost.Net
Books have undeniable charms.  I'm still waiting for
the rubber laptop . I'm tired of waking up with sharp
jabbing in my gut.  

Later, lots of fun talking with you.
BTW: You say "Dead tree" instead of "Dead Hemp Plant"
only because the US Gov. effectively outlawed the most
industrious plant on the planet in 1937 in one of the
biggest conspiracies by Gov. and Corporations in
modern history.  see "Emperor Wears No Clothes" by
Jack Herer or email me off list if anyone has time to
discuss that topic. 
[homer]  hemp underwear [/homer]
Couldn' t have everyone rolling up their dictionaries and attending book 
burnings every week now could we :)

Ok, now back to Perl so its not 100% OT :
use Hemp;
while very usefull would definately be abused by the masses of hippy 
programmers hence why its not on cpan either :(

Ok, all finished with the fun! Thanks for the laugh bart
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Mentoring program software

2004-08-16 Thread JupiterHost.Net

Kevin Wu wrote:
Does anybody know and recommend any mentoring program software, 
especially using Perl/Mod_perl + Apache + Linux, with capability of 
processing 20 - 2000 connections.
Maybe if I knew what mentoring program software was...
:) I guess that means I can't sorry :)
 
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Hosting provider disallows mod_perl - "memory hog / unstable"

2004-08-29 Thread JupiterHost.Net

Martin RJ Cleaver wrote:
https://panel.dreamhost.com/kbase/index.cgi?area=2446 says:
"We do not support mod_perl on our shared hosting plans.
We're sorry about this; the problem is that mod-perl is just too 
much of a memory hog to attach to Apache (the web serving software), 
and it introduces a great deal of instability to our systems.
Err, do they have PHP? Its more of a memory/resource hog and is more 
unstable, assuming the same task and similar programming technique.
(I make this statement as someone who has to rebuild at least one apache 
per day due to PHP problems and troubleshoot resource useage issues that 
usually go down to a badly written PHP scripts)

So am I saying that PHP is worse than mod_perl, in *my* experience that 
is a huge YES, so if your host is that ignorant I'd find one that has a 
clue what they are talking about.

I'd go into more detail but I'm too busy using mod_perl and fixing PHP
;p
We are looking into ways to provide mod_perl in the future, but do 
not currently have a time line in place."
>
As I see it, Mod_perl provides two things: 1) speed and 2) 
functionality in terms of an operating environment.
PersistantPerl is nice to and can be used via apache or not
HTH :)
Lee.M - JupiterHost.Net
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Shopping Cart Software

2004-11-20 Thread JupiterHost.Net

A.T.Z. wrote:
I have had limited experience with one application -- 
'ShopSite'; it appears to be fairly complete and in the 
absence of any other input, I will probably end up purchasing 
that.  I am hoping, though, to elicit recommendations or 
comments from those that have experience with shopping cart 
software.  Any thoughts are appreciated.

If you don't mind using PHP:
I mind a lot :) Its a huge bloat of a hog and a pain to admin.
Use clickcartpro its Perl, its easy , and it rocks!
Plus you don't have the headache and worry if PHP will work or not.
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Keywords

2004-11-20 Thread JupiterHost.Net

Anthony Gardner wrote:
Can someone tell me why sex, sexy, suck and child 
hmmm, not 100% sure but:
 sex and sexxy describe perl and mod_perl in general :)
 suck might be there to describe other bloaty clunky wanna be's :)
 For instance say I'm looking for a solution and I type:
   "Why does PHP suck and mod_perl doesn't"
   "Does mod_perl suck?" (answer is NO BTW ;p)
  child perhaps for child processes?
 > http://perl.apache.org/docs/2.0/user/intro/start_fast.html
HTH :)
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Shop Cart Software

2004-11-30 Thread JupiterHost.Net
Hi,
Hello,
I want to thank you for your response to my
request for ideas about Shopping Cart Software
and apologize for taking so loon to respond--a 
mail server re-arrangement, that should have been
simple somehow went awry and has 
No worries :)
diverted my attention form Shopping Carts to
mail issues.  I have all but one lingering issue
resolved, so I will get back to Carts sometime.
Oh yeah, Interchange is also a nice robust Ecommerce server written in Perl.
I have not ever used php, but I so like and am
so comfortable with mod_perl that, since there 
appears to be a mod_perl/perl option, I
will definitely give it first priority.
You won't be sorry :) PHP sucks , that is from years of web development 
and server admining.

I sum it up like this:
 Perl has helped me make a living by helping me do my job easier and 
more effectively.

 PHP has helped me make a living because it takes so much time and 
effort to admin and support that its created job security for me ;p

I'm sure others would disagree, which is fine (their favorite band sucks 
if they disagree though ;p). Thats just my experience.

Thanks again for your input,
Thomas
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: OT: Free Software as a "Security Hole"

2005-01-12 Thread JupiterHost.Net

Goehring, Chuck, RCI - San Diego wrote:
I post here for lack of a better place.  Sorry in advance to anyone offended.
I was speaking to an acquaintance that has a security background and she told me her company prohibits the use of "Free" software because there is no guarantee that there are no "backdoors" in it.
She's probably talking about all the "free" wondows crap that does 
spyware and stuff.

Has anyone successfully dealt with this problem, or seen authoritative opinions on the subject?
Sure, don't use free programs that you don't have the source to.
If you use "Free" open source products then you can freely look at 
exactly what the program is doing and know if it doing any bad.

Besides that, dump windows - its not free but it's the bugiest most 
insecure computer product available.


Re: connection error

2005-02-26 Thread JupiterHost.Net
I have havy loaded site with 5 mln. hits per day. I use Apache and mod_perl
.
Every 15-20 minutes I see in error_log this error:
DBI connect('softsearch;mysql_socket=/tmp/softsearch.sock','softsearch',...)
failed: Access denied for user 'softsearch'@'localhost' (using password: NO)
at Engine.pm line 3086
The connection code:
3086my $dbh_ =
DBI->connect('DBI:mysql:softsearch;mysql_socket=/tmp/softsearch.sock','softs
earch','xxx');
How can I solve this problem?
Use privilege info that is valid :) Mayeb raise you max connection in 
you mysql conf

See mysql.com for "privileges" and "max connection"
Not really a Perl issue :)


Re: Which OS would you choose given a free choice

2005-04-15 Thread JupiterHost.Net

angie ahl wrote:
Hi guys
Hello,
I'm getting a new server and was planning on going with Fedora Core 3
and plesk. But it was just suggested that I maybe consider FreeBSD and
DA. Never even heard of DA (about to look it up) but being a Mac user
I must know a little about FreeBSD.
OSX mmm yum ;p never heard of DA (may be an indication to stay away ;p) 
Plesk is very difficult to admin and not very intuitive, that is why all 
of our users that had free trials of Plesk and cPanel went with cPanel 
except one guy who stopped doing his website altogether...

So if you had a free choice of OS and control panel what would you go
with and why.
I need speed, reliability and the perl I'm doing does max my CPU (it's
evil code). Security is of course an issue, Normal web master worries
really.
FreeBSD for security and reliability and cPanel for both reasons *and* 
its the industry leader with the most features and best support and ease 
of use. http://cpanel.net/ has a list of features for both the admin and 
user parts of it.

Just my .02 - HTH :)


Re: do is not working?

2005-04-26 Thread JupiterHost.Net

Octavian Rasnita wrote:
Hi,
Hello,
I have tried the following test script under mod_perl using
ModPerl::Registry handler:
use strict;
use warnings;
my $m = do "/usr/local/intranet/site/modules/markets.ini";
use Data::Dumper;
print Dumper $m;
The program prints "$VAR1 = undef;" if I run the program running mod_perl.
It prints fine the hash if I run it from command line.
The file "markets.ini" is:
{
'var1' => 'value1',
'var2' => 'value2',
'var3' => 'value3',
}
Do you have any idea what is wrong?
perldoc -f do
   If "do" cannot read the file, it returns undef and sets 
$! to
   the error.  If "do" can read the file but cannot compile 
it, it
   returns undef and sets an error message in [EMAIL PROTECTED]   If the 
file is
   successfully compiled, "do" returns the value of the last
   expression evaluated.

So I imagine its permissions vs. environment :)
Without error checking its hard to say, try what perldoc -f do says to 
do to get the status.


Re: mod_perl2 and PHP

2005-08-06 Thread JupiterHost.Net

Thomas Klausner wrote:

Hi!


Hello,


Is it possible and advisable to write the complex part of an application
(the Controller, if you like) in mod_perl2 and use PHP as a frontend (or
View) ?

While I personally prefere Template::Toolkit as a presentation language, the
project I'm currently getting involved in has quite a lot of PHP-people and
not that many (read: me) Perl people.


That is a bummer ;)


So what I thought is: use Perl to implement the rather complex business
logic, and PHP for rendering (and getting form input to the 'backend').


So Perl does all the real work while eveyone else see's PHP and thinks 
"wow look at how great PHP is"? boo for that!! :)



But: can I create a datastructure in Perl (in an ResponseHandler) and pass
it on to PHP running also as an ResponseHandler, but afterwards. Would I
need to stuff data in ENV? Can I pass complex data structures around? Do I
have to serialise (to yaml/xml) between Perl and PHP?


I think Storable may be able to be shared between Languages, maybe??
or
foo=bar
type file or xml but then you add another layer of complexity and 
overhead but if you have to you have to :)



Or is this a bad idea altogether and I should use a different approach (Like
forcing everyone to read the Badger)?


I'd do that personally :) They'll be better off in the end to have 
learned about Perl in addition to theri PHP skills.

PHP is cute and all but if it s all they do they'll remain stupid.


Re: mod_perl advocacy

2005-09-13 Thread JupiterHost.Net



Octavian Rasnita wrote:


Hmm, sorry. I was just trying to think to something that might make perl
more used than PHP.


- PHP is crap and a half to admin
- Its huge and clunky
- PHP based systems are more prone attack since PHP relies to much oin 
assumptions ("Oh its quoting it all for me, so I can do SQL and system 
commends without checking" so says the coder you mention below :))



The scope of advocacy is not to make perl better, but to make it be used by
more programmers, and most programmers are not super programmers which are
able to create an operating system, but just coders that like a language
which is easy to learn, use and maintain.

I don't know why some people are so angry when showing them that perl has
many disadvantages. If the disadvantages are shown, they can be seen and
fixed.


Another difference:
 "disadvantages" shown for any language can burn the ego a bit :)
realistically though PHP has waay more disadvnatages.

For instance if you try to secure your php.ini by dusabling functions, 
doing safe mode etc etc and you want PHP to run as the user so you use 
PHPSuExec like a good lad the evil user goes touch ~/public_html/php.ini


and *poof* your php.ini is overridden and they can turn off anything 
they like. This is not considered a bug but a feature!! Which makes sens 
because that allows the user to define custom settings like .htaccess 
does *but* you can override 100% anything and the documentation on how 
to limit it buried deep in some PHP luser's underwear.


PHP is cute and all but in a perfect world it'd be nonexistant. I'mnot 
just saying that Pelr is the best, use *anything* you like Python, Ruby, 
C, whatever just so its not PHP :)


When I look over job applications and I see PHP experience I immediatley 
 think "NEXT" because PHP's paradigm results in cluseless coders and 
clueless coders = bad security + lots of other things...


Re: TZ variable and mod_perl

2005-10-31 Thread JupiterHost.Net



Balázs Szabó (dLux) wrote:


Hi,


Hello,


I am the author of the Class::Date module, which can be found in CPAN,
and i had a complaint about timezone handling in perl.

I tried to debug it, and I have found that mod_perl uses the TZ
environment somehow differently.

What I did in my module is the following:

delete $ENV{TZ};
tzset();
($a, $b) = tzname();

$a should contain the local timezone (according to the documentation of



Oi! nor sure where to start,

1)
use strict;
use warnings;

2) don't use $a and $b
   - they are special
   - they are super ambiguouse

3) use good names so you and we know what you're smoking...

> delete $ENV{TZ};
> tzset();

POSIX POD:  "tzset() for setting the current timezone based on the 
environment variable TZ"


If you just deleted it how can it use it?

> ($a, $b) = tzname();

my($standard_timezone, $summer_timezone) = tzname();


the tzset manual), although it is UTC always. What I suspect is that
when I delete the TZ variable from the environment, it does not really
delete it.

How I can make sure that this variable is deleted?


if(defined $ENV{TZ}) {
print "TZ: $ENV{TZ}\n";
}
else {
print "TZ is not defined in my ENV\n";
}

maybe check the system's with `printenv`...


Do you know any other way to get the timezone which is guessed by
tzset() in case of the TZ environment variable does not work?


`man tzset` says:

 If TZ does not appear in the environment, the best available 
approxima-
 tion to local wall clock time, as specified by the 
tzfile(5)-format file

 /etc/localtime is used.

 If TZ appears in the environment but its value is a null string, 
Coordi-

 nated Universal Time (UTC) is used (without leap second correction).

 If TZ appears in the environment and its value begins with a colon 
(`:'),

 the rest of its value is used as a pathname of a tzfile(5)-format file
 from which to read the time conversion information.  If the first 
charac-
 ter of the pathname is a slash (`/') it is used as an absolute 
pathname;
 otherwise, it is used as a pathname relative to the system time 
conver-

 sion information directory.

 If its value does not begin with a colon, it is first used as the 
path-
 name of a file (as described above) from which to read the time 
conver-
 sion information.  If that file cannot be read, the value is then 
inter-
 preted as a direct specification (the format is described below) 
of the

 time conversion information.

 If the TZ environment variable does not specify a tzfile(5)-format 
file

 and cannot be interpreted as a direct specification, UTC is used.


Re: mailing list does NOT work

2005-12-23 Thread JupiterHost.Net



Gordon Stewart wrote:

List

TO WHO IT MAY CONCERN

GET ME OFF THIS LIST

Gordon



Gordon,

Please use a little common sense about discussion lists and look at your 
"list-unsubscribe" header: , 
instead of spamming all the members yelling about getting off the list.


Re: mailing list does NOT work

2005-12-28 Thread JupiterHost.Net



steve larson wrote:

List

TO WHO IT MAY CONCERN

GET ME OFF THIS LIST

[EMAIL PROTECTED]



Steve,

Please use a little common sense about discussion lists and look at your 
"list-unsubscribe" header: , 
instead of spamming all the members yelling about getting off the list.



PS List - I sent this to "Gordon" earlier, I think its a phisherman :) 
No two people could be this dumb and type the exact same text with in a 
day or so of each other.




Re: mailing list does NOT work

2005-12-28 Thread JupiterHost.Net



Formhandle wrote:

I don't know who that guy is but did you know the mailing list 
unsubscribe feature does not actually work?


It's a bit frustrating trying to get off the mailing list.  So when the 
unsubscribe feature is broken, and the only thing the list members can 
do is point to procedured which are broken, it gets to be frustrating.  
Nobody providing the canned responses of "here are the unsubscribe 
features" have bothered to check whether those features are actually 
working or not.  They are not.




I see. In that case, since most people don't want to test the 
unsubscribe mechanism for someone assumedly too dumb or lazy to try it, 
they should specify what the problem:


"I've tried emailing [EMAIL PROTECTED] from [EMAIL PROTECTED] and get the 
confirmation that its unsubscribed but am still getting list emails at 
[EMAIL PROTECTED] Is there another way to get unsubscribed or can the 
moderators assist me"


intead of an ignorant sounding SCREAMING pointless rant spam to all the 
subscribers who have no control over their ignorance and can't read 
theri mind that the mechanism has been tried and its failed and can only 
suggest a course of action based on common sense.


Still, I beleive its moot in this case since the same email was sent by 
two "people". IE its a phishing mail and not a real request.



JupiterHost.Net wrote:



steve larson wrote:


List

TO WHO IT MAY CONCERN

GET ME OFF THIS LIST

[EMAIL PROTECTED]





Steve,

Please use a little common sense about discussion lists and look at 
your "list-unsubscribe" header: 
<mailto:[EMAIL PROTECTED]>, instead of spamming all 
the members yelling about getting off the list.


PS List - I sent this to "Gordon" earlier, I think its a phisherman :) 
No two people could be this dumb and type the exact same text with in 
a day or so of each other.









Re: mailing list does NOT work

2005-12-30 Thread JupiterHost.Net


BUT i don't see how its phishing.  


I suspected it because its literally the exact same text but two 
completely different addresses and names.


You can scrape all the addresses to this list off the web 


true enough


or by just subscribing.


Exactly :) Any posts, and especially replies are logged as valid 
addresses, perhaps.


Otherwise the odds that two people, just a day or so apart, are that 
dumb and lazy *and* would choose exactly the same text (verbage *and* 
capitolization no less) are astonomical.




Re: Long Running Process - make it a daemon?

2006-01-10 Thread JupiterHost.Net

Hello,


our CMS create sometimes long runnig tasks. This Tasks we start with the
following code:

`/usr/bin/perl  -e 'use Modul; Modul->function($arg);' > /dev/null &`;

This works. Apache returns the html-page and the long running function
goes into the background. But if we restart Apache all childs and our
long running function was killed :-(

Could i daemonize the long running process to be sure that he wasn't
killed by a apache restart? Maybe with Proc::Daemon.

Is the a good solution or somebody knows a better way to do it?



use Acme::Spork;

my $spork_pid = spork(\&long_running_proc, @args) or die "could not fork 
for spork: $!";


Its "Acme" but its hardcore awesome and useful. (could prolly be in 
Proc:: with a more "professional" name, but "Spork" is pretty much a fun 
name (but fitting no?) which is why its in Acme)


I've never used it in mod_perl but I imagine it should work just fine 
including the children :)


It also has daemonize funtion that is a shortcut for Proc::Daemon's Init 
if you truly want to daemonize the script at that point, but it doesn't 
sound like that is what you want.


HTH :)


Re: Problems with PerlRun

2006-01-30 Thread JupiterHost.Net



Patrick Kennedy wrote:

With PerlRun, after the script has run the name space is supposed
to be flushed of all variables and subroutines. Right? This doesn't seem
to be happening with my setup. I'm getting incorrect output, based on
previous executions of the script. Here's a simple example:

#!/usr/bin/perl -w

>

use strict;
use CGI;
my $query = new CGI;



my $x = $query->param('x') || '0';
print "Content-type: text/html\n\n";


Why not $query->header(); since you've already got CGI and a CGI object?

Its probably an old CGI module. I'm basing that on several things:

a) "new CGI" is old
b) -w is "old" sort of (use warnings)
c) bad naming conventions is old ($query ? is this sql ? no its cgi so 
call it $cgi ;p you'll thank yourself later)

d) the header thing mentioned above
e) the behavior of the script with the random values


#!/usr/bin/perl

use strict;
use warnings;

use CGI;

my $cgi = CGI->new();
print $cgi->header();

print "CGI VERSION: $CGI::VERSION\n";

for($cgi->param('x')) {
   print "x is $_\n";
}

Make sure the version it has it the latest on CPAN and upgrade if needed 
and try it again :)


HTH


Re: Problems with PerlRun

2006-01-31 Thread JupiterHost.Net



Frank Wiles wrote:


On Mon, 30 Jan 2006 18:32:13 -0600
"JupiterHost.Net" <[EMAIL PROTECTED]> wrote:



a) "new CGI" is old



  FYI... 


  Just downloaded the latest CGI.pm and the docs still show using
  this syntax, as much as I agree it should always be CGI->new(); 


The docs are old and need updated, but the fact still remains:

 If it looks like Perl 4 and works like Perl 4 its prolly from Perl 4 
(pronounced "at least needs to be checked since it may indicate the 
problem")


new Whatever;

will work but its highly recommended for various reason to do 
Whatever->new() so when I see new Whatever:


 a) the code is old old old
 b) the author used an old example without knowing its better to do 
Whatever->new()


Re: Problems with PerlRun

2006-01-31 Thread JupiterHost.Net
Can someone point me at docs as to why that's better? I've seen both used and 
didn't know one was considered better than the other.


new CGI; is ambiguouse (did you mean to call the function new() in the 
main:: name space with the expression (function? constant? bareword? 
handle?) "CGI"?


CGI->new() is clearly a method call to CGI's new() method.

in this case it may be pretty obvious *but* an object construtor method 
does not have to be named "new" and in such a case:



birdhouse SOUL {
'size'  => 'little',
'whose' => 'your',
};

is much more difficult to tell whats going on than:

SOUL->birdhouse({
'size'  => 'little',
'whose' => 'your',
});

Its immediately obviouse without any muss or fuss that its a call to 
"make a little birdhouse in your soul" :)


Its documented in `perldoc perlstyle` I beleive (no time to check right 
now) and also see Damian Conway's "Perl Best Practices" if you really 
want to start doing stuff right ;p


HTH :)


Re: RegEx Hell

2006-01-31 Thread JupiterHost.Net


so cool.  I'm using Brian Ingerson's IO:ALL to slurp some files 


May want to look at File::Slurp also, its highly efficient, may help :)



Sanity check, mod_perl 2.0 works on Apache 2.2.0 right?

2006-02-07 Thread JupiterHost.Net
Didn't see this anywhere for sure and just wanted to verify before I 
started a project:


 mod_perl 2.0 works on Apache 2.2.0 (IE the next step up from 2.0) correct?

TIA!


Re: Sanity check, mod_perl 2.0 works on Apache 2.2.0 right?

2006-02-07 Thread JupiterHost.Net



[EMAIL PROTECTED] wrote:


JupiterHost.Net wrote:

Didn't see this anywhere for sure and just wanted to verify before I 
started a project:


 mod_perl 2.0 works on Apache 2.2.0 (IE the next step up from 2.0) 
correct?


TIA!


Hi There ,

Yes it does !

KEv


Thanks Kev :)


mod_perl 2 newbie

2006-02-07 Thread JupiterHost.Net

Hello List!

I'd like to build mod_perl/2.0.2 statically built into apache as per:

http://perl.apache.org/docs/2.0/user/install/install.html#Static_mod_perl

However instead of making apache2 as part of mod_perl2 I'd like to
 1) configure/make/etc mod_perl 2
 2) add other modules
 3) build apache 2 with configure options as dictated by steps 1 and 2

Much like we can do with apache 1 by:

 1) perl Makefile.PL APACHE_SRC=apache/src DO_HTTPD=1 NO_HTTPD=1 
USE_APACI=1 PREP_HTTPD=1 EVERYTHING=1

 make
 make test
 make install

 2) add other modules

 3) do configure as needed from step 2 and with 
'--activate-module=src/modules/perl/libperl.a' for step 1


Is this possible? I didn't see any documentation for this route or 
configure options like 1's "[NO|DO|PREP]_HTTPD"


Any insight woudl be excellent!


Re: mod_perl 2 newbie

2006-02-07 Thread JupiterHost.Net



Jonathan Vanasco wrote:



There's no point to build MP2 into apache

there's barely any difference in performance between the static and  
module versions


most people i know just run the module version - its far easier to  set 
up , and you don't have to rebuild everything on every new release


Thanks for the info Jonathon,

I can do these without error after making apache 2:

 perl Makefile.PL MP_APXS=/usr/local/apache2/bin/apxs
 make
 make test
 make install

However neither of these commands (the first is obvious because its not 
static ;p but I figured I'd check)

 /usr/local/apache2/bin/httpd -l |grep -i perl
and
 grep -i perl /usr/local/apache2/conf/httpd.conf
have no output.

So how do I tell if mod_perl 2 is compiled into apache 2?


Re: mod_perl 2 newbie

2006-02-08 Thread JupiterHost.Net



John ORourke wrote:

I don't know about a manual build but some installs put the perl stuff 
in file(s) in /usr/local/apache2/conf.d/, so it may not be mentioned in 
httpd.conf.


Thanks John for the info, that doesn't appear to be it but I'm still 
looking to see if it was added in a different location like you suggest 
it may have been :)


Re: mod_perl 2 newbie

2006-02-08 Thread JupiterHost.Net

Diona Kidd wrote:

> I believe that the command you shared will build MP2 as a module by
> default and you will see mod_perl.so in the modules directory. Then just


Sure enough /usr/local/apache2/moduels/mod_perl.so is there

I'm still stuck on apache one's setup Thanks Diona!

> add the LoadModule line to httpd.conf...

It'd be nice to have that added when its built, is that possible? I 
didn't see an option to do that (like apxs's -a/-A)


Re: mod_perl 2 newbie

2006-02-08 Thread JupiterHost.Net

This is what I do to build it:

In apache src dir:

./configure \
--prefix="/usr/local/apache_2.0.54+mod_perl"  \
--enable-so \
--enable-proxy \
--enable-ssl \
--enable-proxy-http \
--with-mpm=prefork \
--enable-modules=most \
--enable-mods-shared=max

make install

In mod_perl src dir:

perl Makefile.PL MP_DEBUG=1 MP_USE_DSO=1 
MP_APXS=/usr/local/apache_2.0.54+mod_perl/bin/apxs MP_TRACE=1
make install


It works for me.


Thanks Jie for your info,

Does that also add the httpd.conf entry to load the .so or do you do 
that manually?


I'll try MP_USE_DSO to make it explicit and perhaps it will add the 
httpd.conf goods (I found it *was* making the .so just not adding it to 
httpd.conf)


Thanks again!


Re: mod_perl 2 newbie

2006-02-08 Thread JupiterHost.Net



JupiterHost.Net wrote:


Diona Kidd wrote:

 > I believe that the command you shared will build MP2 as a module by
 > default and you will see mod_perl.so in the modules directory. Then just


Sure enough /usr/local/apache2/moduels/mod_perl.so is there

I'm still stuck on apache one's setup Thanks Diona!

 > add the LoadModule line to httpd.conf...

It'd be nice to have that added when its built, is that possible? I 
didn't see an option to do that (like apxs's -a/-A)


For anyone watching from home :)

Still didn't find a way to do it with configure so I just:

apache2/bin/apxs -e -a -n perl apache2/modules/mod_perl.so

Thansk again for everyone's input, much appreciated!


Re: mod_perl 2 newbie

2006-02-08 Thread JupiterHost.Net



Tom Schindl wrote:


May I suggest reading SIMPLY the INSTALL-File coming with mod-perl where
it reads:


Thanks, I did look at those, what I was looking for was a configure 
option to add those for you without having to do the LoadModule manually 
or via a apache2/bin/apxs command.


Mod_perl 1 had such an option but apparently mod_perl 2 does not so I 
just resigned to having to run apxs after the configure/make dance





Re: Database transaction across multiple web requests

2006-03-31 Thread JupiterHost.Net



Tomas Zerolo wrote:

Howdy,


Howdy to you :)


this is not strictly a modperl question, but I'm sure some of you are
downright experts on this.

We have a modperl2 applicattion with a database backend (PostgreSQL,
DBI). For session management we use Apache::Session.

Now the need has arisen to serve requests yielding many records as
answers -- so the user wants to page through them, a bunch at a time,
search-engine style.



use Data::Paginate;

As far as the queries go you have basically two choices:

a) If the connection is persistent and you can pass a hash around then 
do the query once, store the data in the hash keyed on the session.


The problem here is your memory (and possible security) issues would 
seem to overwhelm the "one query" only benefits. (plus your initial 
query page would have one huge result set to manage so itd take alonger)


b) Is to do it like the Example in Data::Paginate's POD:

 Initially you do one simple count query. That is used to build your 
pagination object and then each request does a LIMITed SELECT on the 
current pages's records.


Its quite fast and efficient and easy to code and maintain, we use it 
all the time (essencially pasting in the example code). *And* if your DB 
connection is persistent its even zippier :)


HTH


Re: Mail::POP3Client and pdf decode

2006-04-06 Thread JupiterHost.Net



Charlie Smith wrote:

I'm trying to decode an email that was pop'd. After writing
the body to a disk file using the perl Mail::POP3Client routine
$pop->BodyToFile( $fh, 1);

It looks all like text. So, I run following command to translate


by "it looks all like text" do you mean its "like words" or "an ascii 
armoured" string?



body of mime message back to pdf for reading.
perl -MMIME::Base64 -ne 'print decode_base64($_)' test.pdf



test.txt is base64 encoded verison correct?

does it have anytyhing in it that is not part of the encoding?

If so then you're decoding that line and putting it in the pdf file

After making sure test.txt is clean:

perl -mstrict -MFile::Slurp -MMIME::Base64 -we 'my $b64 = 
read_file("test.txt");write_file("test.pdf", decode_base64($b64));'


It cortaks if one of them fail so you're all set AFA error checking...

No error messages, but file size is different from original file poped 


Yes, the base 64 encoded verison will be a differtent size than the guts 
that were encoded...


from email attachment. When pdf file is brought up in browser, there 
is no data.


- Is the decoded version 0 in size?
- are you outputting a header to tell the browser its a PDF?
- any errors in screen, logs, etc

Example code and url's to the symptoms would be extrememly handy to 
diagnose the problem, no?


Re: clusters

2006-05-09 Thread JupiterHost.Net



E.Q. McGoon wrote:

Perrin Harkins wrote:




Tons of them.  Practically any doc about clustering will apply.  I
wrote one ages ago about one mod_perl site I worked at:
http://perl.apache.org/docs/tutorials/apps/scale_etoys/etoys.html

Is there some specific part you're having trouble getting your head
around?



Can you elaborate further on your session management strategy in the


have you looked at CGI::Session or Apache::Session ??


Re: Protecting source code

2006-08-23 Thread JupiterHost.Net

> I am writting web application for mod_perl which will be installed
> on client's server. Application is almost finished and now I am
> wondering which is the best way to protect source code.
>
> Already checked Module::Crypt but cound't get it to work. It
> doesn't create any output file. I came a cross with schroud+ perl
> obfuscator which looks ok, but I would like protect strings too. By
> strings I meen text that is hardcoded in source and it is printed
> to web application user. Do you have any experiences with other
> obfuscators or converters to XS code?
>
> Any information is welcome.



Legal protection is the best way. Other than that see Acme::Enc its 
pretty sexxy


Re: Anyone using CGI::Simple?

2007-01-16 Thread JupiterHost.Net



Randal L. Schwartz wrote:


"Andy" == Andy Armstrong <[EMAIL PROTECTED]> writes:




Has anyone heard from James Freeman, the maintainer of CGI::Simple
(http://search.cpan.org/dist/Cgi-Simple/)?  It's not been updated in a
couple of years, the outstanding bugs appear to mostly be related to
the same issue, and I tried emailing him about this using the contact
email he provided at http://www.perlmonks.org/?node=tachyon.



Why would anyone use this instead of CGI.pm?


I like it because:
 - uploads are handled more intuitively IMHO
 - no HTML stuff (although CGI's HTML methods are pretty slick)
 - no function/method oddness

Not sure about its mod_perl issues, I use it mostly under persistent 
perl as anormal CGI...


Re: Anyone using CGI::Simple?

2007-01-16 Thread JupiterHost.Net

Why would anyone use this instead of CGI.pm?



I like it because:
 - uploads are handled more intuitively IMHO
 - no HTML stuff (although CGI's HTML methods are pretty slick)
 - no function/method oddness

Not sure about its mod_perl issues, I use it mostly under  persistent 
perl as anormal CGI...



Splendid. Well the first release I've made is on CPAN now and I'm  going 
to keep working on it to resolve the outstanding bugs and  generally 
clean the code up.


Nice, looks like we're in good hands :) Thanks Andy