Re: Can't build Apache::Dispatch on Windows / Perl 5.8.0

2003-09-12 Thread Thomas Klausner
Hi!

On Thu, Sep 11, 2003 at 10:24:20PM -0500, Randy Kobes wrote:

 Here's a patch against the Apache-Dispatch Makefile.PL to
 allow it to build on Win32 - I've also put up a ppm package

Oh, great! Thanks Randy! I'll put this into the next release, which should
happen in a few days...

-- 
#!/usr/bin/perl   http://domm.zsi.at
for(ref bless{},just'another'perl'hacker){s-:+-$-gprint$_.$/}


Re: Can't build Apache::Dispatch on Windows / Perl 5.8.0

2003-09-11 Thread Thomas Klausner
Hi!

On Thu, Sep 11, 2003 at 08:33:31AM +0100, Steve Hay wrote:

 I posted this problem the other day, deep inside a thread about 
 something else, and didn't get any replies; maybe nobody spotted it?
 
 Does anybody have Apache::Dispatch working on Windows with Perl 5.8.0?   
 Randy?

Randy posted this some time ago:

 I just made one up, which you can install as
 C:\ ppm install
 http://theoryx5.uwinnipeg.ca/ppmpackages/Apache-Dispatch.ppd

Maybe this works for you?

See:
http://www.gossamer-threads.com/archive/mod_perl_C1/modperl_F7/Looking_for_Apache::Dispatch_PPD_P73122/


-- 
#!/usr/bin/perl   http://domm.zsi.at
for(ref bless{},just'another'perl'hacker){s-:+-$-gprint$_.$/}


Re: Can't build Apache::Dispatch on Windows / Perl 5.8.0

2003-09-11 Thread Thomas Klausner
Hi!

On Thu, Sep 11, 2003 at 08:59:23AM +0100, Steve Hay wrote:

 I would rather be able to build the module myself anyway, rather than 
 using a PPM package.

I guess (and Geoffrey (who BTW transfered maintainership of Apache::Dispatch
to me..) suggested something) the problem lies within the custom configuration
directives used by Apache::Dispatch.

I'm planning to make these optional in the next release of Apache::Dispatch,
so you could either use
  DispatchPrefix Bar
(which needs compiling)
or 
  PerlSetVar DispatchPrefix Bar
(which doesn't need compiling and should thus make installation easier)

 BTW, do other people have it working under Perl 5.8.0 on other 
 platforms?  I'm not sure if this problem is Windows-related or 
 5.8.0-related.

There is one FAIL reported on:
http://testers.cpan.org/show/Apache-Dispatch.html

I complied it without problem on Linux Perl 5.8.0 and 5.6.1.



-- 
#!/usr/bin/perl   http://domm.zsi.at
for(ref bless{},just'another'perl'hacker){s-:+-$-gprint$_.$/}


Re: Help wanted with locations / configuration

2003-09-09 Thread Thomas Klausner
Hi!

On Tue, Sep 09, 2003 at 10:05:43AM +0100, Steve Hay wrote:

 Location /myproject/css
   SetHandler default
 /Location
 Location /myproject/img
   SetHandler default
 /Location
 
 This is working as expected, i.e. request for /css/foo.css or /img/bar.png
 are not handled by Apache::Dispatch
  
 
 What about requests for /css or /img ?  Are they handled by 
 Apache::Dispatch?  The problem I found with my LocationMatch override is 
 that requests for files were caught, but requests for directories 
 slipped through to the Perl handler.

Unfourtunatly, request for /css are handled by Apache::Dispatch. At least it
seems so, but I'm enterly sure if it's the actual request that's beeing
served, or an internal redirect (or some other funky Apache internal thing,
like ErrorDocument or index generation)

It does seem like a feature/problem of Apache. I tried various config
options (and modifications to Apache::Dispatch), but no matter what I did,
request for /img/ allways get passed to PerHandler instead of default
handler

Request for anything inside /img/ work as expected.

No, wait a minute...

If I request /foo/bar/ (another dir) than it doesn't work either.

I still do not know if this a bug in
Apache / mod_perl / Apache::Dispatch / YourHandler, and/or internal redirect.
Or if this is expected behaviour.

-- 
#!/usr/bin/perl   http://domm.zsi.at
for(ref bless{},just'another'perl'hacker){s-:+-$-gprint$_.$/}


Re: Help wanted with locations / configuration

2003-09-08 Thread Thomas Klausner
Hi!

On Mon, Sep 08, 2003 at 04:51:55PM +0100, Steve Hay wrote:

 The project is going to be written as a series of mod_perl handlers - 
 one for the main home page, and others for various sub-components.  
 Each handler is implemented by a separate module (all sub-classes of a 
 common base class).  I don't want to have to configure a separate 
 Location for each sub-component.

You might want to take a look at Apache::Dispatch, which does exactly this.

 Location /myproject
SetHandler perl-script
PerlHandler MyProject-dispatcher
 /Location
 
 LocationMatch ^/myproject/(images|javascript|stylesheets)
SetHandler default-handler
 /LocationMatch

I'm using something like this with Apache::Dispatch

PerlModule Apache::Dispatch
DispatchUpperCase On   # this is /not/ in Apache::Dispatch, 
   # only in my patched version
DispatchPrefix Oe1
DispatchExtras Error

Location /myproject
   SetHandler perl-script
   PerlHandler Apache::Dispatch
/Location
   
Location /myproject/css
   SetHandler default
/Location
Location /myproject/img
   SetHandler default
/Location

This is working as expected, i.e. request for /css/foo.css or /img/bar.png
are not handled by Apache::Dispatch



-- 
#!/usr/bin/perl   http://domm.zsi.at
for(ref bless{},just'another'perl'hacker){s-:+-$-gprint$_.$/}


Re: Ticket/cookie based authentication for mod_perl and static frontend

2003-08-26 Thread Thomas Klausner
Hi!

On Die, Aug 26, 2003 at 09:06:05 +1000, Charlie Garrison wrote:

 I need to protect resources in both the static (proxy) front-end and the
 mod_perl back-end. I have been using standard http authentication which works
 pretty well except for not allowing a proper logout function and some caching
 issues which result in occasional false FORBIDDEN responses. Since a proper
 logout has become an important requirement, I am looking for other solutions.

Did you take a look at Apache::AuthCookie?
  http://search.cpan.org/author/MSCHOUT/Apache-AuthCookie-3.04/

 Since I need the user credentials in the mod_perl app, I'm not happy to leave
 all authentication to the front-end proxy server unless it sets the user
 credentials (or some other values) before passing along the request.

As AuthCookie is a mod_perl handler, you would have to put the
Authentification into the backend. Depending on how you generate the session
key (i.e. the value of the Auth Cookie), you should be able to use the
cookie in the frontend using one of the modules you mentioned (although I
don't know any of them..)


-- 
#!/usr/bin/perl   http://domm.zsi.at
for(ref bless{},just'another'perl'hacker){s-:+-$-gprint$_.$/}


-- 
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html



Re: Coding Style Question - Using exit

2003-08-19 Thread Thomas Klausner
Hi!

On Mon, Aug 18, 2003 at 08:07:30 -0400, Chris Faust wrote:

 Example To Help Explain:
 
 sub handler {
  $r = shift;
 
 init_global_vals();
 
 $back_url = determine_proper_action();
 
 my $back_url = ;
 $r-headers_out-set(Location = $back_url);

 return Apache::REDIRECT;
 }

Why not let determine_proper_action() return undef (or OK, or whatever) if
you do not want to redirect? And in your handler do:

  my $rv=determine_proper_action();
  if ($rv) {  # or ($rv == Apache::Constants::OK)
 # redirect
  } else 
# done
  }

One problem I can see is if you're exiting somewhere deep in a nested sub
and you cannot propagate the return value back to the handler (easily).


-- 
#!/usr/bin/perl   http://domm.zsi.at
for(ref bless{},just'another'perl'hacker){s-:+-$-gprint$_.$/}


-- 
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html



Re: Mod_perl how to include the result of mod_autoindex?

2003-08-14 Thread Thomas Klausner
Hi!

On Mon, Aug 11, 2003 at 04:37:45 -0500, Slava Bizyayev wrote:
 It's not quite the truth...
 You can do all that staff on Apache 1.3 with appropriate skills. See LWP
 for example.

If you mean to grab the output of e.g. mod_autoindex by issueing a sperate
request using LWP, that's definitly possible. But I would classify this as a
hack and not as a proper way to implement a feature.

Or /is/ there a clean way to properly filter output from different response
handlers with Apache 1.3? I'd realy like to hear about it...

-- 
#!/usr/bin/perl   http://domm.zsi.at
for(ref bless{},just'another'perl'hacker){s-:+-$-gprint$_.$/}


Re: Mod_perl how to include the result of mod_autoindex?

2003-08-11 Thread Thomas Klausner
Hi!

On Mon, Aug 11, 2003 at 08:37:19AM -0700, Coexec wrote:
 I am writing a mod_perl script using CGI.pm and Apache
 1.3.28/Linux.
 
 I am trying to figure out how to use Apache's
 mod_autoindex to display a directories contents within
 the output the CGI.  Apache is configured correctly, I
 am not asking for Apache help.

This is not possible using Apache 1.3. What you want to do is called
filtering and is available with Apache/mod_perl 2.0.

http://perl.apache.org/docs/2.0/user/intro/overview.html#Integration_with_2_0_Filtering

With Apache 1.3, you cannot (e.g.) generate content with mod_perl that
includes Server-Side-Include directives.  You also cannot get the content of
mod_autoindex and further process this content using something.

What does work is to use only mod_perl, as suggested by Christopher Grau

-- 
#!/usr/bin/perl   http://domm.zsi.at
for(ref bless{},just'another'perl'hacker){s-:+-$-gprint$_.$/}


Problems installing mp1 and apache-1.3.28

2003-07-30 Thread Thomas Schindl
Hi,

I've a strange problem I've never encountered before when compiling my
own apache.

I simply run:
  1) in mod_perl-1.28:
 /opt/perl/bin/perl Makefile.PL DO_HTTPD=1 USE_APACI=1 APACHE_PREFIX=/opt/apache
 make
 make test
 make install
  2) If I know try to start my apache with a startup-file like this:
 8
 #!/opt/perl/bin/perl
 use Apache::Log;
 8
 I get this error-message:
 8
 ../bin/apachectl start
[Wed Jul 30 14:18:43 2003] [error] Can't locate loadable object for module Apache::Log 
in @INC (@INC contains: /opt/perl/lib/5.8.0/i686-linux /opt/perl/lib/5.8.0 
/opt/perl/lib/site_perl/5.8.0/i686-linux /opt/perl/lib/site_perl/5.8.0 
/opt/perl/lib/site_perl . /opt/apache/ /opt/apache/lib/perl) at 
/opt/perl/lib/site_perl/5.8.0/i686-linux/mod_perl.pm line 14
Compilation failed in require at /opt/apache//conf/startup.pl line 3.
BEGIN failed--compilation aborted at /opt/apache//conf/startup.pl line 3.
Compilation failed in require at (eval 2) line 1.
 
Syntax error on line 981 of /opt/apache/conf/httpd.conf:
Can't locate loadable object for module Apache::Log in @INC (@INC contains: 
/opt/perl/lib/5.8.0/i686-linux /opt/perl/lib/5.8.0 
/opt/perl/lib/site_perl/5.8.0/i686-linux /opt/perl/lib/site_perl/5.8.0 
/opt/perl/lib/site_perl . /opt/apache/ /opt/apache/lib/perl) at 
/opt/perl/lib/site_perl/5.8.0/i686-linux/mod_perl.pm line 14
Compilation failed in require at /opt/apache//conf/startup.pl line 3.
BEGIN failed--compilation aborted at /opt/apache//conf/startup.pl line 3.
Compilation failed in require at (eval 2) line 1.
 
../bin/apachectl start: httpd could not be started
 8

What's going on here? Any ideas.

Tom



Re: Problems installing mp1 and apache-1.3.28

2003-07-30 Thread Thomas Schindl
Oh found it my self. I forgot to add EVERYTHING=1 to perl-Makefile call
because i simply copied it from INSTALL.simple where this is not
mentionned.

tom

On Wed, 2003-07-30 at 14:20, Thomas Schindl wrote:
 Hi,
 
 I've a strange problem I've never encountered before when compiling my
 own apache.
 
 I simply run:
   1) in mod_perl-1.28:
  /opt/perl/bin/perl Makefile.PL DO_HTTPD=1 USE_APACI=1 APACHE_PREFIX=/opt/apache
  make
  make test
  make install
   2) If I know try to start my apache with a startup-file like this:
  8
  #!/opt/perl/bin/perl
  use Apache::Log;
  8
  I get this error-message:
  8
  ../bin/apachectl start
 [Wed Jul 30 14:18:43 2003] [error] Can't locate loadable object for module 
 Apache::Log in @INC (@INC contains: /opt/perl/lib/5.8.0/i686-linux 
 /opt/perl/lib/5.8.0 /opt/perl/lib/site_perl/5.8.0/i686-linux 
 /opt/perl/lib/site_perl/5.8.0 /opt/perl/lib/site_perl . /opt/apache/ 
 /opt/apache/lib/perl) at /opt/perl/lib/site_perl/5.8.0/i686-linux/mod_perl.pm line 14
 Compilation failed in require at /opt/apache//conf/startup.pl line 3.
 BEGIN failed--compilation aborted at /opt/apache//conf/startup.pl line 3.
 Compilation failed in require at (eval 2) line 1.
  
 Syntax error on line 981 of /opt/apache/conf/httpd.conf:
 Can't locate loadable object for module Apache::Log in @INC (@INC contains: 
 /opt/perl/lib/5.8.0/i686-linux /opt/perl/lib/5.8.0 
 /opt/perl/lib/site_perl/5.8.0/i686-linux /opt/perl/lib/site_perl/5.8.0 
 /opt/perl/lib/site_perl . /opt/apache/ /opt/apache/lib/perl) at 
 /opt/perl/lib/site_perl/5.8.0/i686-linux/mod_perl.pm line 14
 Compilation failed in require at /opt/apache//conf/startup.pl line 3.
 BEGIN failed--compilation aborted at /opt/apache//conf/startup.pl line 3.
 Compilation failed in require at (eval 2) line 1.
  
 ../bin/apachectl start: httpd could not be started
  8
 
 What's going on here? Any ideas.
 
 Tom
 



Re: [QUESTION] Can't read out verified username (auth)

2003-07-21 Thread Thomas Klausner
Hi!

On Mon, Jul 21, 2003 at 12:36:55 +0200, Fatih Gey wrote:
 I supposed the browser to resend always an unique bowser session id, which
 is used by apache to save certain values, like $ENV{'REMOTE_USER'}
 (similiar to a session-cookie with uid and serverbased $vars) .. 
 Isn't this the way Basic Authentication scheme works ? .. 

I do not know how much Auth stuff changed in Apache 2.0/mod_perl 2, but you
seem to mix up checking user credentials in the response phase (as done in
CGI or PHP) with writing you own Auth Handlers that replace the standard
Apache ones.

If you get the user credentials via a web form, you are usually NOT using
BASIC Auth but your own scheme (or something like Apache::AuthCookie). Thus,
$r-connection-user is not set.

Take a look at:
* Chapter 6 of the Eagel book, available online at:
  http://modperl.com:9000/book/chapters/ch6.html
  
* Chapter 13.7 of the mod_perl Cookbook

* Apache::AuthCookie

At least that's how it works with mod_perl 1.x ...

-- 
#!/usr/bin/perl   http://domm.zsi.at
for(ref bless{},just'another'perl'hacker){s-:+-$-gprint$_.$/}


Re: How do I have a PerlAuthenHandler not popup the login box?

2003-07-18 Thread Thomas Klausner
Hi!

On Thu, Jul 17, 2003 at 06:07:48PM -0700, Jason Fong wrote:
 I'm making a login system that uses a web form instead of the browser's
 popup box to input the username/password.  My problem is that when I use
 my authentication script as a PerlAuthenHandler in the .htaccess, it
 insists on having the browser show the popup username/password box.  I
 tried making a simple handler function that just returns OK, but I still
 get the login box.

This the way BASIC Authentication works. To solve your problem (cleanly),
you'll need to use your own custom authentication mechanism. This is not
as hard as it sound.

Take a look at Apache::AuthCookie for an example (quite likely it is exactly
what you are looking for)

Or read chapter 13.7 Writing your own authentication mechanism in the
mod_perl Cookbook.


 
-- 
#!/usr/bin/perl   http://domm.zsi.at
for(ref bless{},just'another'perl'hacker){s-:+-$-gprint$_.$/}


mod_per2/PerlInc in Virtualhost

2003-07-17 Thread Thomas Schindl
Hi,

Is it possible to use different PerlINC-Paths in different virtual hosts
in mod_perl2. In mod_perl1 I've used Apache::PerlVINC what do I use in
mod_perl2?

thx

tom



Re: How to share subroutine

2003-07-17 Thread Thomas Klausner
:Hi!

On Wed, Jul 16, 2003 at 10:46:27PM +0100, Ged Haywood wrote:
 Hi there,
 
 On Wed, 16 Jul 2003, Matthew Wu wrote:
 
 I put all my subroutine in file.pm, what I need to do such that it
  can be used by my program? I don't what location I need to put it in and
  what kind of configuration I need to modify. I am running Redhat 6.3.
 
 At the risk of repetition... :)

Ha! :-)

 This is a mailing List specifically for mod_perl issues.
 Are you using mod_perl?

If you're using mod_perl, you might find this helpful:
http://perl.apache.org/docs/general/perl_reference/perl_reference.html#userequiredo_INC_and__INC_Explained
and
http://perl.apache.org/docs/1.0/guide/config.html#The_Startup_File

especially:
  use lib qw(/path/to/module);

But, as Ged allready mentioned, please RTFM! The mod_perl docs are really
great, so please DO read them.

http://perl.apache.org


-- 
#!/usr/bin/perl   http://domm.zsi.at
for(ref bless{},just'another'perl'hacker){s-:+-$-gprint$_.$/}


Re: mod-perl - read

2003-07-15 Thread Thomas Klausner
Hi!

On Mon, Jul 14, 2003 at 04:46:37PM -0500, Siva Yendapalli wrote:
 I am totally a newbie to mod_perl. I could able to get the content length
 using $r-headers_in(Content-Length). but I don't see anything in the $buf
 when I call the function $r-read($buf,$r-headers_in(Content-Length)). I

Is there any reason you want to parse the request yourself? You can use
Apache::Request to access the POST/GET data

 am sure I am doing some thing wrong with the configuration or with mod_perl 
 program. Please can some body give me an example and what I should do with
 the configuration to load the program. 

see perldoc Apache::Request

The mod_perl Website http://perl.apache.org also has a huge amount of
information (including pointers to the various mod_perl books).

-- 
#!/usr/bin/perl   http://domm.zsi.at
for(ref bless{},just'another'perl'hacker){s-:+-$-gprint$_.$/}


Re: Apache dont run

2003-07-14 Thread Thomas Klausner
Hi!

On Mon, Jul 14, 2003 at 04:59:17PM +0100, AROSO Jose Antonio wrote:

 I install the all in one package which contain the modperl 2.0 and de apache
 server 2.0.46.
 But after install when i write in command line apache to run the server
 appears The dynamic link library libxml2.dll could not be found.
 What do i do?

Read this:
http://perl.apache.org/maillist/email-etiquette.html


-- 
#!/usr/bin/perl   http://domm.zsi.at
for(ref bless{},just'another'perl'hacker){s-:+-$-gprint$_.$/}


Re: Problem with PerlTransHandler

2003-06-27 Thread Thomas Klausner
Hi!

On Fri, Jun 27, 2003 at 02:47:45PM +0400, Sergey V. Stashinskas  wrote:

 sub handler {
 my $r = shift;
 
 my $dbh = DBI-connect('dbi:mysql:db', 'user', 'pswd');
 $dbh-disconnect;

maybe the DBI-connect isn't working and thus your script dies / throws some
error ? 

I'd try to check if connect works, if $dbh works, etc.

-- 
#!/usr/bin/perl   http://domm.zsi.at
for(ref bless{},just'another'perl'hacker){s-:+-$-gprint$_.$/}


Re: Current directory

2003-06-17 Thread Thomas Klausner
Hi!

On Tue, Jun 17, 2003 at 02:19:49AM +0200, Oskar wrote:

 when I am executing perl script on Apache it seems that the current
 directory is not the directory where the script is located but the directory
 c:\program files\apache group\apache. I need current dir to be the script
 dir since i have some pm in the script directories.
 I have apache 1.3.27 and mod_perl 1.

See:
http://perl.apache.org/docs/1.0/guide/porting.html#_INC_and_mod_perl


-- 
#!/usr/bin/perl   http://domm.zsi.at
for(ref bless{},just'another'perl'hacker){s-:+-$-gprint$_.$/}


Re: How tell what version of mod_perl is installed?

2003-06-06 Thread Thomas Klausner
Hi!

On Thu, Jun 05, 2003 at 01:37:59PM -0700, Dennis G. Allard wrote:
 Please note, though, one of my goals in life is to rely on my software
 providers to do the work of providing me with a stable, tested,
 updatable OS and associated tools.  If I download 'out of band' updates,
 then I can no longer rely on Red Hat's network update tool, for example.
 
 With all due respect for your fine work, which is awesome, there are
 application developers such as myself out there who simply don't have
 time to track the bleeding edge except when absolutely forced to do so
 (which sometimes does happen).

The latest Red Hat comes with Apache 2 (because Apache 2 is quite stable).
Unfortunatly mod_perl 2.0 is /not/ that finished (Sorry Stas..). But because
Red Hat wants to provide mod_perl to its Users, they included the Beta
Version in their distro.

So blame them ...

  /home/stas perl-blead   -Mmod_perl -le 'print mod_perl-VERSION'
  1.2701
  /home/stas perl-blead -MApache2 -Mmod_perl -le 'print mod_perl-VERSION'
  1.9910
 
 Bummer, I don't have perl-blead and there are only 17 references to it
 in the entire history of Dejanews, none that seem to point to a
 download...

You don't need perl-blead (which is probably Stas' install of the latest
unstable Perl version)

This will do the same job:
% perl -Mmod-perl -le 'print mod_perl-VERSION'


-- 
#!/usr/bin/perl   http://domm.zsi.at
for(ref bless{},just'another'perl'hacker){s-:+-$-gprint$_.$/}


Re: How tell what version of mod_perl is installed?

2003-06-06 Thread Thomas Klausner
Hi!

On Thu, Jun 05, 2003 at 01:56:58PM -0700, Dennis G. Allard wrote:
  You don't need perl-blead (which is probably Stas' install of the latest
  unstable Perl version)
  
  This will do the same job:
  % perl -Mmod-perl -le 'print mod_perl-VERSION'
 
 Bummmer, that does not work either for me on Red Hat 8.0:

Sorry, typo: it should say -Mmod_perl instead of -Mmod-perl, i.e.:

% perl -Mmod_perl -le 'print mod_perl-VERSION'

-- 
#!/usr/bin/perl   http://domm.zsi.at
for(ref bless{},just'another'perl'hacker){s-:+-$-gprint$_.$/}


[OT] Re: pl extension

2003-06-06 Thread Thomas Klausner
Hi!

On Thu, Jun 05, 2003 at 11:00:37AM +0200, [EMAIL PROTECTED] wrote:

 I'm running redhat 9 and trying to execute a perl script through a web
 browser 
 
 http://host/file.pl 
 
 and the file displays as text, how do i get my apache to recognize this
 extension? 

This doesn't seems like a mod_perl question to me. Try a general CGI list:
http://lists.perl.org/showlist.cgi?name=cgi-list

Or read the Apache Docs, especially the section on ScriptAlias:
http://httpd.apache.org/docs-2.0/mod/mod_alias.html#scriptalias


-- 
#!/usr/bin/perl   http://domm.zsi.at
for(ref bless{},just'another'perl'hacker){s-:+-$-gprint$_.$/}


unsubscribe request

2003-05-31 Thread Diego Thomas
remove me from this fuckin list plss

- Original Message - 
From: Geoffrey Young [EMAIL PROTECTED]
To: Shashank Kailash Shringi [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Friday, May 30, 2003 5:00 PM
Subject: Re: Stacked Handlers Location directive -- inside and outside
virtual host



  When http://www.abc.com/~xyz gets called PerlAuthenHandler MyModule is
  invoked. MyModule code checks for IP after reading a file from xyz
  directory.
  If the host ip matches with the one in the file, it returns OK and the
  PerlAuthzHandler never gets called and the webpage is served to the
user.

 you may want to try using a PerlAccessHander for checking the IP, then
 combine that with Satisfy Any (as opposed to the Satisfy All default).

 HTH

 --Geoff




Re: mod_perl caching form data?

2003-05-30 Thread Thomas Klausner
Hi!

On Thu, May 29, 2003 at 12:19:49PM -0500, David Ressman wrote:

 So far, so good.  Everything works pretty well...  Except that
 something's caching previously entered form data and displaying it back
 to me as the default values in those same forms.  As an example, this
 form has a text field that asks for IP addresses, and the text input
 will occasionally be filled out with the IP address of a system that
 you had entered a few minutes ago.

Sounds to me like you are storing your values in global variables which
won't get reset between requests.

Do you declare you vars with 'my' ?

Are you running with
 use strict;
 use warnings;
? If not, turn them on, as thos pragmas will help you catch this kind of
error.

See here:
http://perl.apache.org/docs/1.0/guide/porting.html#Global_Variables_Persistence


-- 
#!/usr/bin/perl   http://domm.zsi.at
for(ref bless{},just'another'perl'hacker){s-:+-$-gprint$_.$/}


Re: how to secure perl modules?

2003-05-30 Thread Thomas Klausner
Hi!

On Thu, May 29, 2003 at 10:27:54AM -0700, iCap wrote:
 i have a collection of perl modules (running under the mod_perl umbrella)
 and would like to distribute the application to several different sources
 (clients with open internet web servers).  but i dont want to send it out
 without at least making it somewhat difficult for some hacker to just simply
 steal it and load it somewhere else without my consent.  what options do i
 have (if any) to secure the code so that it can't be 'easily' stolen?
 'easily' being the operative word here, as i realize it wont be 100% safe no
 matter what i do.
 the ideal would be to perhaps encrypt some of the code, maybe a few of the
 base configuration modules, maybe even the startup.pl file, others?

If you want to make it hard to read the code, use an Obfuscator (eg.
Acme::EyeDrops)

If want to really secure your code: it's not possible, see this thread on
perlmonks:
http://www.perlmonks.org/index.pl?node_id=243011
or search in the mailinglist archives. This questions was discussed here a
few times.

-- 
#!/usr/bin/perl   http://domm.zsi.at
for(ref bless{},just'another'perl'hacker){s-:+-$-gprint$_.$/}


best way to configure for multiple developers?

2003-04-03 Thread Brian C. Thomas
Hi

I have read through the lists looking for issues related to mp2 and
@INC, and have read the part about +Parent and virtual hosts.  What
about the following scenario?

One apache2 server w/ mp2 (no virtual hosts) and several perl coders
using the server as a development site.

Is there a best way to configure the apache/mp2 setup so that there
doesn't have to be constant additions to startup.pl to adjust the
INC path?  What about name space conflicts?

For example, I want developer1 to use /dev1, and developer2 /dev2.  I
want each developer to be able to build functions below there
directories in as many subdirectories as projects they have going on.
I don't want developer1's functions.pm code to interfere with
developer2's functions.pm.

Is such an arrangement even possible under mp2?  I've been using
Apache1/mp1 and this works fine, but all my tests with mp2 end up
giving me 

ModPerl::Registry: Can't locate FUNC.pm in @INC (@INC contains:
/usr...) types of  errors.  And for identically named files (e.g.
functions.pm above), I get the subroutines from the first listed
functions.pm in the @INC path, which are the wrong ones being called
for.

Can anyone push me in the write direction?

Thanks for any help

BCT








Re: best way to configure for multiple developers?

2003-04-03 Thread Brian C. Thomas
Hi

Thanks for the info.  I'll try setting up some virtual hosts.  More
below...

On Wed, Apr 02, 2003 at 06:07:01PM -0500, Perrin Harkins wrote:
 Brian C. Thomas wrote:
 I have read through the lists looking for issues related to mp2 and
 @INC, and have read the part about +Parent and virtual hosts.
 
 You should read the docs for tips on this, especially here:
 http://perl.apache.org/docs/general/control/control.html#Starting_a_Personal_Server_for_Each_Developer
 
 The strategies for this are mostly unaffected by mp 1 vs 2.
 
 Is there a best way to configure the apache/mp2 setup so that there
 doesn't have to be constant additions to startup.pl to adjust the
 INC path?
 
 If you don't need to restart the server, you could give each developer a 
 separate virtual host with a separate pool of perl interpreters.  These 
 could each have a different @INC setting and would not share code.  If 
 you need people to be able to restart though, it has to be separate servers.
 
 For example, I want developer1 to use /dev1, and developer2 /dev2.  I
 want each developer to be able to build functions below there
 directories in as many subdirectories as projects they have going on.
 I don't want developer1's functions.pm code to interfere with
 developer2's functions.pm.
 
 Well, what I mentioned above will let you do that, but how do you do it 
 on the production server?  You probably don't want to have multiple 
 pools of interpreters there, since it would use more memory.  If you 
 keep these files in a separate namespace, it won't be an issue.  Are 
 these real modules, with package declarations?
 
 Is such an arrangement even possible under mp2?  I've been using
 Apache1/mp1 and this works fine
 
 How are you doing it in mp1?  There is no support for pools of 
 interpreters in mp1, so all of your code must be using the same @INC.

Right, I guess it just feels like it is working under mp1, since I
can get @INC to contain . (the current dir) and use StatINC in all
the developer locations.  In the mp2 server, it shows me a different
@INC, that doesn't include . (is it possible in mp2?).

Thanks again,

BCT


Re: cgi.pm does not work in handlers (why responsehandlers at all ?)

2003-04-01 Thread Thomas Klausner
Hi!

On Wed, Apr 02, 2003 at 12:49:56AM +0200, [EMAIL PROTECTED] wrote:

   Is the O'Reilly about apache-modules what I'm looking for ? I've the
 small O'reilly about mod_perl but it raises more questions than its
 answers.

The Eagle book is definitly very interesting (if a little bit old - BTW, is
there a new edition scheduled for mod_perl 2?).

You can find lots of other usefull docs at 
  http://perl.apache.org
including pointers to other books (eg. the mod_perl Developers Cookbook)


-- 
#!/usr/bin/perl   http://domm.zsi.at
for(ref bless{},just'another'perl'hacker){s-:+-$-gprint$_.$/}


Re: inline mod_perl - is this possible?

2003-03-19 Thread Thomas Klausner
Hi!

On Wed, Mar 19, 2003 at 03:55:20AM -0800, www.ReadNotify.com wrote:

 I want to do this (serverside of course); is it
 possible?
 
 html
 I am running 
 !#perl
 print $ENV{MOD_PERL};
 print process ID $$;
 /!#perl
 on Apache!!
 /html
 
 What modules/config/etc do I need to set up?

There are various templating system / app servers on CPAN that let you do
this. Take a look at (e.g.) Mason or Embperl.

There is also Perrin Harkins article on Choosing a Templating System that
describes those (and other) systems;
http://perl.apache.org/docs/tutorials/tmpl/comparison/comparison.html


http://www.masonhq.com/
What Is Mason?
Mason is a powerful Perl-based web site development and delivery engine.
With Mason you can embed Perl code in your HTML and construct pages from
shared, reusable components.


http://perl.apache.org/embperl/
Embperl is a framework for building websites with Perl. For the beginner
it's an easy to setup and use way of embedding Perl code in HTML pages. It
delivers several features that ease the task of creating a websites,
including dynamic tables, formfield-processing, escaping/unescaping, session
handling, caching and more.



-- 
#!/usr/bin/perl   http://domm.zsi.at
for(ref bless{},just'another'perl'hacker){s-:+-$-gprint$_.$/}


Re: Using a Startup.pl

2003-03-18 Thread Thomas Klausner
Hi!

On Tue, Mar 18, 2003 at 01:39:41PM -0500, Chris Faust wrote:

 I'm running mod_perl 2 on RedHat with Apache 2.0.44 and I'm using NamedBased
 Virtual Hosting in apache (so I have a number of virtual hosts and apache
 directs properly based on hostname).
 
 I use a startup.pl to load up common things like DBI, CGI, HTML::Template
 etc..
 
 Should I have just a single startup.pl and will that work with all virtual
 hosts? Or should I have a startup.pl per virtual host.

AFAIK, and with mod_perl 1.x, having multiple startup.pl's makes no sense as
they all get executed during server startup and in the main namespace. 


-- 
#!/usr/bin/perl   http://domm.zsi.at
for(ref bless{},just'another'perl'hacker){s-:+-$-gprint$_.$/}


Job tracking and publishing question.

2003-03-11 Thread Thomas Whitney
Hi,

I want to implement a job tracking and database publishing system and hoping
for some assistance.

My company does short run 4 color digital printing.  Because it is short urn
we handle multiple jobs every day.  I developed an online bidding system; it
use Apache, mod_perl, and  mysql.  Now I would like to move to tracking jobs
online; first, for internal purposes -- it would make the workflow much
easier to follow -- and later for customers to view the status of their jobs
on the web.  Each bid has about 38 data fields associated with it and each
job will have a few more fields along with an image file in the form of a
pdf.

Each job needs to be tracked through production with operators at each stage
having being able to update its status or add notes.  After the job is
finished an invoice would be printed to go out with the job.  Web based
applications are good for this because we use Mac's and PC's, and both must
be able to have access to that job.

I was looking at Bricolage, however it appears to be more suited to text
content publishing.  I currently use Template::Toolkit to print out the bids
and I imagine I could do all the programming myself--naturally, it would be
helpful to find some package that suited at least some of my requirements..

I would really appreciate any thoughts or suggestions.

Thanks,
Thomas Whitney




Re: [mp2] disabling a perl handler within a specific location

2003-03-04 Thread Thomas Klausner
Hi!

On Tue, Mar 04, 2003 at 12:54:30AM -0500, Matt Avitable wrote:

 Does anyone know how one goes about disabling a particular handler 
 within a specific location?  For example, consider the following:
 
Location /
 PerlInitHandler config
 PerlOutputFilterHandler filter
 /Location
 
LocationMatch /(images|gfx)/
   ## what can I put here to say don't run to the above handlers?
/Location

This works for Auth*Handlers, so it should work for any phase:

LocationMatch /(images|gfx)/
   PerlInitHandler Apache::Constants::OK
/Location

See recipy 7.3 in the Cookbook


-- 
#!/usr/bin/perl   http://domm.zsi.at
for(ref bless{},just'another'perl'hacker){s-:+-$-gprint$_.$/}


Re: Server side programming PHP Vs CGI Vs modPerl

2003-02-14 Thread Thomas Klausner
Hi!

On Fri, Feb 14, 2003 at 03:52:35PM +0530, Devi .M wrote:

   Now I tried authenticating the user, where I have to maintain
 separate session for each user. When I saw how to do session management in
 mod_perl a module called Apache::Session was told. But when I tried it,
 that module was missing in my mod_perl. So I want to know, whether I have
 to download this module separately, or what version of mod_perl will it be
 available?

You'll have to download Apache::Session (and probably a lot of other usefull
modules) seperatly from CPAN, http://www.cpan.org (though I prefer
http://search.cpan.org)

Or, use the CPAN-shell that comes with Perl

(as root)
% cpan
or
% perl -MCPAN -eshell

cpan install Apache::Session



-- 
#!/usr/bin/perl   http://domm.zsi.at
for(ref bless{},just'another'perl'hacker){s-:+-$-gprint$_.$/}



Re: Server side programming PHP Vs CGI Vs modPerl

2003-02-14 Thread Thomas Klausner
Hi!

On Sat, Feb 15, 2003 at 12:07:28PM +0530, Devi .M wrote:

 After authentication I have to redirect to 
 another page,if the user and passwd is right. I am able to view my HTML
 page also correctly but below the page the following message is displayed.
 When I checked the error.log , there was no error thrown in it. Can anyone 
 help me how to overcome this
 
 ---
 HTTP/1.1 200 OK Date: Sat, 15 Feb 2003 06:46:02 GMT Server: Apache/1.3.27 
 (Unix)
 mod_perl/1.27 Connection: close Content-Type: text/html Embedded Perl 
 version v5.6.1 for
 Apache/1.3.27 (Unix) mod_perl/1.27 process 1614, 
 running since Sat Feb 15 11:49:25 2003

 Perl Configuration
 Loaded Modules
 Inheritance Tree
 Enabled mod_perl Hooks
 Environment
 PerlRequire'd Files
 Signal Handlers
 Symbol Table Dump
 ISA Tree
 Compiled Registry Scripts
 
 ---

This looks like the output of Apache::Status.

Without further information about your configuration etc, help is hardly
possible.

Please read the mod_perl documentation at
  http://perl.apache.org
and take an even closer look at
  http://perl.apache.org/docs/1.0/guide/help.html#How_to_Report_Problems




-- 
#!/usr/bin/perl   http://domm.zsi.at
for(ref bless{},just'another'perl'hacker){s-:+-$-gprint$_.$/}



Re: development techniques

2003-01-09 Thread Thomas Bolioli
I use my debugging module 
(http://cpan.perl.org/authors/id/T/TB/TBOLIOLI/Log-AndError-0.99.tar.gz) 
which prints to stderr (hence I got bit by the mod_cgi issues with 
read/write deadlocks on pipes) while tailing the logs, etc. I am looking 
to include a syslog and other output drivers to my mod which should 
allow for more fancy versions of the tail -f method.
The key to the print xxx if $debug method is to use stderr, categorize 
diag msgs, have multiple levels and lastly to have many lines of code 
marked to send diag info to the debugger. By using the module I have 
eliminated the if statements and simply pass diag info to the debugger 
which in turn determines if the msg is of importance given current 
debugging levels. This is more of a performance drag but it cleans up 
the code plenty.
Tom


Jim Martinez wrote:

The start of a new year has me thinking of how I can improve things.  
Like the way I develop, debug and test code.

Do you develop with an xterm tailing the logs, an emacs window (or other
editor) to edit the script and/or the packages (and on some occassions
httpd.conf), and a web browser (on an alternate virtual desktop)?  Do you
pepper code with :

print option: . $option{$foo . br if $debug;

Fairly low tech, huh.

At apachecon, a speaker (who neither bragged nor rambled) mentioned lwp
use instead of (or to complement) the web browser portion.

Will the use of lwp instead of a browser improve my coding ability (either
in terms of speed or just improving my perl coding)?  Seems like I'd have
to spend too much time with the lwp script (tell it to first request the
page then choose option A and B then hit the submit button ... )

Is there some way to improve this cycle : edit code - refresh browser -
possibly look at the error log - edit code - ...

Or maybe you use another approach that's better?

Happy new near (9 days late),
Big big Jim


 


--
-
Terra Novum Research
[EMAIL PROTECTED]
www.terranovum.com
(617) 923-4132

PO Box 362
Watertown, MA 02471-0362

Never meant half the things I said to you,
so you know,
there's a half that might be true.
 - Glenn Philips





Re: Perl Cookbook modperl chapter

2002-12-11 Thread Thomas Eibner
On Wed, Dec 11, 2002 at 01:13:30PM -0800, Nick Tonkin wrote:
 Obviously you (or ORA) _are_ competing with mod_perl Developer's
 Cookbook ... 

Why wouldn't they be? They have Writing Apache modules with Perl and C
after all. And with Stas' and Eric's book on the way (www.modperlbook.org)
they already have two books (soon hopefully).

 If ORA wanted to cover mod_perl they should not have let Geoff  co. get
 away to another publisher.

Maybe they felt that the book(s) they already have signed for will/would
saturate the market? A publisher can only justify a certain amount of
books on each topic.

[Don't really want to go into wheter or not mod_perl should be covered
in gnat's book, but if they have decided to include it they are
certainly within their rights to do so. If you don't like that, just
don't buy the book?]

-- 
  Thomas Eibner http://thomas.eibner.dk/ DnsZone http://dnszone.org/
  mod_pointer http://stderr.net/mod_pointer http://photos.eibner.dk/
  !(C)http://copywrong.dk/  http://apachegallery.dk/
  Putting the HEST in .COM http://www.hestdesign.com/



Re: Obfusacating the source

2002-11-19 Thread Thomas Klausner
Hi!

On Tue, Nov 19, 2002 at 07:08:00PM +, Mark Fowler wrote:
 
  I need some tool that gets all the perl modules and
  mason components, of an application we made, and obfucaste
  it a little.
 
 See Acme::Bleach

In fact you're probably better off using Acme::EyeDrops

http://search.cpan.org/author/ASAVIGE/Acme-EyeDrops-1.16/lib/Acme/EyeDrops.pm

With Acme::Bleach, you'll need to say

  use Acme::Bleach

at the beginning of your bleached module.

Acme::EyeDrops uses a big Regex, or (probably saver for your needs)
call it with Regex = 0 to generate a string to be evaled. So no need
for 'use Acme::EyeDrops', so no telltale sign for the cracker.

But no matter what Obfuscator you use: Obfuscation won't stop a determined
reader to get to the source. 

shameless plug
You might want to check out the slides of my talk The Dark Art of
Obfuscation, held at YAPC::Europe 2002:
  http://domm.zsi.at:/talks/obfu_yapc2002/
/shameless plug

-- 
#!/usr/bin/perlhttp://domm.zsi.at
for(ref(bless[],just'another'perl'hacker)){s-:+-$-gprint$_.$/}



Re: RFC: Template::YetAnother

2002-11-16 Thread Thomas Klausner
Hi!

On Sat, Nov 16, 2002 at 10:43:44AM +0100, Marcin Kasperski wrote:

 One note: while talking about templating systems for generating HTML,
 it can be inspiring to take a look at the Zope Page Templates (yes, I
 know, this is the python/zope world, not perl...). They found the nice
 idea of injecting loops/ifs etc into HTML in the way which does not
 spoil HTML markup. 

There is a simmilar Perl implementation of this called HTML_Tree
http://homepage.mac.com/pauljlucas/software/html_tree/

A module based on HTML_Tree is on CPAN under the name of
HTML-Seamstress:
http://search.cpan.org/author/TBONE/HTML-Seamstress-1.17/Seamstress.pm



-- 
#!/usr/bin/perlhttp://domm.zsi.at
for(ref(bless[],just'another'perl'hacker)){s-:+-$-gprint$_.$/}



Re: RFC: Template::YetAnother

2002-11-16 Thread Thomas Klausner
Hi!

On Fri, Nov 15, 2002 at 07:05:49PM -0800, Josh Chamas wrote:

 Don't do it.  If you want a stripped down version of
 ..
 evolution of these things.  The perl template user community is
 already fractured enough,

I expected that canonical answer to all Template Proposals :-)

 better to hop onto a project, hack it to your
 satisfaction ( with the blessing of the maintainers ) to get
 the configs/subclasses you need for your requirements.

I will take a closer look if my ideas could be implemented by
subclassing/extending Template Toolkit or CGI::FastTemplate.

But do you think that the concept sounds reasonable in the first
place?

-- 
#!/usr/bin/perlhttp://domm.zsi.at
for(ref(bless[],just'another'perl'hacker)){s-:+-$-gprint$_.$/}



Re: RFC: Template::YetAnother

2002-11-16 Thread Thomas Klausner
Hi!

On Sat, Nov 16, 2002 at 03:31:39PM -0500, Perrin Harkins wrote:
 I also posted this on perlmonks:
 http://www.perlmonks.org/index.pl?node_id=213300
 
 Ovid on Perlmonks already said some of the things I would have said 
 about needing a presentation language.  For a templating system to be 
 useful, it has to be able to deal with loops and conditionals.  Your 
 system pushes those into the Perl code, splitting the presentation 
 control into multiple places.  This fails one of my major goals: the 
 template coders should be able to change the presentation without help 
 from a Perl coder.  What if they decide they don't want to loop through 
 the links, but rather just print a message saying there are some?  What 
 if they only want to show the first two?  What if they want to display a 
 list with commas between the elements where they didn't use a separator 
 before?  A mature templating system can handle all of these issues 
 without changing the main Perl module code.

That's a very good point I didn't really think about. I was thinking
of templates as DUMB frontends that should just display
data. Period. 

Thinking of them as tools that handle presentation logic (as Ovid
pointed out) seems to make more sense. 

It does pay of to write RFCs before starting to code...

 Because IMO, the main reason for using templates is to seperate code
 from markup.
 
 It sounds to me like you want one of the HTML attribute ones, like Petal 
 or HTML::Seamstress.  What was wrong with those?

One problem I see with HTML::Seamstress is that it uses the HTML
attributes 'class' and 'id' for templating info. But those attributes
are used by CSS and JavaScript and might conflict somehow. I do not
know if you can change the behaviour of HTML::Seamstress to use other
attributes, though. But this stopped my from looking further.

And I didn't look at Petal. For now.
 
 There is one module, CGI::FastTemplate, that does seperate code from
 markup completly. But the way different templates are strung together
 seems rather comlicated to me.
 
 It's not complicated, but it is somewhat confusing the first time you 
 look at it.  I don't find your approach much easier though.

Well, I found mine easier :-)
(But I guess this is the reason for the Template Flood on CPAN -
everbody finds his own solution easier...)

 Isn't your fill method just doing a sort of multi-level join here?  All 
 of the data is passed in already, so there is no reason to delay 
 evaluation of the templates.

The main reason for doing this was to simplify testing. I planned to
just test the plain data structures, that should be free of HTML at
this time (before the fill). This (testing) was in fact the reason I
started thinking about this proposal in the first place.

 More importantly, your use of AUTOLOAD to treat method calls as file 
 names looks neat, but is not a good approach.  It's limiting (all 
 templates in one directory!) and has potential security issues with 
 namespace clashes.  These are all just the same method call with a 
 single argument changed, so why not write them that way?

I planned to handle those namespace and filename issues.
 
 ..
 force you to use them.  They are flexible modules.  I think you should 
 look at them more closely before you go off on your own.

That's what I'll do. Thanks for the excellent feedback.

-- 
#!/usr/bin/perlhttp://domm.zsi.at
for(ref(bless[],just'another'perl'hacker)){s-:+-$-gprint$_.$/}



Namespace problem

2002-11-15 Thread Thomas Hilbig
I am having a namespace problem that is a slight twist
to that described in the 1.0 docs
http://perl.apache.org/docs/1.0/guide/porting.html#Name_collisions_with_Modules_and_libs

My problem is even simpler, but worse.  If I have two
CGI programs using the same required script. 
Initially one works without any problems.  Then if I
call up the other script, each time I get an error
saying the subroutine cannot be found.  Refresh the
browser and it works, but then the first one starts to
give an error;

Error message: 
  Undefined subroutine
ModPerl::ROOT::ModPerl::Registry::home_httpd_qx_2dbin_gdtest1::goodDay

called at /home/httpd/qx-bin/gdtest1 line 7. 

This has to be something simple because I don't get
the error with normal Library components.   What am I
missing here??

Here is the package, and both CGI scripts that use it.
Thanks for any help,
Tom

-- commontest.pl  --
#!/usr/local/bin/perl
# Common Functions that will be 'required' by Perl CGI
scripts

CONFIG: {
   package commontest ;
}

sub goodDay {
  package commontest ;
  print H1Good Day Billy/H1\n ;
}

1;  

-- gdtest1 (First CGI script that uses the
package
#!/usr/local/bin/perl

require /usr/lib/perl5/site_perl/commontest.pl ; 
print Content-Type: text/html;
charset=ISO-8859-1\n\n ;
print headtitleTest
1/title/headbodyH1Test 1/H1\n ;

goodDay ;

print /bodyhtml\n ;
exit ;

-- gdtest2  (Second  CGI script that uses the
package
#!/usr/local/bin/perl

require /usr/lib/perl5/site_perl/commontest.pl ; 
print Content-Type: text/html;
charset=ISO-8859-1\n\n ;
print headtitleTest
2/title/headbodyH1Test 2/H1\n ;

goodDay ;

print /bodyhtml\n ;
exit ;


__
Do you Yahoo!?
Yahoo! Web Hosting - Let the expert host your site
http://webhosting.yahoo.com



RFC: Template::YetAnother

2002-11-15 Thread Thomas Klausner
..). I'll really appreciate feedback on this.

I hope that this descripction is clear enought. If not, let me know and I'll post some 
clarification / examples.

=head1 SYNOPSIS

  # generate a new template handler
  my $th=Template::YetAnother-new
({
  namespace='acme',
  template_dir='/projects/acme/templates/',
 });
 
  # build up a data structure
  $data={
 title=$th-title('this is the title'),
 breadcrumb=[
  $th-link({url='/index.html',text='Home'}),
  $th-separator_breadcrumb,
  $th-link({url='/acme/index.html',text='Acme'}),
  $th-separator_breadcrumb,
  $th-link({url='/acme/bleach.html',text='Bleach'}),
 ],
 content=[
   $th-element({heading='SYNOPSIS',value='blabla'}),
   $th-element({heading='DESCRIPTION',value='foo bar'}),
  ],
 lastmod=scalar localtime,
 
};

   # fill template  print
   print $th-fill({data=$data});
 
   ##
   # for this to work, we need the following files in
   # /projects/acme/templates
 
   # file: main.tpl
   htmlheadtitle[% title %]/title/head
   body
   center[% breadcrumb %]/center
   h1[% title %]/h1
   [% content %]
   hr
   [% lastmod %]
 
   # file: link.tpl
   a href='[% url %]'[% text %]/a
 
   # file: seperator.tpl
/ 
 
   # file: element.tpl
   h3[% heading %]/h3
   p[% value %]/p
 
   ##
   # the finished template should look like this:
 
   htmlheadtitlethis is the title/title/head
   body
   center
   a href='/index.html'Home/a /
   a href='/acme/index.html'Acme/a /
   a href='/acme/bleach.html'Bleach/a
   /center
   h1this is the title/h1
   h3SYNOPSIS/h3
   pblabla/p
   h3DESCRIPTION/h3
   pfoo bar/p
   hr
   Thu Nov  7 21:51:05 200


=head1 DESCRIPTION

=head2 new

  my $th=Template::YetAnother-new({
template_dir='/path/to/templates/',
# namespace='projectname',
# start_tag='--',
# end_tag=  '--',
});

Generates a new Template::YetAnother Handler Object.

=head2 fill

  $th-fill($data);

Fill the template with the data in the data structure.

=head2 _gen

  my $fragment=$th-_gen('type',$data)

Generates a new Template Fragment

You usually do not have to call this. You just say

  $th-type($data)

and AUTOLOAD passes it to C_gen

=head1 EXPORT

Nothing.

=head1 SEE ALSO

Search for Ctemplate on http://search.cpan.org, if you dare.

=head1 AUTHOR

Thomas Klausner, [EMAIL PROTECTED], http://domm.zsi.at

=head1 COPYRIGHT

This module is Copyright (c) 2002 Thomas Klausner, ZSI.
All rights reserved.

You may use and distribute this module according to the same terms
that Perl is distributed under.

=cut


-- 
#!/usr/bin/perlhttp://domm.zsi.at
for(ref(bless[],just'another'perl'hacker)){s-:+-$-gprint$_.$/}



Re: [OT] Perl vs. PHP..... but where is mod_perl?

2002-10-21 Thread Thomas Eibner
On Fri, Oct 18, 2002 at 05:05:47PM +0100, Jeff AA wrote:
  - I get 
 
   The requested story: 19716 has not been published (set live) yet.
 
 when I visit http://www.newsfactor.com/perl/story/19716.html
 
 Do you think the lists comments upset someone? 8-)

It better have. I'm sure the php team wouldn't even put something
like that up.

Maybe Randall should even contact them and offer his services in
fixing their broken site. (I got the Apache::Cookie:: scalar link
too).

-- 
  Thomas Eibner http://thomas.eibner.dk/ DnsZone http://dnszone.org/
  mod_pointer http://stderr.net/mod_pointer http://photos.eibner.dk/
  !(C)http://copywrong.dk/  http://apachegallery.dk/
  Putting the HEST in .COM http://www.hestdesign.com/



Re: SSL - mod_gzip - mod_perl = mod_proxy error

2002-10-18 Thread Thomas Eibner
On Fri, Oct 18, 2002 at 09:46:38PM -0500, Nigel Hamilton wrote:
 Hi,
   
   I'm trying to hand all SSL requests to a backend mod_perl server 
 with mod_gzip installed for compression.
 
   This means that SSL content is pre-compressed by the backend 
 server before being encrypted by the frontend (Mini How To - below).
 
   Apparently mod_gzip and SSL on the same server will not work - 
 this is why I need to pass the request to a proxy to handle the compression.
   
   So ... a request on https://turbo10.com:446/index.html (server A)  
 passes to http://turbo10.com:44300/index.html (server B).
 
   The file is compressed by server B and passed back to server A for 
 encryption and tranmission to the client.
 
   This works fine for static files.
 
    BUT 
 
   Mod_perl scripts seem to fail: 
 
   https://turbo10.com:446/cgi-bin/splashpage1.cgi
 
   The log reports:
   
 [Mon Oct 14 21:33:25 2002] [error] 
 proxy:http://turbo10.com:44300/cgi-bin/splashpage1.cgi not found or unable 
 to stat 

Something tells me that the proxy isn't handling this, have you double
checked that the proxy server is actually sending the request to the
mod_gzip enabled server?

-- 
  Thomas Eibner http://thomas.eibner.dk/ DnsZone http://dnszone.org/
  mod_pointer http://stderr.net/mod_pointer http://photos.eibner.dk/
  !(C)http://copywrong.dk/  http://apachegallery.dk/
  Putting the HEST in .COM http://www.hestdesign.com/



Re: Handler Concept / Question

2002-08-13 Thread Thomas Whitney

 You were close. It's default-handler.

   http://httpd.apache.org/docs/handler.html

And in mod_perl docs:
http://perl.apache.org/docs/1.0/guide/config.html#Overriding_E_lt_LocationE
_gt__Setting_in__Sub_Location_

__

Thanks, that was what I was looking for.

Thomas Whitney




Re: Handler Concept / Question

2002-08-12 Thread Thomas Whitney


 If I do set my script to answer all requests, how do I tell the
 webserver to show the static content that exists under the requested
 url?

You have to make the default handler pick it up.  I forget the exact
syntax, but there were some examples posted to the mailing list a while
back.
- Perrin

Hi,
I was following this thread with interest because I want to do something
like this.  I started searching on list archive for the above mentioned
syntax,  I searched for 'static content', then 'default handler', but with
no luck.  I do not mind doint the the searching, if you would perhaps
suggest a couple other search topics.

Thanks,

Thomas Whitney.




Re: Hiding perl code

2002-07-22 Thread Thomas Klausner

Hi!

On Sun, Jul 21, 2002 at 10:58:24PM -0400, Jonathon M. Robison wrote:
 Anyone know offhand a good way to hide your perl code when using 
 mod_perl? Acme::Bleach isn't doing it - httpd is failing to start on 

You could write an obfuscator. Maybe Acme::EyeDrop works?

See

http://domm.zsi.at/source_code/obfu/O.pm

for an obfuscated mod_perl handler.

A very simple thing to do is eg:

$yourcode=s/\s+/~/gs;

Than, in to be obfuscated module, do:

$_='package~Your::Code'.$yourcode;s/~/ /g;eval;

That's basically what I did in my mod_perl obfu.

This definitly isn't unbreakable, but (if you add some more
obfu-tricks and maybe do some encryption on the code to be evaled)
would require some knowledge to deparse.

I guess you started this thread on perlmonks? 
http://www.perlmonks.org/index.pl?node_id=183932
If not, read it.


-- 
#!/usr/bin/perlhttp://domm.zsi.at
for(ref(bless[],just'another'perl'hacker)){s-:+-$-gprint$_.$/}



Re: Static vs. DSO on Linux specifically

2002-07-22 Thread Thomas Klausner

Hi!

On Mon, Jul 22, 2002 at 10:26:32AM -0500, David Dyer-Bennet wrote:

 So, specifically for the Linux environment, what are the downsides of
 running mod_perl as a DSO?  (Pointers to the FM so I can R it would be
 fine.) 

Did you take a look at this:

http://perl.apache.org/docs/1.0/guide/install.html#Pros_and_Cons_of_Building_mod_perl_as_DSO

?

-- 
#!/usr/bin/perlhttp://domm.zsi.at
for(ref(bless[],just'another'perl'hacker)){s-:+-$-gprint$_.$/}



Re: mod_proxy_add_forward.c

2002-07-21 Thread Thomas Eibner

On Mon, Jul 22, 2002 at 08:34:08AM +1000, Jie Gao wrote:
 On Sat, 20 Jul 2002, Ask Bjoern Hansen wrote:
 
  As you may know then the proxy module in httpd 2.0 incorporates the
  X-Forwarded-For, X-Forwarded-Host and X-Forwarded-Server
  functionality of mod_proxy_add_forward.c.

 What are the differences between them?

I believe there is a difference in what headers was decided on to send in
mod_proxy.

mod_proxy_add_forward.c:
X-Forwarded-For
X-Host
X-Server-Hostname
mod_proxy:
X-Forwarded-For
X-Forwarded-Host
X-Forwarded-Server

 I have:
 
 ProxyPass /my-bin/ http://127.0.0.1:8081/my-bin/
 ProxyPassReverse /my-bin/ http://127.0.0.1:8081/my-bin/
 
 and I still see
 
 127.0.0.1 - - [22/Jul/2002:08:32:53 +1000] GET /my-bin 

That's what's supposed to happen. On the backend you have the headers you
can use to determine the original client.

I've created a module (both 1.3 and 2.0) to take advantage of the headers
called mod_rpaf [1] (reverse proxy add forward) in the backend.

1: http://stderr.net/apache/rpaf/

-- 
  Thomas Eibner http://thomas.eibner.dk/ DnsZone http://dnszone.org/
  mod_pointer http://stderr.net/mod_pointer http://photos.eibner.dk/
  !(C)http://copywrong.dk/  http://apachegallery.dk/
  Putting the HEST in .COM http://www.hestdesign.com/



Apache 2.0.40 / modperl-2.0 - Under Cygwin environment

2002-06-30 Thread Thomas S. Pangborn








Anyone have any success getting mod_perl 2.0 to compile
under Cygwin? I have Apache 2.0.40 compiled and working fine, however, when I
point mod_perl at the apache prefix directory and go to build the ld2 compiler
cannot find the ap/apr libraries needed to finish the link for the dll.



I have found that apr and aprutil are not in the linker path
and have added them, however, there is no apache library created that the
linker is looking for.



Any help here would be greatly appreciated.



Thanks,



Thomas








[OT] mod_perl obfuscation / T-shirt ?

2002-06-11 Thread Thomas Klausner

Hi!

Concerning the yearly what to put on the t-shirts-discussion...

I was thinking about doing a mod_perl Obfuscation for some time, and today I
found some time and wrote up something .. It's not that much obfusacated,
but it looks nice (mod_perl in ASCII art) and works (see the POD after the
code..)

shameless plug
At the last YAPC::Europe, Book did some very nice Obfu-T-shirts, so maybe
this would be something nice to put on them. 
/shameless plug

In case your MUA fucks up the linebreaks, you can download it from here:
http://domm.zsi.at/source_code/obfu/O.pm

# start of file

$_  ='
pa  ck
ag  e~
O;  Sj
{-2$j++}  Sa{retur  n~0~if(Q-getxpw  )[1]eqm  od_perlR  ul
z;Q-note  xfailure  ;401}SM{open(O,Q  -fi  lename)|  |r
et  ur  n~  404;  $_=join  ,O;cl  oseO  ;m
y$  b=  Q-  dir  _config(  O)||
p  hp  |a  sp|java  ;s/~($b)  /~mod_pe  rl/ig;p~  Q;print;  0}Sp
{p  op  -  send_htt  p_header  }Sh{p~po  p;print  $$:$j;0  }1';
  $a
  ++
  ;;

s/\s//gs;s/S/sub~/g;s/~/ /g;s/Q/'$_[0]'/eg;s/x/_basic_auth_/g;eval;__END__   

=pod

=head1 NAME

O.pm - A collection of obfuscated mod_perl Handlers

=head1 SYNOPSIS

  PerlModule O

  Location /someplace/
 PerlLogHandler O::j
  
 PerlAuthenHandler O::a
 AuthName Locked
 AuthType Basic
 require valid-user
  
 Sethandler perl-script
 PerlHandler O::M
  
 # to change other strings then the default:
 # PerlSetVar O asp|python
  /Location
  
  Location /someplace/viewlog
 Sethandler perl-script
 PerlHandler O::h
  /Location

=head1 DESCRIPTION

It's not that clear to read, but the source code of O.pm spells
out Fmod_perl (underlined). Maybe looks nice on a T-shirt?

O.pm contains 4 different mod_perl handlers:

=head2 O::j

O::j is a PerlLogHandler using a per-child global value to count
the hits of each child. See LO::h on how to read that value.

=head2 O::a

O::a is a PerlAuthenHandler. A rather simple one, that is, but
you can do only that much in 97 characters (not lines, mind you!)
of code ...

You can enter any User-ID, but you will need to know the right
password. No need to document that here, as you can find it easily
in the source code. Wait a minute, Bwhy am I writing docs at
all ?

=head2 O::M

O::M is a PerlHandler (i.e. generating content. Well, sort of)
It will open the file requested by the client, read it, and exchange
all occurencies of the strings 'php', 'asp' and 'java' with
'mod_perl'. Now, that's advocacy! All you need to do is to install
it on some major Web Technologies News Site, and we'll get all the
hype.

In case some new Ihot technologie comes out, you can set the
string of values to be replaced with

  PerlSetVar O some|new|technologies

Please note that there is even some minor context checking taking
place: The string won't get replaces if it occures right behind a
I. (dot, that is), so that e.g. links to Iguestbook.php still
work.

=head2 0::h

O::h is another PerlHandler. Use it to find out how many hits the
current child has served. You'll even get the IPID of the child.

=head2 O::p

Just a utility function used to send the headers (and to avoid
redundant code).

=head1 INSTALLATION

Dump it somewhere Apache can find it.

=head1 De-Obfuscation

To tired now. But I will post the obfu on perlmonks.org, and a
de-obfuscation probably somewhen later.

=head1 Author

Thomas Klausner, [EMAIL PROTECTED]

=head1 COPYRIGHT

O.pm is Copyright (c) 2002 Thomas Klausner.
All rights reserved.

You may use and distribute this module according to the same terms
that Perl is distributed under. If you dare.

=cut



-- 
 D_OMM  +  http://domm.zsi.at -+
 O_xyderkes |   neu:  Arbeitsplatz   |   
 M_echanen  | http://domm.zsi.at/d/d162.html |
 M_asteuei  ++





Re: modperl 2

2002-06-09 Thread Thomas Klausner

Hi!

On Sun, Jun 09, 2002 at 12:42:15AM -0400, Jaberwocky wrote:
 Does any one know of any modperl 2 resources? mailing lists,
 stuff like that. 

mod_perl 2 issues are discussed here on the mod_perl mailing list

Please read this before posting:
http://perl.apache.org/release/maillist/email-etiquette.html

You'll find lots of documentation here: 
http://perl.apache.org/release/docs/index.html



-- 
 D_OMM  +  http://domm.zsi.at -+
 O_xyderkes |   neu:  Arbeitsplatz   |   
 M_echanen  | http://domm.zsi.at/d/d162.html |
 M_asteuei  ++





Re: DBI Bug

2002-06-03 Thread Thomas Klausner

Hi!

On Mon, Jun 03, 2002 at 03:40:57PM -0300, Udlei Nattis wrote:
 PerlModule DBI
 ..
 i test it in
 Apache 2.0/Perl 5.8.0RC1/Modperl 1.99.02/03
 Apache 2.0/Perl 5.7.3/Modperl 1.99.02/03
 Apache 2.0/Perl 5.6.1/Modperl 1.99.02/03
 Apache 2.0-cvs/All Perls/All Modperls

I'm not sure if Apache::DBI has already been ported to mod_perl 2.0

You could try to use Apache::compat

You DO know that mod_perl 2.0 is still in BETA and that you should use
mod_perl 1.27 in a production environment?


-- 
 D_OMM  +  http://domm.zsi.at -+
 O_xyderkes |   neu:  Arbeitsplatz   |   
 M_echanen  | http://domm.zsi.at/d/d162.html |
 M_asteuei  ++





Re: Invoke PHP scripts?

2002-05-29 Thread Thomas Klausner

Hi!

On Tue, May 28, 2002 at 09:48:14PM -0600, Ryan Thompson wrote:
 I'm developing a large-ish web site in which I would like to use a
 combination of mod_perl (90%) and PHP (10%). I have run into a
 roadblock trying to include the output of a PHP script from a mod_perl
 script.
As far as I know this is rather impossible with mod_perl 1.x

You can chain different perl handlers (but only perl handlers) using
Apache::Filter, or you could let your mod_perl application issue a real http
request (using LWP), parse the output, and then do what you want with it.

Apache 2.0 (and mod_perl 2.0) (both in BETA) can do what you want unsing
Filters.



-- 
 D_OMM  +  http://domm.zsi.at -+
 O_xyderkes |   neu:  Arbeitsplatz   |   
 M_echanen  | http://domm.zsi.at/d/d162.html |
 M_asteuei  ++





Re: Scripts and passwd

2002-05-20 Thread Thomas Klausner

Hi!

On Sun, May 19, 2002 at 10:34:17AM +0200, Per Einar Ellefsen wrote:
 At 10:22 19.05.2002, [EMAIL PROTECTED] wrote:
   I have written scripts to add a user to the passwd and shadow files as well
 as sendmail user files. When I run this script from the command line for
 testing all runs and completes fine. But when I run the script from apache
 via the web interface I designed it for, I get file permission errors on the
 additions to passwd and the rest of the scripts. How can I get the script to
 access those files?
 You're doing something pretty risky there. the passwd/shadow files are only 
 writable by root. So I suppose that when running them from the command line 

You could let the CGI(or mod_perl)-script write the new user info to a normal
file writable by Apache, and then run a root-owned script (via a cronjob)
that reads this file and then modifies the passwd/shadow file.

Depending on the frequency of the updates, you might want to add file
locking, and depending on the security of your whole system, you could add a
MD5 checksum to each entry, so that nobody with access to your filesystem
can add entries to the Apache-writable file.


-- 
 D_OMM  +  http://domm.zsi.at -+
 O_xyderkes |   neu:  Arbeitsplatz   |   
 M_echanen  | http://domm.zsi.at/d/d162.html |
 M_asteuei  ++





Re: Force a 404 error?

2002-05-16 Thread Thomas Klausner

Hi!

On Thu, May 16, 2002 at 11:40:49AM +0100, Jonathan M. Hollin wrote:
 Is it possible to force a 404-error from within a mod_perl CGI?
What about returning NOT_FOUND from your handler and let an ErrorDocument
print out the warning?

See Chapter 4, Handling Errors, in the Eagle book.

-- 
 D_OMM  +  http://domm.zsi.at -+
 O_xyderkes |   neu:  Arbeitsplatz   |   
 M_echanen  | http://domm.zsi.at/d/d162.html |
 M_asteuei  ++





[RFC] New Subject Tag for mod_perl 2.x postings

2002-05-06 Thread Thomas Klausner

Hi!

As there are more and more mod_perl 2.x related questions on the mailing
list, it would be a good idea to introduce a new subject tag (as in
http://perl.apache.org/email-etiquette.html#Tags
):

Something like:
[mod_perl 2.x]
[mp2]
[2x]
[2.x]
??

What do you think?

It would definitly keep my mailbox tidier...

Stas, If we decide on something I could patch the new documentation to
include this new tag, but I don't know abot the old (i.e. current) one


-- 
 D_OMM  +  http://domm.zsi.at -+
 O_xyderkes |   neu:  Arbeitsplatz   |   
 M_echanen  | http://domm.zsi.at/d/d162.html |
 M_asteuei  ++





Re: Client capabilities

2002-04-30 Thread Martin Haase-Thomas

HTTP defines an 'Accept' header.

Joel Palmius wrote:

Is there a mod_perl API (or some other standard way) to determine what a 
client web browser is capable of displaying? (images, tables, plugins...)

I am developing a web questionnaire system in mod_perl (1.26) and I'm 
thinking about maybe dividing the display code into different levels 
depending on what the client can handle (no graphics no css for lynx-like 
browsers, stylesheets and images for most browsers, and plugin extensions 
for more advanced browsers). 

Only, I can't figure out how to determine if a client is capable of 
displaing an image, a stylesheets or (as an example) a J2RE 1.4 
java-plugin compatible applet. 

When reading the HTTP_ACCEPT environment variable, both lynx and mozilla 
say they can handle image/png, while in practise lynx cannot display 
that.

  // Joel





-- 
 Constant shallowness leads to evil.
---
Martin Haase-Thomas |Tel.: +49 30 43730-558
Software Development|   [EMAIL PROTECTED]
---






Re: [Q maybe OT] forward

2002-04-29 Thread Martin Haase-Thomas

Hi Perrin,

first of all please excuse my late answer - lots of things in mind to 
care about, as I'm hopefully close to releasing the 0.2 version of the 
serverpage implementation (and besides I urgently need a new job, too).

But thank you for your presice statement, that is exactly what I needed, 
and you helped me a lot. I think that it'll be a consice offer to the 
programmer if I declare 'redirect', 'moved', and 'forward' to be events 
on which enclosing handlers have to react approximately. Which means 
that a 'redirect' should lead to a 301 response, a 'moved' to a 302, and 
a 'forward' to whatever. But these are in fact not of the server page's 
concerns. Would you agree with this approach?

regards
M



Perrin Harkins wrote:

 Martin Haase-Thomas wrote:

 forwarding is a term that i borrowed from the JSP concept - which i'm 
 currently trying to implement in perl.


 JSP forward is directly equivalent to an internal redirect.  It's just 
 an include that doesn't return.  In short, it's a GOTO statement.  
 Thank you Sun.

 - Perrin



-- 
 Constant shallowness leads to evil.
---
Martin Haase-Thomas |Tel.: +49 30 43730-558
Software Development|   [EMAIL PROTECTED]
---






Re: [Q maybe OT] forward

2002-04-28 Thread Martin Haase-Thomas

Hi  Andrew,

thanx for the idea to have a look at Apache::ASP. I took that look 
meanwhile and to me that seems to be an overhead. Maybe I'm naive, 
because it wasn't much more than a glance, but the code copes with 
things a server page *never* has to worry about, things like session 
handling and so on. Apache::ASP looks more like a Java class packet (you 
know: one of these endless stories that java people use to wrap their 
code in - but I don't linme java, as you already may assume...) than a 
perl module. In my understanding a server page is nothing but a document 
that has to be processed by the server, and the result of this process 
is sent to the client. All the other aspects of a web application, like 
sessions or cacheing or th like ar not what the page itself has to care 
about. It either knows the respective values, because the handler passed 
them through to it - or it doesn't. But maybe I'm bragging now - wait a 
few weeks and we'll hopefully both see whether I'm right or not.

Kind regards
Martin


Andrew Ho wrote:

Hello,

MHTforwarding is a term that i borrowed from the JSP concept - which i'm 
MHTcurrently trying to implement in perl.

PHJSP forward is directly equivalent to an internal redirect. It's just 
PHan include that doesn't return.  In short, it's a GOTO statement. Thank 
PHyou Sun.

This concept is supported better in Apache::ASP, where you can just pass
arguments directly to the target page. If you use the internal_redirect()
method, you have to use notes(), pnotes(), globals, or some other
cumbersome method to pass arguments.

Humbly,

Andrew

--
Andrew Ho   http://www.tellme.com/   [EMAIL PROTECTED]
Engineer   [EMAIL PROTECTED]  Voice 650-930-9062
Tellme Networks, Inc.   1-800-555-TELLFax 650-930-9101
--



-- 
 Constant shallowness leads to evil.
---
Martin Haase-Thomas |Tel.: +49 30 43730-558
Software Development|   [EMAIL PROTECTED]
---






[Q maybe OT] forward

2002-04-24 Thread Martin Haase-Thomas

Hi all,

maybe this is going to be a little off topic, but it won't take you much 
time:

I am quite certain that recently I saw a server response code concerning 
forwarding. It may have looked like HTTP_DOCUMENT_FORWARDED or anything 
alike. Silly enough I can't recall where I saw it (or whether I even 
just dreamt it), so my questions are:

1. Has anyone ever seen that ghost before?
2. If I'm right, what is the correct memnonic, what's its code - and: 
where an I find it? perl5.6.1-Apache::Constants::Exports.pm doesn't 
mention it.

Hope it wasn't all just a dream...

thx
M

-- 
   http://www.meome.de
---
Martin Haase-Thomas |Tel.: +49 30 43730-558
meOme AG|Fax.: +49 30 43730-555
Software Development|   [EMAIL PROTECTED]
---





Re: [Q maybe OT] forward

2002-04-24 Thread Martin Haase-Thomas

;) you're right. meanwhile i found out that it seems to have something 
to do with proxies.
forwarding is a term that i borrowed from the JSP concept - which i'm 
currently trying to implement in perl. it means nearly the same as 
redirect, but without telling the client. (as far as i've understood it 
do far. maybe it's just luxury and i'm going to leave it out.)

thank you both for your clues and guesses. i think the best idea will 
lie in informing the programmer that there has been some sort of an 
'event' while processing the page - and leave the uncomfortable decision 
what do to with this 'event' up to him...

... whistling ... :)
M

Per Einar Ellefsen wrote:

 At 07:44 24.04.2002, Martin Haase-Thomas wrote:

 Hi all,

 maybe this is going to be a little off topic, but it won't take you 
 much time:

 I am quite certain that recently I saw a server response code 
 concerning forwarding. It may have looked like 
 HTTP_DOCUMENT_FORWARDED or anything alike. Silly enough I can't 
 recall where I saw it (or whether I even just dreamt it), so my 
 questions are:

 1. Has anyone ever seen that ghost before?
 2. If I'm right, what is the correct memnonic, what's its code - and: 
 where an I find it? perl5.6.1-Apache::Constants::Exports.pm doesn't 
 mention it.

 Hope it wasn't all just a dream...


 Must have been :) Apache::Constants doesn't mention anything about 
 FORWARD, neither does httpd.h. There is DOCUMENT_FOLLOWS, but that's 
 got nothing to do with it.

 What do you mean by forwarding anyway? Like redirect?



-- 
   http://www.meome.de
---
Martin Haase-Thomas |Tel.: +49 30 43730-558
meOme AG|Fax.: +49 30 43730-555
Software Development|   [EMAIL PROTECTED]
---






Location header blows away Set-Cookie?

2002-04-12 Thread Thomas K. Burkholder

Apologies if this is well-known - a generalized search failed to explain 
the behaviour I'm seeing.

Using:

Apache/1.3.23 (Unix) Debian GNU/Linux mod_ssl/2.8.7 OpenSSL/0.9.6c 
mod_perl/1.26

I'm using a perl handler in which I create a session and bind it to a 
cookie if a session doesn't already exist, fetch some results from a 
database, put the results in the session, then redirect to another page 
that is responsible for pulling the results out of the session and 
producing the html output.  As a test case, I do exactly this:

   $r-header_out(Set-Cookie = 'foo1=bar1');
   $r-header_out(Location = $redir);
   return REDIRECT;

I use curl to test with - the result does not contain the Set-Cookie 
header.  Is it expected behaviour that redirection should blow away 
Set-Cookie headers, and I just have to find a different way to do this?

I'm pretty sure this isn't a caching issue since I'm using curl to 
initiate the test.

Am I barking up the wrong tree?

Thanks in advance for any help-

//Thomas
Thomas K. Burkholder

[cripplecreek:~/MyProjects/WebFetcher/build] burkhold% curl -i 
http://www.areaj.org/areaj?pg=Searchimagesize=thumbnaileditCaptions=no;
deleteMarkingControls=notableHeight=3tableWidth=3orderby=randomshowExif=
noshowCaptions=nonesave=nonavstyle=slideshowautoshowSizeChange=noeditSelection=
noshowNavButtons=nocaptionsarea=editImages=noshowBasic=nomarkForDelete=
noautoInterval=120
HTTP/1.1 302 Found
Date: Fri, 12 Apr 2002 18:12:37 GMT
Server: Apache/1.3.23 (Unix) Debian GNU/Linux mod_ssl/2.8.7 
OpenSSL/0.9.6c mod_perl/1.26
Location: 
areaj?pg=GenPagefoo=barpg=Searchimagesize=thumbnaileditCaptions=nodeleteMarkingControls=
notableHeight=3tableWidth=3orderby=randomshowExif=noshowCaptions=none
save=nonavstyle=slideshowautoshowSizeChange=noeditSelection=noshowNavButtons=
nocaptionsarea=editImages=noshowBasic=nomarkForDelete=noautoInterval=
120
Transfer-Encoding: chunked
Content-Type: text/html; charset=iso-8859-1

!DOCTYPE HTML PUBLIC -//IETF//DTD HTML 2.0//EN
HTMLHEAD
TITLE302 Found/TITLE
/HEADBODY
H1Found/H1
The document has moved A 
HREF=areaj?pg=GenPageamp;foo=baramp;pg=Searchamp;imagesize=thumbnailamp;
editCaptions=noamp;deleteMarkingControls=noamp;tableHeight=3amp;tableWidth=
3amp;orderby=randomamp;showExif=noamp;showCaptions=noneamp;save=noamp;
navstyle=slideshowautoamp;showSizeChange=noamp;editSelection=noamp;showNavButtons=
noamp;captionsarea=amp;editImages=noamp;showBasic=noamp;markForDelete=
noamp;autoInterval=120here/A.P
/BODY/HTML
[cripplecreek:~/MyProjects/WebFetcher/build] burkhold%





Re: Unsubscribe me please [KILL THIS THREAD]

2002-04-10 Thread Martin Haase-Thomas

:) giggle...

Perrin Harkins wrote:

 Please kill this thread.  Some people are not good at dealing with
 mailing lists.  At least this guy was polite.

 - Perrin




-- 
   http://www.meome.de
---
Martin Haase-Thomas |   Tel.: 030 43730-558
meOme AG|   Fax.: 030 43730-555
Software Development|   [EMAIL PROTECTED]
---






Re: PDF generation

2002-04-08 Thread Thomas Eibner

On Mon, Apr 08, 2002 at 01:32:58PM +0200, Patrick wrote:
 Few seconds, at least for my cases (and by doing PUSHs to the Web
 client it let it know exactly where we are at the generation).

Okay, that sounds bareable.

 You should also consider, if possible, to generate files in advance
 of use.

That would have been a possibility if there wasn't such a high impact
when you generate the statistics I need.

 I also think that should not mess with the PDF output directly.
 Because it looks like text, but as you show yourself, it is in fact
 more complicated. 

That is true, but it's a fine line between either having to do ALL the
work everytime a layout has to change (try getting any of your 
graphical designers to make a layout in LaTeX :( ) or just parsing a
PDF. And since placing content at an absolute position isn't really an
option either it's not possible just to import the PDF and then write
the information needed to the document. 

I wonder how much PDI from pdflib.org will do..

-- 
  Thomas Eibner http://thomas.eibner.dk/ DnsZone http://dnszone.org/
  mod_pointer http://stderr.net/mod_pointer http://photos.eibner.dk/



Re: PDF generation

2002-04-07 Thread Thomas Eibner

On Sun, Apr 07, 2002 at 02:11:39AM +0200, Patrick wrote:
 On Wed, Apr 03, 2002 at 03:43:39PM -0500, Bill McCabe took time to write:
  I have a large number of mod_perl modules that connect to various databases and
  generate workflow performance reports for my organization. I give the users 3
  output options: HTML, Excel (Spreadsheet::WriteExcel), and PDF. For PDF output
  I've been using PDF::Create, which has been at version .01 since 1999. It has
  worked flawlessly for my purposes for a couple of years, but is very limited. In
  fine form-follows-function fashion, the end users would now like the PDF output
  gussied up with graphics, etc. Does anyone have any strong (positive or
  negative) recommendations for which module(s) I should migrate to?
 
 I do not use Perl modules to do that, but LaTeX.
 As ugly as it may sound it enables to output very complex PDF files,
 exactly the way you want.
 
 More precisely I have LaTeX templates, I use CGI::FastTemplate to
 fill them in with dynamic data, run pdflatex, and then have a nice
 PDF file.

Sounds like an interesting solution, but how long does it take to
generate the pdf files? I need something that will insert data into
PDF's at certain positions (they may change) and I was looking wheter
it would be possible doing something like CGI::FastTemplate just for
PDF's. The only requirement would be that you could use _any_ program
that generates PDF's to generate these templates. So I built part of a
PDF parser that would extract the text portions of a PDF, but then I
found that a PDF generated by Adobe Distiller (just as an example)
generates text sections that look something like:
[(Kv)25.1(ar r)9.9(adioj mangxas la fla)20(v)24.8(a)]
for the simple text of Kvar radioj mangxas la flava. 
Doesn't that just look hopeless to parse? I'm about to give up on this
solution, any comments?

-- 
  Thomas Eibner http://thomas.eibner.dk/ DnsZone http://dnszone.org/
  mod_pointer http://stderr.net/mod_pointer http://photos.eibner.dk/



Re: proxy front to modperl back with 1.3.24

2002-04-05 Thread Thomas Eibner

On Fri, Apr 05, 2002 at 02:33:35PM -0800, ___cliff rayman___ wrote:
 i had trouble using a proxy front end to both
 a mod_perl and mod_php back end servers.
 
 this works fine for me at 1.3.23, so I reverted
 back to it.  i copied the httpd.conf files
 from the 1.3.24 to my downgraded 1.3.23
 and everything worked correctly on the first
 try.
 
 i was getting garbage characters before the first
 html or doctype tag, and a 0 character at
 the end.  also, there was a delay before the
 connection would close.  i tried turning keep
 alives off and on in the back end server,
 but i did not note a change in behavior
 i also tried some different buffer directives,
 including the new ProxyIOBufferSize.

That was the size of the document when you get it in a chunked
response. And there were some problems in 1.3.24 where mod_proxy
returned the data it had collected in the chunked format even if
the client requesting the data didn't explicitly ask for it. 

 these garbage characters and delays were
 not present serving static content from the
 front end server, or when directly requesting
 content directly from either of the back end
 servers.
 
 i know they've made some mods to the
 proxy module, including support for HTTP/1.1,
 but i did not have time to research the exact
 cause of the problem.
 
 just a word of warning before someone
 spends hours in frustration, or perhaps
 someone can give me a tip if they've
 solved this problem.

There are some few messages concerning the problem a while ago either on
this list or the dev@httpd list.

http://msgs.securepoint.com/cgi-bin/get/apache0204/1/3.html
etc.

Can't really remember if they have fixed it in CVS already.

-- 
  Thomas Eibner http://thomas.eibner.dk/ DnsZone http://dnszone.org/
  mod_pointer http://stderr.net/mod_pointer http://photos.eibner.dk/



Re: proxy front to modperl back with 1.3.24

2002-04-05 Thread Thomas Eibner

On Fri, Apr 05, 2002 at 03:23:38PM -0800, ___cliff rayman___ wrote:
 Thomas Eibner wrote:
 
 
  There are some few messages concerning the problem a while ago either on
  this list or the dev@httpd list.
 
  http://msgs.securepoint.com/cgi-bin/get/apache0204/1/3.html
  etc.
 
 thanks - it must have been a bad googling day yesterday since i did not come
 up with this info.

Somehow google actually just indexed that message it seems, Apr 05 was the
time stamp. But there was some discussion about it on dev@httpd when
1.3.24 was released.

 
 
  Can't really remember if they have fixed it in CVS already.
 
 i'll wait till 1.3.25 which will probably be coming out sooner than
 expected.  ;-)

Let's see - with the dev people pushing for GA on 2.0.

-- 
  Thomas Eibner http://thomas.eibner.dk/ DnsZone http://dnszone.org/
  mod_pointer http://stderr.net/mod_pointer http://photos.eibner.dk/



Re: PDF generation

2002-04-03 Thread Thomas Eibner

On Wed, Apr 03, 2002 at 03:43:39PM -0500, Bill McCabe wrote:
 Hi All
 
 I have a large number of mod_perl modules that connect to various databases and
 generate workflow performance reports for my organization. I give the users 3
 output options: HTML, Excel (Spreadsheet::WriteExcel), and PDF. For PDF output
 I've been using PDF::Create, which has been at version .01 since 1999. It has
 worked flawlessly for my purposes for a couple of years, but is very limited. In
 fine form-follows-function fashion, the end users would now like the PDF output
 gussied up with graphics, etc. Does anyone have any strong (positive or
 negative) recommendations for which module(s) I should migrate to?

I've had good success with PDFLib http://www.pdflib.org/, but the
license isn't what one could have hoped for :-/ Matt Sergeant wrote an
OO interface to pdflib_pl.pm which is what I am using.

-- 
  Thomas Eibner http://thomas.eibner.dk/ DnsZone http://dnszone.org/
  mod_pointer http://stderr.net/mod_pointer http://photos.eibner.dk/



Any way to run two versions of the same perl classes at the same time?

2002-03-28 Thread Thomas Burkholder

Hi there-

I've reached a point where I've released a stable version of my project 
(areaj, at www.areaj.org) with a demo server (www.areaj.org/areaj) but I 
want to continue development work on the same machine.  But, obviously 
the new and old versions of the code live in an identical namespace - so 
I don't see a way to run both servers under the same apache 
installation.  I can't just use StatINC and change the code dynamically, 
because that will create an unpredictable and bug-prone experience for 
the people using the production server (I want folks using the 
production server to see the existing product anyway, not what I'm 
developing on).

Does anyone know of an easy way to solve this with apache/mod_perl, 
without running on two different servers?  Locating the code isn't a 
problem; I already deliver the code to a custom location in the user's 
home dir.  I just don't know how to get two apaches to run that read the 
different versions of the code.

Thanks,

//Thomas




How to get two perl namespaces in apache

2002-03-26 Thread Thomas K. Burkholder

Hi there-

Apologies if this gets sent twice - I sent a message yesterday, but it 
seems to have vanished into the ether.

I'd like to run the production server of my mod_perl project 
(http://www.areaj.org/areaj) on the same machine as my development 
server.  Clearly they have the same module names so I have to somehow 
run them in two different environments - I don't think running them on 
two different virtual servers is going to do it, right?  Doesn't apache 
just start one perl runtime?  Please tell me if I'm mistaken about 
that.

So, I guess I'm wondering if there's an easy way to have two completely 
separate apache configurations running on the same machine (listening on 
different ports obviously).

Any help greatly appreciated.

Thanks,

//Thomas
Thomas K. Burkholder




[OT?] What exactly is forwarding?

2002-03-12 Thread Martin Haase-Thomas

Hi all,

I know this is not perfectly the right list for my topic, but before 
subscribing to another for just one question... forgive me if I'm going 
to be boring. Even more, because my question is rather philosophical.

If you consider JSPs, there is a tag called jsp:forward page=... /. 
My question is: how do I have to understand 'forward'? The java 
documentation isn't that verbose, and I can imagine two possible meanings:
1. Forwarding is some sort of an internal redirect to the servlet engine 
which the browser will not be informed of.  From this point of view 
forwarding will be nearly the same as a dynamic include.
2. Forwarding is the same as a redirect.

Maybe a superfluous question for some of you, for me it isn't actually. 
So, if anyone knows an answer - or knows the number of the RFC I'll find 
the information: you're welcome!

Thanx a lot in advance
Martin


-- 
   http://www.meome.de
---
Martin Haase-Thomas |   Tel.: 030 43730-558
meOme AG|   Fax.: 030 43730-555
Software Development|   [EMAIL PROTECTED]
---





Re: [OT] Thought for the Day

2002-03-12 Thread Martin Haase-Thomas

Should we tell the yellow press in the end?

;)
Martin


Carlos Ramirez wrote:

 I wrote an article about Apache::Motd for UNIX SysAdmin magazine 
 (March 2001 issue). Here's the link: 
 http://www.samag.com/documents/s=1153/sam0103a/

 -Carlos


 Geoffrey Young wrote:

 John Eisenschmidt wrote:

 Sinister, aren't I? G

 For the record I did email directly an explanation of what -o does 
 and to exclude it for clean fortunes, and that it's more fun to 
 make your own. I have quotes from all the Dogma movies that are 
 called within my mod_perl index.html on my website. =)

 Suddenly this thread is on-topic.


 everyone might want to look at Apache::MOTD - it's a similar idea to
 the Unix motd functionality whose implementation is quite clever.

 --Geoff






-- 
   http://www.meome.de
---
Martin Haase-Thomas |   Tel.: 030 43730-558
meOme AG|   Fax.: 030 43730-555
Software Development|   [EMAIL PROTECTED]
---






Re: [OT?] What exactly is forwarding?

2002-03-12 Thread Martin Haase-Thomas

Thank you both. I thought so: it is one of these typical JSP features - 
but now it works in perl, too ;)

Cheers
Martin


Perrin Harkins wrote:

 Paul Lindner wrote:

 You'll find that $r-internal_redirect() is the mod_perl equivalent.
 Also Apache::ASP containts the Transfer() method which accomplishes
 the same thing.


 Personally, I always thought this was sort of a strange part of JSP.  
 It really shows the page-centric thinking behind it.  Doing a 
 forward is essentially a GOTO statement for JSP.  When I write 
 mod_perl apps, I never feel the need for that sort of thing, with so 
 many better ways to accomplish things (OO, method calls, dispatch 
 tables, template includes).

 - Perrin



-- 
   http://www.meome.de
---
Martin Haase-Thomas |   Tel.: 030 43730-558
meOme AG|   Fax.: 030 43730-555
Software Development|   [EMAIL PROTECTED]
---






Perl script for Cobalt Cube 3

2002-03-07 Thread Thomas Hanson

I am trying to make 2 perl scripts for our cube3 since we are trying to
automate the add user and delete user administration.

So far I have found perl scripts to add users and groups, delete users and
groups but not to add or delete mail aliases.
Those scripts use these modules :
Cobalt::user
Cobalt::group

I found that there is a Cobalt::mail  module too, and figure I need to use
that one too.

Where can I find som info on these modules and how to use them?
And can anyone give me any pointers on what else I might need (I have never
programmed perl before, but there is always a first time).

Thanks

Thomas



[OT] redirect STDOUT

2002-03-06 Thread Martin Haase-Thomas

Hi all,

instead of committing suicide after having tried and searched for all of 
the day now i'd rather ask you:
does anyone know how to redirect STDOUT into a scalar variable,
so that a 'print anything' will not appear on STDOUT, but only in
my buffer?

desperate
Martin

-- 
   http://www.meome.de
---
Martin Haase-Thomas |   Tel.: 030 43730-558
meOme AG|   Fax.: 030 43730-555
Software Development|   [EMAIL PROTECTED]
---





Re: How to invoke the save dialog box when clicking in the link, which is generated by PERL script.

2002-03-06 Thread Martin Haase-Thomas

try:
[EMAIL PROTECTED]

M. SubbaReddy wrote:

Hello Gurus,

I am very sorry, if this post is on wrong list.

I have a perl script, which gives dynamic page with search files list.
Pdf and text files are displaying in browser, when clicking in the link of
file.
But, I want to save on to disk, instead displaying in browser.

Like:
On click a hyperlink, we can invoke the add to Favorite window using...
document.write ( a href='javascript:window.external.AddFavorite(url,
description)' ..)

Similarly, how do I invoke the Save Target As dialog box.
Instead I want to save on to disk on click the hyperlink. = a
href=javascript:window.external.SaveAs('http://books.com/js.pdf',filename)

js book/a


Kindly, please give me hint.

Thanks in advance.

Regards,

~ SubbaReddy .M
   Sr. Programmer, Frontlinesoft, Hyderabad
   http://www.frontlinesoft.com
   Ph: 91-40-3392147, 3391683 (O)
   ICQ: 56093095




-- 
   http://www.meome.de
---
Martin Haase-Thomas |   Tel.: 030 43730-558
meOme AG|   Fax.: 030 43730-555
Software Development|   [EMAIL PROTECTED]
---






[WOT] Opcode/ Safe

2002-03-04 Thread Martin Haase-Thomas

Hi all,

maybe this is really far WOT, but one shouldn't give up hope, as we all 
know...
Does anyone have experience with Opcode and Safe? The thing is that I 
have to create my own secure namespace
for some reasons - and don't know how to do.

What does not work is the following:

#!/usr/bin/perl -w
use Safe;
my $page = new Safe (huhu);
$page-deny qw(:base_io :base_orig :base_thread :filesys_read :sys_db
 :filesys_open :filesys_write :subprocess :ownprocess
 :still_to_be_decided :dangerous);
$page-permit qw(print ref entereval);
$page-deny qw(rand srand);
$page-reval (sysopen '/bla/blub.html' || kill 15, 1906);

Anyone with an idea? btw: funny things will happen if you type 1 instead 
of 1906 ... :)

regards
Martin

-- 
   http://www.meome.de
---
Martin Haase-Thomas |   Tel.: 030 43730-558
meOme AG|   Fax.: 030 43730-555
Software Development|   [EMAIL PROTECTED]
---





Re: [WOT] Opcode/ Safe

2002-03-04 Thread Martin Haase-Thomas

Ok, forget my post, her's the answer:
#!/usr/bin/perl -w
use Safe;
my $page = new Safe (huhu);
my $opset = Opcode::opset qw(:base_io :base_orig :base_thread 
:filesys_read :sys_db
 :filesys_open :filesys_write :subprocess :ownprocess
 :still_to_be_decided :dangerous);
$page-deny(Opcode::opset_to_ops($opset));
$page-permit qw(print ref );
$page-deny (qw(rand srand));

$page-reval (eval \ print 'huhu' \);
print $@.\n;


Martin Haase-Thomas wrote:

 Hi all,

 maybe this is really far WOT, but one shouldn't give up hope, as we 
 all know...
 Does anyone have experience with Opcode and Safe? The thing is that I 
 have to create my own secure namespace
 for some reasons - and don't know how to do.

 What does not work is the following:

 #!/usr/bin/perl -w
 use Safe;
 my $page = new Safe (huhu);
 $page-deny qw(:base_io :base_orig :base_thread :filesys_read :sys_db
 :filesys_open :filesys_write :subprocess :ownprocess
 :still_to_be_decided :dangerous);
 $page-permit qw(print ref entereval);
 $page-deny qw(rand srand);
 $page-reval (sysopen '/bla/blub.html' || kill 15, 1906);

 Anyone with an idea? btw: funny things will happen if you type 1 
 instead of 1906 ... :)

 regards
 Martin


-- 
   http://www.meome.de
---
Martin Haase-Thomas |   Tel.: 030 43730-558
meOme AG|   Fax.: 030 43730-555
Software Development|   [EMAIL PROTECTED]
---






Re: Use of uninitialized value. with no line number in error log

2002-02-21 Thread Martin Haase-Thomas

perl sighandlers require the signal as their first argument. so i assume 
that it may not be a good idea to call Carp::cluck(), as any of the Carp 
methods expect strings. try typing as follows:

$SIG{WARN} = sub { Carp::cluck (received signal shift() at 
line.__LINE__) };

martin


Tim Noll wrote:

Stas Bekman wrote:

I know this is a pretty generic question, but if nobody knows a quick
answer, I can get more specific in a later post. Under Apache 1.3.22 /
mod_perl 1.26, even while using $SIG{__WARN__} = \Carp::cluck, I keep
getting Use of uninitialized value. in the Apache error log, with
absolutely no line number or back trace or anything else. Does anybody

know

what might cause this? Thanks.

Where did you set $SIG{__WARN__}? Try in startup.pl as early as possible.


It's set in startup.pl, which is basically a modified version of the example
from perl.apache.org/guide. It works beautifully for every other error I've
come across, which is why this one is so curious. As I mention in my earlier
follow-up to my own post, I eventually traced the problem to an incorrect
driver string in DBI-connect. However, that doesn't explain (to me anyway)
why I wasn't getting more detail in the error log. Perhaps I'll delve into
DBI.pm, unless someone can explain this to me beforehand.

-Tim



-- 
   http://www.meome.de
--
Martin Haase-Thomas |  Tel.: 030 43730-558
meOme AG|  Fax.: 030 43730-555
Software Development|  [EMAIL PROTECTED]
--






Re: Anyone for JavaScript question

2002-02-21 Thread Martin Haase-Thomas

The simple onUnload() construction will not work. You will have to open 
a new browser window on unload displaying the output of your server program.

martin


Medi Montaseri wrote:

I know this is off topic, but I thought someone could use a break...

Given a page called xyz.html, I want to measure the amount of time a
user spent
on this screen (or page) along with other usability metrics. So I
figured I'll use
JavaScript since its running the entire time the page is up.

Then I decided to use onload() and onunload() events to determine start
and end
of the session.

The onload() part is easy. However when onunload() event happens, I need
to
execute a server side program and feed it the data that was collected.

So I figured I setup a dumy form and invoke form.submit() onUnload.
Would this work or is there a better method.

I also thought about a redirect followed by another rediect to where the
user wanted
to go, but that gets too browser dependent and I don't like it when
others hijak my
browser.


--
-
Medi Montaseri   [EMAIL PROTECTED]
Unix Distributed Systems EngineerHTTP://www.CyberShell.com
CyberShell Engineering
-





-- 
   http://www.meome.de
--
Martin Haase-Thomas |  Tel.: 030 43730-558
meOme AG|  Fax.: 030 43730-555
Software Development|  [EMAIL PROTECTED]
--






Re: [OT] Re: Anyone for JavaScript question

2002-02-21 Thread Martin Haase-Thomas

hi nigel,

i never tried aou JSRS before, so i can't judge about it. but posting 
the data to a hidden frame might not work on an unload event. imagine 
the user types in another url  and löeaves the whole
frameset. but now we're running far WOT ... :)

martin


Nigel Hamilton wrote:

Hi Martin,

   You could try posting the form to a hidden frame or you could use
Javascript remote scripting (JSRS) to communicate the onUnload event to
your server.


Nigel


-- 
   http://www.meome.de
---
Martin Haase-Thomas |   Tel.: 030 43730-558
meOme AG|   Fax.: 030 43730-555
Software Development|   [EMAIL PROTECTED]
---






Re: Use of uninitialized value. with no line number in error log

2002-02-21 Thread Martin Haase-Thomas

you're right, i forgot about those two perl signals.

ashamed
martin

Stas Bekman wrote:

 Martin Haase-Thomas wrote:

 perl sighandlers require the signal as their first argument. so i 
 assume that it may not be a good idea to call Carp::cluck(), as any 
 of the Carp methods expect strings. try typing as follows:

 $SIG{WARN} = sub { Carp::cluck (received signal shift() at 
 line.__LINE__) };


 Sorry Martin, but this is incorrect. There is no signal SIGWARN. 
 $SIG{__WARN__} and $SIG{__DIE__} are special perl signal handlers, 
 which accept the string as the first argument (actually expect a 
 list). This has no effect:

  perl -MCarp -le '$SIG{WARN} = sub { Carp::cluck (received signal 
 shift() at line.__LINE__) }; warn doh, doh'
 dohdoh at -e line 1.

 While this does:

  perl -MCarp -le '$SIG{__WARN__} = sub { Carp::cluck (received signal 
 shift() at line.__LINE__) }; warn doh, doh'
 received signal shift() at line1 at -e line 1
 main::__ANON__('dohdoh at -e line 1.^J') called at -e line 1


 The Carp::cluck trick is correct, unless someone somewhere redefines 
 $SIG{__WARN__}.


 martin


 Tim Noll wrote:

 Stas Bekman wrote:

 I know this is a pretty generic question, but if nobody knows a quick
 answer, I can get more specific in a later post. Under Apache 
 1.3.22 /
 mod_perl 1.26, even while using $SIG{__WARN__} = \Carp::cluck, I 
 keep
 getting Use of uninitialized value. in the Apache error log, with
 absolutely no line number or back trace or anything else. Does 
 anybody

 know

 what might cause this? Thanks.

 Where did you set $SIG{__WARN__}? Try in startup.pl as early as 
 possible.


 It's set in startup.pl, which is basically a modified version of the 
 example
 from perl.apache.org/guide. It works beautifully for every other 
 error I've
 come across, which is why this one is so curious. As I mention in my 
 earlier
 follow-up to my own post, I eventually traced the problem to an 
 incorrect
 driver string in DBI-connect. However, that doesn't explain (to me 
 anyway)
 why I wasn't getting more detail in the error log. Perhaps I'll 
 delve into
 DBI.pm, unless someone can explain this to me beforehand.

 -Tim







-- 
   http://www.meome.de
---
Martin Haase-Thomas |   Tel.: 030 43730-558
meOme AG|   Fax.: 030 43730-555
Software Development|   [EMAIL PROTECTED]
---






Re: A really strange POST problem

2002-02-19 Thread Thomas Eibner

On Tue, Feb 19, 2002 at 10:47:51AM +0100, Tomas Eriksson wrote:
 Hi.
 
 I'm not sure if this a modperl problem but I'm using modperl (5.005), Apache (1.3) 
under 
 Debian on my website. 
 
 Using read(STDIN, $ENV{...}, $buffer) to retrieve the post data. At several places 
i'm using
 forms with radio buttons from -2 to 2, but from some of my visitors I got almost 
randomly
 numbers in the form data xxx=13 xxx=4 etc from the radio buttons. I can read these 
wrong 
 values directly in the $buffer string. This happen often if they post many times but 
seems 
 to be to other visitors also.  
 
 I hope I'm not the only one in the world that has this problem...

Please use CGI.pm, Apache::Request, or something else other than rolling
your own solution for reading the CGI data - it will save you time in the
long run.

If it was a bug you'd have to be more specific as to which versions you
are running of Apache/mod_perl.

-- 
  Thomas Eibner http://thomas.eibner.dk/ DnsZone http://dnszone.org/
  mod_pointer http://stderr.net/mod_pointer http://photos.eibner.dk/



Re: Image Magick Alternatives?

2002-02-18 Thread Thomas Eibner

On Mon, Feb 18, 2002 at 09:26:57PM -, Jonathan M. Hollin wrote:
 The WYPUG migration from Win2K to Linux is progressing very nicely.
 However, despite my best efforts, I can't get Perl Magick to work
 (Image::Magick compiled successfully and without problems).  All I use
 Perl Magick for is generating thumbnails (which seems like a waste
 anyway).  So, is there an alternative - a module that will take an image
 (gif/jpeg) and generate a thumbnail from it?  I have searched CPAN but
 haven't noticed anything suitable.  If not, is there anyone who would be
 willing to help me install Perl Magick properly?

I'd take a look at home Apache::Gallery uses Inline::C and imlib to
generate thumbnails. It supports PNG, TIFF, JPEG, PPM and other
goodies.

-- 
  Thomas Eibner http://thomas.eibner.dk/ DnsZone http://dnszone.org/
  mod_pointer http://stderr.net/mod_pointer http://photos.eibner.dk/



[Q] Apache::File-new

2002-02-12 Thread Martin Haase-Thomas

Hi,
I searched in the book, I searched in the FAQs - no I ask u:

Does Apache::File-new start a subrequest? There are some mystical lines 
in my rewrite_log, which might come from there.

Thanx a lot
Martin




Re: [Q] Apache::File-new

2002-02-12 Thread Martin Haase-Thomas
) applying pattern '^(.*)_jsp(.*)$' to uri '/67567'
192.168.255.75 - - [12/Feb/2002:15:03:55 +0100] [disp05/sid#80aec3c][rid#81b5494/subreq]
(1) pass through /67567

Lots to read I know. Hope you'll have the patience.
Many thanx in advance,
best regards
Martin


Geoffrey Young wrote:
[EMAIL PROTECTED]">
  Martin Haase-Thomas wrote:
  
Hi,I searched in the book, I searched in the FAQs - no I ask u:Does Apache::File-new start a subrequest? 

no.  it is merely a layer over Perl's file IO methods (Perl_do_openfrom what I can see).

  There are some mystical linesin my rewrite_log, which might come from there.
  
  that seems strange.  maybe post the lines if they are causing yougrief..HTH--Geoff
  
  
  
  


Re: Apache::DBI

2002-02-12 Thread Martin Haase-Thomas




(doesApache::DBI overload the DBI methods?)
No, it doesn't. It uses Apache and DBI. Did you install the package via the
"Makefile.PL" stanza? Maybe you should just install it another time. On the
other hand, Apache::DBI doesn't export anything. Try calling it with the
package name explicitly.

kind regards
Martin

Marty J. Rogers wrote:
[EMAIL PROTECTED]">
  I had tried that, with the same result. (doesApache::DBI overload the DBI methods?) Fullerror is as follows. Again, any help is _highly_appreciated.Marty[error] Can't locate object method "connect_on_init" via package "Apache::DBI" at /etc/httpd/conf/startup.pl line 28.Compilation failed in require at (eval 14) line 1.Syntax error on line 1276 of /usr/local/apache/conf/httpd.conf:Can't locate object method "connect_on_init" via package "Apache::DBI" at /etc/httpd/conf/startup.pl line 28.Compilation failed in require at (eval 14) line 1.--On Tue, 12 Feb 2002 08:44:12   Martin Haase-Thomas wrote:
  
Marty J. Rogers wrote:

  [snip]From httpd.conf:PerlModule Apache::DBI CGI DBD::mysql \Apache::AuthenDBIPerlRequire /path/to/startup.plAlias /perl/ /path/to/perlPerlModule Apache::RegistryLocation /perlSetHandler perl-scriptPerlHandler Apache::RegistryOptions ExecCGIallow from allPerlSendHeader On/Locationand from startup.pl:use DBI();
  
 use Apache::DBI(); # !! :)
  
use DBD::mysql();...DBI-connect_on_init("DBI:mysql:dbname",   "user","pass",   {Options here}Join 18 million Eudora users by signing up for a free Eudora Web-Mail account at http://www.eudoramail.com



Join 18 million Eudora users by signing up for a free Eudora Web-Mail account at http://www.eudoramail.com






Re: Apache::DBI

2002-02-11 Thread Martin Haase-Thomas



Marty J. Rogers wrote:

[snip]
From httpd.conf:

PerlModule Apache::DBI CGI DBD::mysql \
Apache::AuthenDBI
PerlRequire /path/to/startup.pl

Alias /perl/ /path/to/perl
PerlModule Apache::Registry
Location /perl
SetHandler perl-script
PerlHandler Apache::Registry
Options ExecCGI
allow from all
PerlSendHeader On
/Location


and from startup.pl:

use DBI();

use Apache::DBI(); # !! :)


use DBD::mysql();
.
.
.
DBI-connect_on_init(DBI:mysql:dbname,
user,pass,
{Options here}


Join 18 million Eudora users by signing up for a free Eudora Web-Mail account at 
http://www.eudoramail.com






QUESTION

2002-02-06 Thread Martin Haase-Thomas




Hi all, 

I hope there'll be someone here to help we with a mod_perl prob, of 
which I thought first it wouldn't be one. I refer to the "Writing Apache 
Modules" book by Stein/MacEachern. 

The prob is quite simple: I have to redirect certain requests under 
certain conditions to another URL (and please believe me: I tried with 
mod_rewrite, this way seems to be more efficient). I'm using Apache 
1.3.22 on Debian Linux 2.4.17. 

These are the lines from my httpd.conf: 

 PerlFreshRestart On 
 PerlTaintCheck On 
 PerlSetEnv SHORTNAMES /etc/apache/shortnames.txt 
 PerlAddVar PROJECT_DOCUMENT_ROOT 
/home/disp05/app/fn/
 PerlRequire /usr/local/sbin/appstart 

 Location / 
 SetHandler perl-script 
 PerlHandler Apache::StaticServer 
 /Location 

The stanza in StaticServer.pm that fails is: 

if ($redirect = $shortnames-get($fname, WAIT, 1)) { 
 if ($redirect !~ /$r-server()-server_hostname/) { 
 $r-content_type('text/html'); 
 $r-header_out ( Location = $redirect ); $log-debug($redirect); 

 return REDIRECT; 
 } 
... 
} 

$shortnames is an Apache::SharedMem segment, containing a vast amount of 
shortnames as keys and the corresponding URLs as values. The funny thing 
is now, that although I do everything exactly as I find it in the book 
on p.125 (content_type, header_out, REDIRECT), I get pure nonsense. 

This is what a libwww-perl client displays when I try to access the address: 

500 (Internal Server Error) unexpected EOF before status line seen 
Client-Date: Wed, 06 Feb 2002 13:40:25 GMT 

This is what I find in access_log: 
192.168.255.75 - - [06/Feb/2002:14:46:24 +0100] "GET /psycho HTTP/1.0" 
200 - "-" "libwww-perl/5.50" 

And this is what stands in error_log: 
[Wed Feb 6 14:46:24 2002] [debug] 
/usr/local/share/perl/5.6.1/Apache/StaticServer.pm(45): [client 
192.168.255.75] 
http://www.domain.de/app/fn/portal_welcome_jsp/52329.html

The error log proves that the second if() matches, as the entry comes 
from my $log-debug(...). 

Has anyone got an idea? I'm close to depression -;) 

Many thanx in advance 
Martin 





Re: Make test issue with the URI module

2002-02-04 Thread Thomas Klausner

Hi!

On Sun, Feb 03, 2002 at 05:24:03PM -0800, Pierre Carette wrote:
 I am trying to install the latest version of Mod_perl (version 1.26) with
 Apache 1.3.23 on RedHat 7.2.
 
 When I tried the make test from the mod_perl installation I had an error
 saying that the module URI couldn't be found. I then downloaded and
 installed the URI module from cpan.org: URI-1.18 and now I get the following
 error:
 
 /usr/bin/perl t/TEST 0
 Can't locate object method new via package URI::URL at
 ../blib/lib/Apache/te
 st.pm line 252.
I ran into the same problem yesterday. I 'solved' it by adding
use URI::URL;
to blib/lib/Apache/test.pm

Does anyone know why this fails or how to fix it properly?

-- 
 D_OMM  +  http://domm.zsi.at -+
 O_xyderkes |   neu:  Arbeitsplatz   |   
 M_echanen  | http://domm.zsi.at/d/d162.html |
 M_asteuei  ++





Re: email attachments; was modperl growth

2002-02-02 Thread Thomas Eibner

On Sun, Feb 03, 2002 at 10:21:32AM +1100, Rod Butcher wrote:
 Folks, please don't send attachments, esp. with no explanation, it looks
 just like these deliberate virus attacks to me and I refuse to open any
 attachments unless I am personally familiar with the sender and know they
 know what they're doing. If it's plain text please embed it in the email,
 else provide a URL where one can download the attachment from.
 Yeah, I know, use Linux, don't use Outlook Express, .txt attachments are
 unlikely to contain virus, use antvirus software etc been there, done
 that, I'm sticking to my story.

Outlook Express has no clue on what to do with PGP signed messages? Which
is what it was. 

-- 
  Thomas Eibner http://thomas.eibner.dk/ DnsZone http://dnszone.org/
  mod_pointer http://stderr.net/mod_pointer !(C)http://copywrong.dk/
  Putting the HEST in .COM http://www.hestdesign.com/
  



Re: [QUESTION]PerlHandler and PerlLogHandler Phase

2002-02-01 Thread Thomas Klausner

Hi!

On Fri, Feb 01, 2002 at 10:24:24AM -0800, Mod Perl wrote:
 Here are the problems/Questions that I face:
 1. Since in this case each requests for a html file
 has multiple files that need to be downloaded by the
 client. Am I right to assume that the handler will act
 on each and every file requested file below my
 /en/course URI?
Add something like 
  return DECLINED unless $r-content_type() eq 'text/html';
near the top of your handler.

This way only html-documents get handled by your handler, the rest falls
through to the default apache handler.


-- 
 D_OMM  +  http://domm.zsi.at -+
 O_xyderkes |   neu:  Arbeitsplatz   |   
 M_echanen  | http://domm.zsi.at/d/d162.html |
 M_asteuei  ++



Re: disable mod_perl for certain virtual hosts/folders

2002-01-22 Thread Thomas Klausner

Hi!

On Tue, Jan 22, 2002 at 03:02:58PM +0100, [EMAIL PROTECTED] wrote:
 only pl-files are affected. Unfortunately I have some pl-files that
 must not run under mod_perl (even not under PerlRun cause they are
 really dirty) and I wonder if there is no way to set the orginal
 cgi-handler (that does not use mod_perl) for a certain
 location/virtual host.
 I thought this default-handler is cgi-script, but 
 
 SetHandler cgi-script
 
 in a virtual host does not do the trick.
What about 

Location /plain-cgi/
SetHandler cgi-script
Options ExecCGI
allow from all
/Location
 

-- 
 D_OMM  +  http://domm.zsi.at -+
 O_xyderkes |   neu:  Arbeitsplatz   |   
 M_echanen  | http://domm.zsi.at/d/d162.html |
 M_asteuei  ++





Re: Cross-site Scripting prevention with Apache::TaintRequest

2002-01-22 Thread Thomas Eibner

On Tue, Jan 22, 2002 at 09:25:15AM -0800, Paul Lindner wrote:
 Hi,
 
 I thought it might be interesting to start a thread on cross-site
 scripting attacks, since it seems that many people are not aware of
 the risks involved.  Has anyone noticed attacks on their applications?
 Do you religiously check all input you get from form-submissions?
 What techniques do you use to insure that your application is not
 vulnerable?

I've been pondering a lot about this lately, since I find creating
form validation routines very repetitive. So what I've come up with
so far is (not yet finished):

my $fields = {
  id = ['\d+', \validation_sub ],
  text = ['(?:\w\s)+']
  };

And I feed this along with the request or cgi object to a function
that checks each key for first the simple regexp to see if it's worth
trying the real validation function.
My little system for doing this isn't 

All the variables that are passed through form fields into other pages
goes through HTML::Entities' encode_entites function right before it's
inserted in a template.

-- 
  Thomas Eibner http://thomas.eibner.dk/ DnsZone http://dnszone.org/
  mod_pointer http://stderr.net/mod_pointer 




Perl based Authentication on Apache

2002-01-20 Thread Thomas . Waelde

Dear addressed,

pls, provide.

i want to use the Perl-based Authentication Module
 Apache::authDBI
written by Edmund Mergl.
This is tested with
 Apache 1.3.6
 Mod_perl 1.21

However i want to use it with
 Apache 2.0.30
 Mod_perl 2.0

This is configured on the System with:

httpd.conf:

LoadModule perl_module modules/libmodperl.so

Perlhandler  Apache::AuthDBI

ScriptAlias /ro-euma/ /home/admin/ro-euma/

Directory /home/admin/ro-euma
AllowOverride All
SetHandler Apache::AuthDBI::authen
Options ExecCGI Includes
Order allow,deny
Allow from all
/Directory


And in the corresponding .htaccess-File:
==
AuthName RO-EUMA CSF
AuthType Basic

PerlHandler Apache::AuthDBI::authen
PerlSetVar Auth_DBI_data_source dbi:Pg:dbname=roeuma

PerlSetVar Auth_DBI_username  admin
PerlSetVar Auth_DBI_password  sita_fra
# DBI-connect($data_source, $username, $password)

PerlSetVar Auth_DBI_pwd_table login
PerlSetVar Auth_DBI_uid_field username
PerlSetVar Auth_DBI_pwd_field passwd
#SELECT pwd_field FROM pwd_table WHERE uid_field=$user

require user twaelde
=

Trying this i got the error-message inside the error log from Apache:
 configuration error: couldn't check user. No user file?:
/ro-euma/index.pl

i guess Apache does not access this AuthenticationHandler and requires
something like a htpaaswd.

Pls, what must i do to correct this ?

Thks for every help in advance n Bgrds
Thomas





ANNOUNCE: CGI::URI2param 1.00

2002-01-07 Thread Thomas Klausner

Hi!

The URL

http://domm.zsi.at/source_code/modules/CGI-URI2param-1.00.tar.gz

has entered CPAN as

  file: $CPAN/authors/id/D/DO/DOMM/CGI-URI2param-1.00.tar.gz
  size: 4133 bytes
   md5: 2b216c471242e72dbcfc73059431756e

The main thing that changed is that I included Apache::URI2param, a
PerlInitHandler. 

From the README:

CGI::URI2param - convert parts of an URL to param values

DESCRIPTION

CGI::URI2param takes a request object (as supplied by CGI.pm or
Apache::Request) and a hashref of keywords mapped to
regular expressions. It applies all of the regexes to the current URI
and adds everything that matched to the 'param' list of the request
object.

Why?

With CGI::URI2param you can instead of:

 http://somehost.org/db?id=1234style=fancy
 
 present a nicerlooking URL like this:
 
  http://somehost.org/db/style_fancy/id1234.html
  
To achieve this, simply do:
  
   CGI::URI2param::uri2param($r,{
 style = 'style_(\w+)',
 id= 'id(\d+)\.html'
   });
   
Now you can access the values like this:
   
my $id=$r-param('id');
my $style=$r-param('style');
 
If you are using mod_perl, please take a look at Apache::URI2param.
It provides an Apache PerlInitHandler to make running CGI::URI2param
easier for you. Apache::URI2param is distributed along with
CGI::URI2param.


-- 
 D_OMM  +  http://domm.zsi.at -+
 O_xyderkes |   neu:  Arbeitsplatz   |   
 M_echanen  | http://domm.zsi.at/d/d162.html |
 M_asteuei  ++





Re: Fast template system. Ideas,theorys and tools

2002-01-01 Thread Thomas Eibner

On Tue, Jan 01, 2002 at 03:02:23PM -0500, Jason Czerak wrote:
 I looked at just about every template system on CPAN and came across
 text::template. Anyone use this one? I don't require if/then's within
   ^
A template system should (IMO) do exactly that. The logic shouldn't be
embedded in the templates. That's why I settled on CGI::FastTemplate
(Yes, yet another templating system). 

 the template. Infact all I really need are call backs to an API that I
 am currently developing. And in the case that I do need if/then's. I can
 use pure perl within the template. Even do SQL queries with-in the
 template, or not even use the API at all if I wanted to.

I don't want any code/sql in my templates, and it works out fine that
way for whatever project I do. And it's certainly easier for the
project's webdesigner to gasp when there's no code they can break by
using whatever windows-app they want to use to edit their html.

I tried Mason and other of the more featurefull template systems out there
but I always ended up going back to CGI::FastTemplate.

my $cent = 2; # on templates

-- 
  Thomas Eibner http://thomas.eibner.dk/ DnsZone http://dnszone.org/
  mod_pointer http://stderr.net/mod_pointer 




Re: irc

2001-12-24 Thread Thomas Eibner

On Sat, Dec 22, 2001 at 09:29:00PM -0800, brian moseley wrote:
 hmm.. i went to #take23 on openprojects and there were 3
 people idling. i went to #perl on rhizomatic and there heaps
 of people. so i vote for rhizomatic.
 
 i'm not a huge fan of #take23, i'd rather see #modperl, but

Why don't we do that then? on irc.rhizomatic.net

-- 
  Thomas Eibner http://thomas.eibner.dk/ DnsZone http://dnszone.org/
  mod_pointer http://stderr.net/mod_pointer 




Re: irc

2001-12-22 Thread Thomas Eibner

On Sat, Dec 22, 2001 at 12:25:51PM -0800, Cure wrote:
 On irc.dal.net, theres a #mod_perl, Nobody goes there anyomore, But we all
 could start joining it.

Please, no more networks =) I think something like #modperl would be
appropriate on rhizomatic, but it's not up to me.

-- 
  Thomas Eibner http://thomas.eibner.dk/ DnsZone http://dnszone.org/
  mod_pointer http://stderr.net/mod_pointer 




  1   2   3   >