[ANNOUNCE] HTTP-WebTest 2.04

2003-09-05 Thread Ilya Martynov
The URL

http://martynov.org/tgz/HTTP-WebTest-2.04.tar.gz

has entered CPAN as

  file: $CPAN/authors/id/I/IL/ILYAM/HTTP-WebTest-2.04.tar.gz
  size: 90381 bytes
   md5: 16bfb8e76bf301e788241d774cab7cee


NAME
HTTP::WebTest - Testing static and dynamic web content

DESCRIPTION

This module runs tests on remote URLs containing
Perl/JSP/HTML/JavaScript/etc. and generates a detailed test report. This
module can be used "as-is" or its functionality can be extended using
plugins. Plugins can define test types and provide additional report
capabilities. This module comes with a set of default plugins but can be
easily extended with third party plugins.


CHANGES SINCE 2.03:

BUG FIXES:

* ReportPlugin.pm had a bug that it sended out email report even if
mail parameter was set to "errors" and all tests passed.  Thanks to
Naoki Shima for a patch.


-- 
Ilya Martynov,  [EMAIL PROTECTED]
CTO IPonWEB (UK) Ltd
Quality Perl Programming and Unix Support
UK managed @ offshore prices - http://www.iponweb.net
Personal website - http://martynov.org



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



[ANNOUNCE] HTTP-WebTest 2.03

2003-07-14 Thread Ilya Martynov

The URL

http://martynov.org/tgz/HTTP-WebTest-2.03.tar.gz

has entered CPAN as

  file: $CPAN/authors/id/I/IL/ILYAM/HTTP-WebTest-2.03.tar.gz
  size: 90135 bytes
   md5: cc49ade2d6955fa20dd30b1f88862943



NAME
HTTP::WebTest - Testing static and dynamic web content

DESCRIPTION

This module runs tests on remote URLs containing
Perl/JSP/HTML/JavaScript/etc. and generates a detailed test report. This
module can be used "as-is" or its functionality can be extended using
plugins. Plugins can define test types and provide additional report
capabilities. This module comes with a set of default plugins but can be
easily extended with third party plugins.



CHANGES SINCE LAST STABLE VERSION 2.02:

ENHANCEMENTS:

* New test parameters 'mail_success_subject' and
'mail_failure_subject' to redefine default value of Subject field in
test report emails.  Based on patch by Amit Kaul.

BUG FIXES:

* HTTP::WebTest used to mangle test URLs like
'http://website.com?http://website2.com?var=val' by URL escaping
everything after the first question mark. Now it does modify test URL
unless it is doing GET request and test parameter 'params' is
specified in a test specification.  Thanks to Brian Webb for a
bugreport.


-- 
Ilya Martynov,  [EMAIL PROTECTED]
CTO IPonWEB (UK) Ltd
Quality Perl Programming and Unix Support
UK managed @ offshore prices - http://www.iponweb.net
Personal website - http://martynov.org



Re: [ANNOUNCE] HTTP-WebTest 2.02

2003-03-24 Thread Ilya Martynov

The URL

http://martynov.org/tgz/HTTP-WebTest-2.02.tar.gz

has entered CPAN as

  file: $CPAN/authors/id/I/IL/ILYAM/HTTP-WebTest-2.02.tar.gz
  size: 87462 bytes
   md5: 20478775a4bafb6c5cad2ca1fcd4e9ea


NAME
HTTP::WebTest - Testing static and dynamic web content

DESCRIPTION

This module runs tests on remote URLs containing
Perl/JSP/HTML/JavaScript/etc. and generates a detailed test report. This
module can be used "as-is" or its functionality can be extended using
plugins. Plugins can define test types and provide additional report
capabilities. This module comes with a set of default plugins but can be
easily extended with third party plugins.



CHANGES SINCE LAST STABLE VERSION 2.01:

BUG FIXES:

* Fixed bug when test reports were not send when multiple email
addresses were specified as test report recipients (test parameter
'mail_addresses').  Thanks to Amit Kaul for a bugreport and a patch.

* New versions of LWP add Client-Peer header in all responses what
breaks one of tests in the self-testing suite.  This test was supposed
to be fixed by the previous release but apparently it wasn't.


-- 
Ilya Martynov,  [EMAIL PROTECTED]
CTO IPonWEB (UK) Ltd
Quality Perl Programming and Unix Support
UK managed @ offshore prices - http://www.iponweb.net
Personal website - http://martynov.org


Re: Cross Site Scripting

2003-03-11 Thread Ilya Martynov
>>>>> On 11 Mar 2003 10:58:01 +0200, Clinton Gormley <[EMAIL PROTECTED]> said:

CG> On Tue, 2003-03-11 at 06:03, Stas Bekman wrote:
CG>   Changes since 0.7

CG> * prevent cross-site scripting, now HTML-escaping the request field

CG> In Stas' Apache::VMonitor announcement, he mentions changes to
CG> prevent cross site scripting.

CG> This is a concern for me at the moment, because I'm building a
CG> site which will allow people to submit copy (to be displayed to
CG> other users) and I would like them to be able to use HTML and
CG> include links to other sites (much like slashdot).

CG> Do any of you have any ideas about good techniques to prevent CSS
CG> (and I don't mean those  elements) in this scenario?

Limit HTML to some safe subset and use HTML::TagFilter to enforce it.

Make sure that you don't allow tag attributes which allow running
javascript (like onclick, onchange, etc). The only problem with
HTML::TagFilter I see is that it doesn't support restricting schemas
in URIs. You definetely should not allow links like



But maybe it is possible to extend HTML::TagFilter to do this too.

-- 
Ilya Martynov,  [EMAIL PROTECTED]
CTO IPonWEB (UK) Ltd
Quality Perl Programming and Unix Support
UK managed @ offshore prices - http://www.iponweb.net
Personal website - http://martynov.org



Re: How to figure out with what options a mod_perl is built

2003-03-02 Thread Ilya Martynov
>>>>> On Sun, 02 Mar 2003 14:47:12 +0100, Feite Brekeveld <[EMAIL PROTECTED]> said:

FB> Hi,
FB> Is there a way, like PHP has   , to figure out with
FB> what options a standard  linux distribution mod_perl is built ?

FB> I would like to know if it was built with EVERYTHING=1 or if
FB> PERL_CHILD_INIT=1

You can use Apache::Status. See its perldoc for details.

-- 
Ilya Martynov,  [EMAIL PROTECTED]
CTO IPonWEB (UK) Ltd
Quality Perl Programming and Unix Support
UK managed @ offshore prices - http://www.iponweb.net
Personal website - http://martynov.org



[ANNOUNCE] HTTP-WebTest 2.01

2003-03-02 Thread Ilya Martynov
The URL

http://martynov.org/tgz/HTTP-WebTest-2.01.tar.gz

has entered CPAN as

  file: $CPAN/authors/id/I/IL/ILYAM/HTTP-WebTest-2.01.tar.gz
  size: 87180 bytes
   md5: d48ea08bd9bb7e4dca52d266f632672f


NAME
HTTP::WebTest - Testing static and dynamic web content

DESCRIPTION

This module runs tests on remote URLs containing
Perl/JSP/HTML/JavaScript/etc. and generates a detailed test report. This
module can be used "as-is" or its functionality can be extended using
plugins. Plugins can define test types and provide additional report
capabilities. This module comes with a set of default plugins but can be
easily extended with third party plugins.



CHANGES SINCE LAST STABLE VERSION 2.00:

ENHANCEMENTS:

* Port self-testing suite from Test to Test::More.

* HTTP::WebTest allows to specify non-default parser for wtscript
files.

* Now HTTP::WebTest::Parser can generate wtscript files from test
parameters.

DEPRECATIONS:

* Subroutines 'start_webserver' and 'stop_webserver' was moved from
HTTP::WebTest::SelfTest to HTTP::WebTest::Utils.  They still can be
exported from HTTP::WebTest::SelfTest but their usage from this module
is deprecated.

BUG FIXES:

* New versions of LWP add Client-Peer header in all responses what
breaks one of tests in self-testing suite. This test is fixed so it
should pass ok with both new and old versions of LWP.  Thanks to
Johannes la Poutre for bug report.

* Test in self-testing suite for 'timeout' parameter was buggy and
could fail on some machines.  Thanks to Johannes la Poutre for bug
report.

* HTTP::WebTest::Plugin::HarnessReport produced report output on
STDERR what was adding noise in 'make test' output when being used in
Test::Harness-style test suites.


-- 
Ilya Martynov,  [EMAIL PROTECTED]
CTO IPonWEB (UK) Ltd
Quality Perl Programming and Unix Support
UK managed @ offshore prices - http://www.iponweb.net
Personal website - http://martynov.org



[ANNOUNCE] HTTP-WebTest 2.00

2002-12-14 Thread Ilya Martynov
The URL

http://martynov.org/tgz/HTTP-WebTest-2.00.tar.gz

has entered CPAN as

  file: $CPAN/authors/id/I/IL/ILYAM/HTTP-WebTest-2.00.tar.gz
  size: 85858 bytes
   md5: e93464263f7cd321c8b43fa7c73604e0

NAME
HTTP::WebTest - Testing static and dynamic web content

DESCRIPTION

This module runs tests on remote URLs containing
Perl/JSP/HTML/JavaScript/etc. and generates a detailed test report. This
module can be used "as-is" or its functionality can be extended using
plugins. Plugins can define test types and provide additional report
capabilities. This module comes with a set of default plugins but can be
easily extended with third party plugins.



MAJOR CHANGES SINCE LAST STABLE VERSION 1.07:

* This is full rewrite which features modular easily expendable
  architecture: new test types can be added with plugin modules.

* Support for Test::Harness style testing have been added.

* Many new standart test types have been added.

* Support for local file test mode have been removed from this version
  and will be implemented in plugin which will be released separately.

* Licensing terms have been changed from Artistic only and now
  HTTP-WebTest is dual licensed under Artistic/GPL.

* Many other changes I forgot to mention :)



CHANGES SINCE LAST BETA VERSION 1.99_09:

ENHANCEMENTS:

* Allow plugins to insert tests into the test queue during test
sequence runtime.  Inspired by Paul Hamingson's patch.

* New core test parameter 'relative_urls' which enables HTTP-WebTest
to use relative URLs in tests.

* New core test parameter 'timeout' which allows to control user agent
timeout settings while running test sequence.

* Moved self-test suite support code into module
HTTP::WebTest::SelfTest to allow reusing it in self-test suites for
plugins maintained outside of HTTP-WebTest.

INCOMPATIBILITIES:

* HTTP::WebTest::Plugin::Apache plugin have been removed from
HTTP::WebTest and will be released as independent CPAN module.  It
will no longer be loaded by default even if it is available.

* Renamed all last_xxx methods to current_xxx since the latest naming
schema is less confusing.

* HTTP::WebTest::Plugin::HarnessReport is rewritten using
Test::Builder. As side effect now you can freely intermix
HTTP::WebTest based tests with tests written using other testing
libraries like Test::More or Test::Differences. Unfortunately this
change breaks existing test scripts which were using
HTTP::WebTest::Plugin::HarnessReport because now number of tests in
test scripts should be declared explictly with 'use Test::More plan =>
NN' or 'use Test::More qw(no_plan)'.

BUG FIXES:

* Fixed some minor documentation bugs.  Thanks to William McKee.

* Allow to use $webtest->last_xxx method calls after running test
sequence with $webtest->run_tests.  Thanks to Kevin Baker for patch.


-- 
Ilya Martynov,  [EMAIL PROTECTED]
CTO IPonWEB (UK) Ltd
Quality Perl Programming and Unix Support
UK managed @ offshore prices - http://www.iponweb.net
Personal website - http://martynov.org




Re: 0x444ba45b in prof_mark () from/usr/lib/perl5/5.6.1/i686-linux/auto/Devel/DProf/DProf.so

2002-12-07 Thread Ilya Martynov
>>>>> On Sat, 7 Dec 2002 19:58:40 -, "Richard Clarke" <[EMAIL PROTECTED]> said:

RC> List,
RC> I seem to have hit a slight stumbling block in my mod_perl development.
RC> Without wanting to write a whole essay on the exact combination of events
RC> that causes this segv to happen I'll just say for now that it happens after
RC> my custom Template::Provider returns a status indicating a template could
RC> not be found. My apache error log indicates that the segv happens
RC> immediately after my contenthandler returns SERVER_ERROR.
RC> As you can see from the topic, the segv happens in the DProf library. I have
RC> listed the gdb output at the end of my email.
RC> My question is simply, is this a mod_perl problem, a template toolkit
RC> problem or a problem somewhere in the dprof library?.

Likely it is Dprof's problem. 

RC> If I really need to use Apache::DProf then I'll just avoid requesting
RC> templates that don't exist. I'm still curious however, as to whether there
RC> is a more sinister problem waiting to cause my problems in the future.
RC> Any advice? Has anyone else ever experienced a code path which causes a
RC> similar segv in dprof?

Many times. Apache::DProf happily segfaults on any non-trivial
program.

-- 
Ilya Martynov,  [EMAIL PROTECTED]
CTO IPonWEB (UK) Ltd
Quality Perl Programming and Unix Support
UK managed @ offshore prices - http://www.iponweb.net
Personal website - http://martynov.org




Re: IPC::Open2, mod_perl and cvsweb

2002-11-26 Thread Ilya Martynov
>>>>> On Mon, 25 Nov 2002 23:01:44 -0500, Geoffrey Young <[EMAIL PROTECTED]> 
>said:

>>> 
>>> Look in archives. I think many people had problems with IPC::Open2
>>> under mod_perl. So far the best solution I know is just replacing it
>>> with IPC::Run.
>> Seconded. Go with IPC::Run and you won't regret, since it works
>> under mod_perl and gives you much more than the IPC::Open* family.

GY> IPC::Run++

Question about IPC::Open2 under mod_perl seems to arise quite
frequently. Maybe it should be added to mod_perl guide in 'Frequent
mod_perl problems' section.

-- 
Ilya Martynov,  [EMAIL PROTECTED]
CTO IPonWEB (UK) Ltd
Quality Perl Programming and Unix Support
UK managed @ offshore prices - http://www.iponweb.net
Personal website - http://martynov.org




Re: IPC::Open2, mod_perl and cvsweb

2002-11-25 Thread Ilya Martynov
>>>>> On Mon, 25 Nov 2002 18:27:54 +0900, Keith Watanabe <[EMAIL PROTECTED]> 
>said:

KW> Hi!

KW> I was wondering if there are any known issues regarding IPC::Open2
KW> with mod_perl.

Look in archives. I think many people had problems with IPC::Open2
under mod_perl. So far the best solution I know is just replacing it
with IPC::Run.

KW> [..snip..]

-- 
Ilya Martynov,  [EMAIL PROTECTED]
CTO IPonWEB (UK) Ltd
Quality Perl Programming and Unix Support
UK managed @ offshore prices - http://www.iponweb.net
Personal website - http://martynov.org




Fwd: Re: evil scripts kill the server...

2002-10-17 Thread Ilya Martynov


Oops, forgot to reply to list.

To: Eric Cholet <[EMAIL PROTECTED]>
Subject: Re: evil scripts kill the server...
From: Ilya Martynov <[EMAIL PROTECTED]>

>>>>> On Thu, 17 Oct 2002 14:09:17 +0200, Eric Cholet <[EMAIL PROTECTED]> said:

EC> Yes, please explain how careless programming practice can make root
EC> access available to the world. Apache by default runs under the
EC> unpriviliged user 'nobody', seems to me that giving root access to
EC> the world would require running Apache as root, not something which
EC> can be achieved only by careless programming. Am I missing something?

Often Apache is started as root initially (to let it bind low number
ports like 80) and later switches to other UID to serve client
requests. One implication of this scheme is that when Perl modules are
preloaded during Apache startup Apache runs as root. So some
programming errors in code which is preloaded combined with such setup
actually may lead to root exploit.

Though it should be hard to exploit as normally client requests don't
affect startup stage and thus cannot interact potentially insecure
code.

-- 
Ilya Martynov,  [EMAIL PROTECTED]
CTO IPonWEB (UK) Ltd
Quality Perl Programming and Unix Support
UK managed @ offshore prices - http://www.iponweb.net
Personal website - http://martynov.org




Re: mod_perl statistics on securityspace.com

2002-09-10 Thread Ilya Martynov

>>>>> On Tue, 10 Sep 2002 09:53:50 -0700, "Rodney Broom" <[EMAIL PROTECTED]> said:

RB> From: Ilya Martynov <[EMAIL PROTECTED]>
IM> (frankly Safe.pm is a joke).

RB> Now this thread has taken my interest. Ilya, would you care to
RB> expound on this statement? I'm planning to use Safe in production
RB> soon.

Try to implement something that works with database and files inside
of Safe compartment. Either you will have to allow too much or your
code will not work because of restrictions.

Somewhat related reading:

http://www.perlmonks.com/index.pl?node_id=166096

-- 
Ilya Martynov (http://martynov.org/)



Re: mod_perl statistics on securityspace.com

2002-09-10 Thread Ilya Martynov

>>>>> On Tue, 10 Sep 2002 12:14:32 -0400, Perrin Harkins <[EMAIL PROTECTED]> said:

PH> Mark Coffman wrote:
>> I can't imagine that mod_perl will ever be the major "scripting" language
>> since it, by nature, is unrestrictive.  On a multi-user/multi-host server, I
>> think I'd rather PHP be run than mod_perl, simply because I don't want sites
>> stepping on each other's toes and have to worry about restarting httpd.

PH> Isn't PHP just as dangerous as mod_perl when run in the server process
PH> (as opposed to CGI mode) on a multi-user virtual host server?

As I understand PHP have better support for "sandboxing" than Perl
(frankly Safe.pm is a joke).

-- 
Ilya Martynov (http://martynov.org/)



Re: [OT] HTML to XHTML conversion

2002-08-28 Thread Ilya Martynov

>>>>> On Wed, 28 Aug 2002 10:07:07 +0100, Jean-Michel Hiver <[EMAIL PROTECTED]> said:

JM>  is not valid XHTML for example.
JM>  is not valid XHTML either.
JM> You have to be careful about block-level and inline elements.

Actually  is valid XHTML.

Correct me if I'm wrong but AFAIK  is exactly equivalent to
.

something is not valid.

JM> etc. etc...

JM> Besides, you cannot use an XML parser to parse HTML. You have to use
JM> something like HTML::TreeBuilder instead. Part of HTML::Tree, excellent
JM> module IMHO.

XML::LibXML supports HTML too.

-- 
Ilya Martynov (http://martynov.org/)



Re: @INC

2002-07-29 Thread Ilya Martynov

>>>>> On Mon, 29 Jul 2002 13:43:13 +0400, "Ruslan V. Sulakov" <[EMAIL PROTECTED]> said:

RVS> My @INC contains WRONG directories!!! Help!
RVS> How can I change @INC in perl for installing of Apache::SubProcess and other
RVS> modules?
RVS> At this time I cannot install any Apache::* related modules, because of bad
RVS> @INC

RVS> Platform: FreeBSD

RVS> I have Apache::* modules installed in:
RVS> /usr/local/lib/perl5/site_perl/5.6.1/mach/Apache/

RVS> But I cannot install needed modules:
RVS> oasis2# tar -zxf Apache-SubProcess-0.03.tar.gz
RVS> oasis2# cd Apache-SubProcess-0.03
RVS> oasis2# perl Makefile.PL
RVS> Can't locate Apache/src.pm in @INC (@INC contains: ../lib
RVS> /usr/libdata/perl/5.00503/mach /
RVS> usr/libdata/perl/5.00503 /usr/local/lib/perl5/site_perl/5.005/i386-freebsd
RVS> /usr/local/lib/
RVS> perl5/site_perl/5.005 .) at Makefile.PL line 4.
RVS> BEGIN failed--compilation aborted at Makefile.PL line 4.
RVS> oasis2#

Looks like your sys admin had installed perl from core and from ports
and as result you have two perl installation on systems. Perl from
core (5.00503) likely to have is binary in /usr/bin/perl and perl from
ports (5.6.1) in /usr/local/bin/perl.

If your PATH doesn't have /usr/local/bin or it comes after /usr/bin
than 'perl Makefile.PL' uses perl from core. Try either changing your
PATH or using full path to perl (i.e. /usr/local/bin/perl
Makefile.PL).

-- 
Ilya Martynov (http://martynov.org/)



Re: Static vs. DSO on Linux specifically

2002-07-22 Thread Ilya Martynov

>>>>> On 22 Jul 2002 10:26:32 -0500, David Dyer-Bennet <[EMAIL PROTECTED]> said:

DD> I've seen a lot of comments which seem to me to say that a static
DD> mod_perl is the "only way to go".  

I've been using mod_perl as DSO for more than one year (or even maybe
two) without any problems on FreeBSD/Linux/Intel.  My understanding is
that there was some problems in the past and there are still some
issues on some platforms but Linux/Intel platform is "safe".

DD> But Redhat ships it as a DSO.  

DD> Now, on the one hand, I wouldn't just automatically assume that Redhat
DD> knew what they were doing.

I would not trust RedHat to much to do right thing with Perl. They are
know to produce broken mod_perl packages in the past for example.

DD> [..snip..]

-- 
Ilya Martynov (http://martynov.org/)



Re: relative path not accepted in mod_perl2 ?

2002-07-16 Thread Ilya Martynov

>>>>> On Tue, 16 Jul 2002 16:30:16 +0200, [EMAIL PROTECTED] said:

P> just found out the "deeper" reason - mod_perl now always has path="/"
P> which is unexpected behaviour. While I can filter out the actual path
P> from the cgi-environment I dont understand this ..

See

[EMAIL PROTECTED]">http://mathforum.org/epigone/modperl/smansheezhing/[EMAIL PROTECTED]

-- 
Ilya Martynov (http://martynov.org/)



Re: sections

2002-07-08 Thread Ilya Martynov

>>>>> On Mon, 08 Jul 2002 18:39:04 +0400, Mike Blazer <[EMAIL PROTECTED]> said:

MB> Hi All,

MB> [..snip..]

MB> Well, the question is, what if I'll load mod_perl only for 
MB> section parsing and generating the dynamic config with
MB> Apache-> httpd_conf method, and no real mod_perl locations - would this
MB> still make server childs much bigger then without mod_perl?

Yes, it will.

MB> [..snip..]

MB> Or may be there is some way to un-load mod_perl after  sections
MB> processing?

If you need  sections only to do initial web server
configuration and you do not need mod_perl features in runtime then
instead of using  just write Perl script to generate Apache
config file from templates and run it before starting Apache. This way
you do not need mod_perl on frontend Apache at all.

-- 
Ilya Martynov (http://martynov.org/)



Re: [OT] Re: Apache Web Server vulnerability

2002-06-21 Thread Ilya Martynov

>>>>> On Fri, 21 Jun 2002 14:06:45 -0400, Philip Mak <[EMAIL PROTECTED]> said:

PM> On Fri, Jun 21, 2002 at 05:31:00AM -0700, Ask Bjoern Hansen wrote:
>> 64bit binaries are exploitable.  There are also exploits for several
>> 32bit systems.

PM> Does anyone know if Red Hat Linux 7.2 on i686 is vulnerable to the
PM> remote shell (not the DoS) exploit?

Very likely. While most advisories claimed that it is imposible to
exploit it on 32bit architectures later there was posted working
exploit for x86 port of OpenBSD. Author of exploit claimed that he
have been able to exploit Linux, FreeBSD and Solaris too. Though
exploits for these platforms have not been published (yet).

-- 
Ilya Martynov (http://martynov.org/)



Re: separating C from V in MVC

2002-06-06 Thread Ilya Martynov

>>>>> On Thu, 6 Jun 2002 20:15:24 -0600, Rob Nagler <[EMAIL PROTECTED]> said:

>> (http://sourceforge.net/projects/poop/).

RN> Great, another mailing list. :-)  Thanks.

It is not just mailing list. Don't miss
http://poop.sourceforge.net/. It has nice review of most Perl OO
persistence modules.

-- 
Ilya Martynov (http://martynov.org/)



Re: GTop

2002-05-21 Thread Ilya Martynov

>>>>> On Tue, 21 May 2002 19:57:35 -0500, Gregory Matthews <[EMAIL PROTECTED]> said:

GK> [..snip..]

GK> My glib-config directory is /usr/local/bin and the name of the actual
GK> file is glib12-config.

GK> How can I tell GTop where this file is and what the actual file name
GK> is? Don't ask me why my server named it that way, but when doing ### a
GK> %locate glib command, I get (you'll see the glib12-config file down
GK> towards the bottom):

Just patch Makefile.PL of GTop. Replace string glib-config with
glib12-config in top level Makefile.PL and in Server/Makefile.PL

-- 
Ilya Martynov (http://martynov.org/)



Re: Permission conflict between mod_cgi and mod_perl

2002-03-25 Thread Ilya Martynov

>>>>> On Mon, 25 Mar 2002 15:17:06 -0600, James G Smith <[EMAIL PROTECTED]> said:

JS> And the sky isn't blue, but the results are the same.

JS> mod_perl can't run scripts.

JS> Scripts can be run from mod_perl.

JS> More than that, set-uid scripts can be run from mod_perl and offer
JS> one of the better ways of doing things that require root privileges.

Results are not same. Basically Apache::Registry (handler used with
mod_perl to emulate execution of scripts) just opens file which
contains script, evals it as big subroutine and calls that
subroutine. Opening and reading set-uid file which contains script
doesn't give automagically root rights to instance of apache process
which handles request.

-- 
oIlya Martynov => http://martynov.org/o
oTIV.net   => http://tiv.net/ o



Re: Non-web use for Apache/mod_perl

2002-03-21 Thread Ilya Martynov

>>>>> On Thu, 21 Mar 2002 00:40:24 +0100, Bas A.Schulte <[EMAIL PROTECTED]> said:

BAS> To handle a large number of concurrent transactions in a
BAS> transaction-safe environment without me having to worry too much about
BAS> concurrency issues and referential integrity I will slowly move to
BAS> Oracle. $dbh->do('LOCK TABLE USER, INSTANCE, APP_DATA') just plain
BAS> sucks unless you want to create a very large distributed *single-user*
BAS> system running on multiple machines.

Without changing SQL backend you can have transactions with
MySQL. Just use InnoDB table type. It is faster than default table
type for read/write intensive applications because it doesn't lock
whole tables but provides Oracle style row-level locking.

-- 
oIlya Martynov => http://martynov.org/o
oTIV.net   => http://tiv.net/ o



Re: ANNOUNCE: HTTP::TestEngine v0.02

2002-01-29 Thread Ilya Martynov

>>>>> On Tue, 29 Jan 2002 13:03:56 -0600 (CST), Dave Rolsky <[EMAIL PROTECTED]> said:

DR> On Tue, 29 Jan 2002, Chris Brooks wrote:
>> I have released version 0.02 of HTTP::TestEngine to sourceforge.
>> TestEngine acts as an http session "recorder".  After setting a cookie,
>> a user can "record" a session by simply clicking links in their browser:
>> filenames, paths and parameters are written to the filesystem for recall
>> in the future.  Session data is stored in test harness-independent
>> format, and a second module, HTTP::SessionConfig is responsible for
>> converting the session data into a data structure that is appropriate
>> for play-back.  HTTP::Monkeywrench is currently supported, with plans
>> for HTTP::WebTest support in the future.

DR> This is funny.  I was working on something very similar recently.  It was
DR> designed to be able to work with both vanilla CGI and mod_perl (via
DR> Apache::Filter).  It's more cross-platform that your current code and also
DR> records a lot more info.  Maybe we can work together to integrate our
DR> code.  We can probably talk more off the list.

I quite interested in this project also (as maintainer of
HTTP::WebTest :). Something like HTTP::TestEngine which can record
tests for HTTP::WebTest was in my TODO for a long time. I just had no
time for it ;(

-- 
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Ilya Martynov (http://martynov.org/)  TIV.net (http://tiv.net/) |
| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80  E4AE BE1A 53EB 323B DEE6 |
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-



Re: Strange Apache 2.0 rewrite/proxy issue

2002-01-03 Thread Ilya Martynov

>>>>> On Thu, 3 Jan 2002 11:26:18 -0800, John Armstrong <[EMAIL PROTECTED]> said:

John> This 'seems' to be a modperl issue.
John> My configuration. I needed a 1.1 compliant reverse proxy in order to
John> support Chunked encoding for an xml gateway.

John> Since only Apache 2.0 has a 1.1 compliant reverse proxy I replaced my
John> Apache 1.3.14 standard apache wth an Apache 2.0.28 with the proxy
John> support compiled in.

You can try oops[1] also. It is a HTTP 1.1 proxy.

[1] http://zipper.paco.net/~igor/oops.eng/

-- 
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Ilya Martynov (http://martynov.org/)  TIV.net (http://tiv.net/) |
| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80  E4AE BE1A 53EB 323B DEE6 |
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-



Re: Why libperl.so?

2001-11-28 Thread Ilya Martynov

>>>>> On Thu, 29 Nov 2001 09:02:35 +0400, "BeerBong" <[EMAIL PROTECTED]> said:

BB> Sorry, it is necessary for mod_perl now ?
BB> I want to compile statically as many modules as I can.

But why?

-- 
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Ilya Martynov (http://martynov.org/)  TIV.net (http://tiv.net/) |
| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80  E4AE BE1A 53EB 323B DEE6 |
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-



Re: Apache::Session Problem

2001-11-21 Thread Ilya Martynov

>>>>> On Wed, 21 Nov 2001 22:49:46 -, "Jonathan M. Hollin" 
><[EMAIL PROTECTED]> said:

Jonathan> Fellow Perl Mongers,
Jonathan> Can anyone help with my latest programming riddle?

Jonathan> I am trying to take advantage of the session-handling
Jonathan> features of Apache::Session.  My program includes the
Jonathan> following code (line numbers added for clarity):

Jonathan> 20: # Session handler (I)...
Jonathan> 21: use Apache::Session::DBI;

Jonathan> [..skip..]

Jonathan> Platform:  Win2K, Apache, mod_perl, MySQL...

Jonathan> Any suggestions (apart from quit programming and take up
Jonathan> farming instead)?

I'm not sure why your code doesn't work but why are you using such old
Apache::Session? Take new Apache::Session which provides MySQL support
via Apache::Session::MySQL.

-- 
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Ilya Martynov (http://martynov.org/)  TIV.net (http://tiv.net/) |
| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80  E4AE BE1A 53EB 323B DEE6 |
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-



[ANNOUNCE] HTTP::WebTest 1.07

2001-11-20 Thread Ilya Martynov

The following message is a courtesy copy of an article
that has been posted to comp.lang.perl.modules,comp.lang.perl.announce as well.


The uploaded file

HTTP-WebTest-1.07.tar.gz

has entered CPAN as

  file: $CPAN/authors/id/I/IL/ILYAM/HTTP-WebTest-1.07.tar.gz
  size: 61156 bytes
   md5: e7ca9ad3eb3a6020f380ffc4e84d6436

NAME
HTTP::WebTest - Test remote URLs or local web files

DESCRIPTION
This module runs tests on remote URLs or local web files containing
Perl/JSP/HTML/JavaScript/etc. and generates a detailed test report.

The test specifications can be read from a parameter file or input as
method arguments. If you are testing a local file, Apache is started on
a private/dynamic port with a configuration file in a temporary
directory. The module displays the test results on the terminal by
default or directs them to a file. The module optionally e-mails the
test results.

Each URL/web file is tested by fetching it from the web server using a
local instance of an HTTP user agent. The basic test is simply whether
or not the fetch was successful. You may also test using literal strings
or regular expressions that are either required to exist or forbidden to
exist in the fetched page. You may also specify tests for the minimum
and maximum number of bytes in the returned page. You may also specify
tests for the minimum and maximum web server response time.

If you are testing a local file, the module checks the error log in the
temporary directory before and after the file is fetched from Apache. If
messages are written to the error log during the fetch, the module flags
this as an error and writes the messages to the output test report.

Changes since 1.06:

   * HTTP::WebTest now uses Config.pm to find correct shebang string
 for script 'wt'. It should correctly set path to perl interpreter
 even if perl is installed in non-standart place.

   * Added test parameter mail_from which allows to set From: header
 in report e-mails. Thanks Joe Germuska <[EMAIL PROTECTED]>
 for patch.

-- 
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Ilya Martynov (http://martynov.org/)|
| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80  E4AE BE1A 53EB 323B DEE6 |
| AGAVA Software Company (http://www.agava.com/)  |
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-



Re: @INC

2001-10-20 Thread Ilya Martynov

>>>>> On Wed, 17 Oct 2001 14:26:17 +0100, "Plows, Sean (London)" 
><[EMAIL PROTECTED]> said:


PS> How can I set this as my cgi's can't locate my libs?

use lib qw(/path/to/libs);

-- 
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Ilya Martynov (http://martynov.org/)  TIV.net (http://tiv.net/) |
| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80  E4AE BE1A 53EB 323B DEE6 |
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-



Re: Mod_perl component based architecture

2001-10-16 Thread Ilya Martynov

>>>>> On Tue, 16 Oct 2001 22:07:47 -0500 (CDT), Dave Rolsky <[EMAIL PROTECTED]> said:

DR> On Wed, 17 Oct 2001, Gunther Birznieks wrote:
>> I would venture to say that some of the mod_perl-only toolkits have some
>> cases of being better designed than ours, but they are mostly mod_perl
>> only.  In fact, I don't know if I know any other toolkits than ours that
>> are not mod_perl only of the ones that were advertised on the list.

DR> I don't know if Mason counts as a full toolkit (its not really an app
DR> server) but you can certainly run Mason as a vanilla CGI, and if you can
DR> do that I'm sure you can run it in FastCGI and whatnot.

Moreover I have seen it being used in command line tool which
generates static HTML pages from a set of templates.

-- 
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Ilya Martynov (http://martynov.org/)  TIV.net (http://tiv.net/) |
| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80  E4AE BE1A 53EB 323B DEE6 |
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-



Re: predefined arrays @- and @+ with mod_perl?

2001-10-10 Thread Ilya Martynov

>>>>> On Wed, 10 Oct 2001 20:17:19 +0200, Christoph Bergmann <[EMAIL PROTECTED]> 
>said:

CB> Hi...
CB> I wonder if there exists the predefined arrays @- and @+ in mod_perl.
CB> The following lines:

CB> [..skip..]

See 'perldoc perlvar'. AFAIK These arrays should be defined after any
successful regexp match (in new Perls - probably >= 5.6.1)

-- 
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Ilya Martynov (http://martynov.org/)|
| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80  E4AE BE1A 53EB 323B DEE6 |
| AGAVA Software Company (http://www.agava.com/)  |
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-



[ANNOUNCE] HTTP::WebTest 1.06

2001-08-12 Thread Ilya Martynov

The following message is a courtesy copy of an article
that has been posted to comp.lang.perl.announce,comp.lang.perl.modules as well.


The URL

http://martynov.org/tgz/HTTP-WebTest-1.06.tar.gz

has entered CPAN as

  file: $CPAN/authors/id/I/IL/ILYAM/HTTP-WebTest-1.06.tar.gz
  size: 60811 bytes
   md5: 991300e6ea655d90b34b8fcadde3e9fd

NAME
HTTP::WebTest - Test remote URLs or local web files

DESCRIPTION
This module runs tests on remote URLs or local web files containing
Perl/JSP/HTML/JavaScript/etc. and generates a detailed test report.

The test specifications can be read from a parameter file or input as
method arguments. If you are testing a local file, Apache is started on
a private/dynamic port with a configuration file in a temporary
directory. The module displays the test results on the terminal by
default or directs them to a file. The module optionally e-mails the
test results.

Each URL/web file is tested by fetching it from the web server using a
local instance of an HTTP user agent. The basic test is simply whether
or not the fetch was successful. You may also test using literal strings
or regular expressions that are either required to exist or forbidden to
exist in the fetched page. You may also specify tests for the minimum
and maximum number of bytes in the returned page. You may also specify
tests for the minimum and maximum web server response time.

If you are testing a local file, the module checks the error log in the
temporary directory before and after the file is fetched from Apache. If
messages are written to the error log during the fetch, the module flags
this as an error and writes the messages to the output test report.

Changes since 1.05:

   * Some files required for local web files testing mode were missing
 in last HTTP-WebTest distributions.

-- 
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Ilya Martynov (http://martynov.org/)|
| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80  E4AE BE1A 53EB 323B DEE6 |
| AGAVA Software Company (http://www.agava.com/)  |
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-



[ANNOUNCE] HTTP::WebTest 1.05

2001-08-12 Thread Ilya Martynov

The following message is a courtesy copy of an article
that has been posted to comp.lang.perl.announce as well.


The uploaded file

HTTP-WebTest-1.05.tar.gz

has entered CPAN as

  file: $CPAN/authors/id/I/IL/ILYAM/HTTP-WebTest-1.05.tar.gz
  size: 60698 bytes
   md5: 8c9b0742f34310f41e35cca8fc1bdc36

NAME
HTTP::WebTest - Test remote URLs or local web files

DESCRIPTION
This module runs tests on remote URLs or local web files containing
Perl/JSP/HTML/JavaScript/etc. and generates a detailed test report.

The test specifications can be read from a parameter file or input as
method arguments. If you are testing a local file, Apache is started on
a private/dynamic port with a configuration file in a temporary
directory. The module displays the test results on the terminal by
default or directs them to a file. The module optionally e-mails the
test results.

Each URL/web file is tested by fetching it from the web server using a
local instance of an HTTP user agent. The basic test is simply whether
or not the fetch was successful. You may also test using literal strings
or regular expressions that are either required to exist or forbidden to
exist in the fetched page. You may also specify tests for the minimum
and maximum number of bytes in the returned page. You may also specify
tests for the minimum and maximum web server response time.

If you are testing a local file, the module checks the error log in the
temporary directory before and after the file is fetched from Apache. If
messages are written to the error log during the fetch, the module flags
this as an error and writes the messages to the output test report.

Changes since 1.04:

   * Installation of http-webtest directory is optional now for Unix
 platforms. It is completely disabled on Win32 platform.

   * Mentioned in docs that this module should work on Win32
 platform. Bug reports from this platform would be appreciated.

   * Do not use environment variable WEBTEST_LIB in 'wt' script. It
 seems to be needed only for debuging purposes and it was a source
 of many Perl warnings if it was not defined.

   * Sample Apache config file bundled with this module now contains
 directives to disable usage of apache access and resource config
 files.

   * Use File::Temp for sane creation of temporary directories.

   * Removed section 'CHANGES' from HTTP::WebTest POD docs since it
 became too long. Anybody interested in changes should consult
 this file.

-- 
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Ilya Martynov (http://martynov.org/)|
| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80  E4AE BE1A 53EB 323B DEE6 |
| AGAVA Software Company (http://www.agava.com/)  |
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-



Re: [ANNOUNCE] RoboWeb 1.0b, web application test suite generator

2001-07-23 Thread Ilya Martynov


>> We should investigate how these 2 projects can work together when I'm
>> done so that RoboWeb 'recorded' sessions can create WWW::Automate methods
>> that utilise the structure of the page. The benefits of doing this are:
>> 1- Resultant scripts are easier to interpret
>> 2- Scripting apps that vary their form field names works.

CG> [..skip..]

CG> I look forward to seeing WWW::Automate and to working together on this.

I've recently become maintainer of another testing module
HTTP::WebTest. Stable version (released on CPAN) already has many
interesting features (like response time tests, text matching tests,
content size checks, support for both remote web server and local test
modes). I'm working on its rewrite in modular style where tests
modules are pluggable so it will be easily extendable. After finishing
with it I thought about writhing proxy that records users actions and
produces skeleton of test.

Maybe joining our efforts have some sense.

-- 
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Ilya Martynov (http://martynov.org/)|
| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80  E4AE BE1A 53EB 323B DEE6 |
| AGAVA Software Company (http://www.agava.com/)  |
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-



Re: Concepts of Unique Tracking

2001-05-25 Thread Ilya Martynov


JH> Let's take over the world and recompile all browsers to have them send out
JH> the MAC address of thet network card.

.. and if I'm dialup user :)

JH> Jonathan

JH> -Original Message-
JH> From: Wim Kerkhoff [mailto:[EMAIL PROTECTED]]
JH> Sent: Friday, May 25, 2001 10:42 AM
JH> To: Jonathan Hilgeman
JH> Cc: '[EMAIL PROTECTED]'
JH> Subject: Re: Concepts of Unique Tracking


JH> Jonathan Hilgeman wrote:
>> 
>> What about client-specific information available in Javascript, like
JH> screen
>> resolution, size, etc...? Can that be accessed by tinkering with Apache a
>> bit, or is it something only available because of the browser, since
>> Javascript is dependent on the browser?

JH> I briefly thought about suggesting something like that, or with
JH> combination with the other headers that get sent in the HTTP request for
JH> language, encoding, etc. However, think of the situations such as
JH> computer labs, internet cafes, etc, where all computers are identical in
JH> every aspect, with the exact same version of the browser, hard coded
JH> screen resolutions (e.g. 800x600), etc, that the user can not change.

JH> -- 

JH> Regards,

JH> Wim Kerkhoff, Software Engineer
JH> Merilus, Inc.  -|- http://www.merilus.com
JH> Email: [EMAIL PROTECTED]


-- 
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Ilya Martynov (http://martynov.org/)|
| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80  E4AE BE1A 53EB 323B DEE6 |
| AGAVA Software Company (http://www.agava.com/)  |
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-



Re: Apache::Session / No-Cookie-Tracking

2001-05-25 Thread Ilya Martynov


JH> I want to be able to track visitors without the use of cookies.
JH> I don't want to rely on IP address, because people behind proxies and
JH> firewalls seem to have the same IP address. 
JH> I don't want to rely on a session ID variable being always present in the
JH> URL, in case the window gets closed or changed.
JH> Now, two questions:

JH> 1) Will Apache::Session provide an environment variable like
JH> HTTP_USER_AGENT that will contain an identifier that will always
JH> be consistent for that specific user, despite proxies and
JH> firewalls, and despite the changing/closing of windows?

JH> 2) If not, does anyone know of a good way to do this?

Do you believe in magic? :)

The only way to track visitors is either:

1) use cookies

2) use session ID variable in URI and/or hidden field with session ID
   in forms

3) use IPs (which is bad because it is completely broken approach)

4) use HTTP authorization (which is not always convenient because
   requires user registration)

Apache::Session can only create persistent storage of session
data. Each session data identified by some session ID. This ID should
be taken from somewhere (see above).

-- 
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Ilya Martynov (http://martynov.org/)|
| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80  E4AE BE1A 53EB 323B DEE6 |
| AGAVA Software Company (http://www.agava.com/)  |
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-



Re: execute JAR procedures

2001-04-06 Thread Ilya Martynov


c> Hello everyone, I'm looking for a way to execute JAVA procedures in a
c> JAR file from my modperl programs.  I have a couple .jar files that I
c> would like to import somehow into my perl scripts, and then be able to
c> execute the functions in them.

c> I've been looking through the Jakarta and Tomcat stuff but it seems like
c> overkill, this is the only JAVA I am using right now and was hoping
c> there was a simpler way.

Take a look at 'Java' or 'Inline-Java' module available from CPAN.

-- 
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Ilya Martynov (http://martynov.org/)|
| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80  E4AE BE1A 53EB 323B DEE6 |
| AGAVA Software Company (http://www.agava.com/)  |
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-



Apache::StatINC patch

2001-03-14 Thread Ilya Konstantinov

Hi,

While developing with mod_perl and Apache::ASP here at Aduva SID
department, we've came across an annoying problem.

Apache::ASP adds it's 'Global' directory to @INC. We naturally
used it to store modules. Since mod_perl resets @INC across requests
but doesn't reset %INC, Apache::StatINC sometimes found changes in the
used modules, but couldn't reload them (since their directory wasn't in
@INC).

This patch will insert missing directories into @INC on the fly.

-- 
Best regards,
Ilya Konstantinov


--- StatINC.pm.old  Tue Mar 13 18:30:57 2001
+++ StatINC.pm  Tue Mar 13 17:30:08 2001
@@ -11,7 +11,7 @@
   $r->dir_config("UndefOnReload")) || '') eq "on");
 my $DEBUG = ref($r) && (lc($r->dir_config("StatINCDebug") || '') eq "on");
 $DEBUG = $r->dir_config("StatINC_Debug") if ref($r) && 
$r->dir_config("StatINC_Debug");
-
+
 while(my($key,$file) = each %INC) {
local $^W = 0;
my $mtime = (stat $file)[9];
@@ -20,16 +20,38 @@
unless(defined $Stat{$file}) { 
$Stat{$file} = $^T;
}
+# if modified, reload the module
if($mtime > $Stat{$file}) {
+   # make sure file's prefix is in @INC
+   my $found_in_inc;
+   for (@INC) {
+  if(index($file,$_) == 0) {
+ $found_in_inc = 1;
+ last;
+  }
+   }
+
+if(!$found_in_inc) {
+   my $inc_dir = substr($file, 0, length($file)-length($key)-1);
+   push @INC, $inc_dir;
+  warn "Apache::StatINC: process $$ adding $inc_dir to \@INC\n"
+   if $DEBUG > 0;
+}
+
if($do_undef and $key =~ /\.pm$/) {
require Apache::Symbol;
my $class = Apache::Symbol::file2class($key);
$class->Apache::Symbol::undef_functions( undef, 1 );
}
delete $INC{$key};
-   require $key;
-   warn "Apache::StatINC: process $$ reloading $key\n"
-   if $DEBUG > 0;
+   eval{ require $key };
+   if ($@) {
+   warn "Apache::StatINC: process $$ failed to reload $key. $@"
+  if $DEBUG > 0;
+   } else {
+  warn "Apache::StatINC: process $$ reloading $key.\n"
+  if $DEBUG > 0;
+}
}
$Stat{$file} = $mtime;
 }



Re: make mod_perl

2001-01-26 Thread Ilya

when I run make test I get this:

cc -c  -fno-strict-aliasing -I/usr/local/include -O  -DVERSION=\"1.31\"
 -DXS_VERSION=\"1.31\" -DPIC -fpic -I/usr/local/lib/perl5/5.6.0/i386-freebsd
/CORE  Symbol.c
Symbol.xs: In function `XS_Apache__Symbol_cv_const_sv':
Symbol.xs:106: `na' undeclared (first use in this function)
Symbol.xs:106: (Each undeclared identifier is reported only once
Symbol.xs:106: for each function it appears in.)
*** Error code 1

Stop in /root/temp/mod_perl-1.24_01/Symbol.
*** Error code 1

Stop in /root/temp/mod_perl-1.24_01

any suggestions?

- Original Message -
From: "Ilya" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, January 26, 2001 9:35 PM
Subject: make mod_perl


> I am trying to build mod_perl with apache, but cant get through iunitial
> make.
> I got apache 1.3.14 src and mod_perl
> untared them, and run
> perl Makefile.PL APACHE_SRC=../apache/src DO_HTTPD=1 USE_APACI=1
> EVERYTHING=1
>
> i get this:
> Will configure via APACI
> Enter `q' to stop search
> Please tell me where I can find your apache src
>  [] ../apache/src
> cp apaci/Makefile.libdir ../apache/src/modules/perl/Makefile.libdir
> cp apaci/Makefile.tmpl ../apache/src/modules/perl/Makefile.tmpl
> cp apaci/README ../apache/src/modules/perl/README
> cp apaci/configure ../apache/src/modules/perl/configure
> cp apaci/libperl.module ../apache/src/modules/perl/libperl.module
> cp apaci/mod_perl.config.sh ../apache/src/modules/perl/mod_perl.config.sh
> cp apaci/load_modules.pl.PL ../apache/src/modules/perl/load_modules.pl.PL
> cp apaci/find_source.PL ../apache/src/modules/perl/find_source.PL
> cp apaci/apxs_cflags.PL ../apache/src/modules/perl/apxs_cflags.PL
> cp apaci/mod_perl.exp ../apache/src/modules/perl/mod_perl.exp
> * WARNING *
>
>   Apache Version 1.3.0 required, aborting...
>
> * WARNING *
>
> though the folder is called apache, it is apache 1.3.14 nevertheless.
>
> any suggestions?
>
> thx
>
>




Re: make mod_perl

2001-01-26 Thread Ilya

when I run make test I get this:

cc -c  -fno-strict-aliasing -I/usr/local/include -O  -DVERSION=\"1.31\"
 -DXS_VERSION=\"1.31\" -DPIC -fpic -I/usr/local/lib/perl5/5.6.0/i386-freebsd
/CORE  Symbol.c
Symbol.xs: In function `XS_Apache__Symbol_cv_const_sv':
Symbol.xs:106: `na' undeclared (first use in this function)
Symbol.xs:106: (Each undeclared identifier is reported only once
Symbol.xs:106: for each function it appears in.)
*** Error code 1

Stop in /root/temp/mod_perl-1.24_01/Symbol.
*** Error code 1

Stop in /root/temp/mod_perl-1.24_01

any suggestions?

- Original Message -
From: "Ilya" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, January 26, 2001 9:35 PM
Subject: make mod_perl


> I am trying to build mod_perl with apache, but cant get through iunitial
> make.
> I got apache 1.3.14 src and mod_perl
> untared them, and run
> perl Makefile.PL APACHE_SRC=../apache/src DO_HTTPD=1 USE_APACI=1
> EVERYTHING=1
>
> i get this:
> Will configure via APACI
> Enter `q' to stop search
> Please tell me where I can find your apache src
>  [] ../apache/src
> cp apaci/Makefile.libdir ../apache/src/modules/perl/Makefile.libdir
> cp apaci/Makefile.tmpl ../apache/src/modules/perl/Makefile.tmpl
> cp apaci/README ../apache/src/modules/perl/README
> cp apaci/configure ../apache/src/modules/perl/configure
> cp apaci/libperl.module ../apache/src/modules/perl/libperl.module
> cp apaci/mod_perl.config.sh ../apache/src/modules/perl/mod_perl.config.sh
> cp apaci/load_modules.pl.PL ../apache/src/modules/perl/load_modules.pl.PL
> cp apaci/find_source.PL ../apache/src/modules/perl/find_source.PL
> cp apaci/apxs_cflags.PL ../apache/src/modules/perl/apxs_cflags.PL
> cp apaci/mod_perl.exp ../apache/src/modules/perl/mod_perl.exp
> * WARNING *
>
>   Apache Version 1.3.0 required, aborting...
>
> * WARNING *
>
> though the folder is called apache, it is apache 1.3.14 nevertheless.
>
> any suggestions?
>
> thx
>
>




make mod_perl

2001-01-26 Thread Ilya

I am trying to build mod_perl with apache, but cant get through iunitial
make.
I got apache 1.3.14 src and mod_perl
untared them, and run
perl Makefile.PL APACHE_SRC=../apache/src DO_HTTPD=1 USE_APACI=1
EVERYTHING=1

i get this:
Will configure via APACI
Enter `q' to stop search
Please tell me where I can find your apache src
 [] ../apache/src
cp apaci/Makefile.libdir ../apache/src/modules/perl/Makefile.libdir
cp apaci/Makefile.tmpl ../apache/src/modules/perl/Makefile.tmpl
cp apaci/README ../apache/src/modules/perl/README
cp apaci/configure ../apache/src/modules/perl/configure
cp apaci/libperl.module ../apache/src/modules/perl/libperl.module
cp apaci/mod_perl.config.sh ../apache/src/modules/perl/mod_perl.config.sh
cp apaci/load_modules.pl.PL ../apache/src/modules/perl/load_modules.pl.PL
cp apaci/find_source.PL ../apache/src/modules/perl/find_source.PL
cp apaci/apxs_cflags.PL ../apache/src/modules/perl/apxs_cflags.PL
cp apaci/mod_perl.exp ../apache/src/modules/perl/mod_perl.exp
* WARNING *

  Apache Version 1.3.0 required, aborting...

* WARNING *

though the folder is called apache, it is apache 1.3.14 nevertheless.

any suggestions?

thx




Re: Apache::ASP

2001-01-25 Thread Ilya

I think I was editing wrong file all the time ;)

unless($r && $r->can('filename')) {  gives:
No valid request object (Apache=SCALAR(0x83ec2c4)) passed to ASP handler; if
you are getting
this error message, you likely have a broken DSO version of mod_perl
which often occurs when using RedHat RPMs.  One fix reported is to
configure "PerlSendHeader On".  Another fix is to compile
statically the apache + mod_perl build as RedHat RPMs have been trouble.
Please check FAQ or mod_perl archives for more information.

unless (ref($r) and ($r->can('filename')){  gives:
Global symbol "$r" requires explicit package name at
/usr/local/lib/perl5/site_perl/5.005/Apache/ASP.pm line 134.
Global symbol "$status" requires explicit package name at
/usr/local/lib/perl5/site_perl/5.005/Apache/ASP.pm line 200.
[Fri Jan 26 01:51:28 2001] [error] syntax error at
/usr/local/lib/perl5/site_perl/5.005/Apache/ASP.pm line 127, near ";"
  (Might be a runaway multi-line << string starting on line 119)
syntax error at /usr/local/lib/perl5/site_perl/5.005/Apache/ASP.pm line 231,
near "}"

[Fri Jan 26 01:51:28 2001] [error] Undefined subroutine
&Apache::ASP::handler called

unless($r && ($r =~ /^Apache/)) {  gives:
[Fri Jan 26 01:53:13 2001] [error] Can't locate object method "dir_config"
via package "Apache" at /usr/local/lib/perl5/site_perl/5.005/Apache/ASP.pm
line 134.

unless(UNIVERSAL::can($r, 'filename')){ gives:
No valid request object (Apache=SCALAR(0x841deb8)) passed to ASP handler; if
you are getting
this error message, you likely have a broken DSO version of mod_perl
which often occurs when using RedHat RPMs.  One fix reported is to
configure "PerlSendHeader On".  Another fix is to compile
statically the apache + mod_perl build as RedHat RPMs have been trouble.

sorry about misinformation
Please check FAQ or mod_perl archives for more information.




Re: Apache::ASP

2001-01-25 Thread Ilya

i tried to replace
unless($r && $r->can('filename')) {
this
 unless($r && ($r =~ /^Apache/)) {
and
unless(UNIVERSAL::can($r, 'filename')){

restarting apache gives
No valid request object (Apache=SCALAR(0x84802c4)) for 1st
and No valid request object (Apache=SCALAR(0x84912c4))  for 2nd
the errors are different from original one in number. I do have however DSO
compiled Apache as Ged Haywood pointed out. I am baout to recompile it, but
if there is a diffirent solution I will be only glad.
my http -l says:
Compiled-in modules:
  http_core.c
  mod_so.c


- Original Message -
From: "John Hurst" <[EMAIL PROTECTED]>
To: "Joshua Chamas" <[EMAIL PROTECTED]>; "Ilya Krel" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, January 25, 2001 8:28 PM
Subject: Re: Apache::ASP


>
> You may also want to try
>
>unless(UNIVERSAL::can($r, 'filename')){
>  ...
>}
>
> which also nicely avoids having to test $r first.
>
> -jh
>
>
>
> At 05:05 PM 1/25/01, Joshua Chamas wrote:
> >Anyone see why a $r = Apache=SCALAR(0x8461790) might not
> >respond true to $r->can('filename') on Ilya's below FreeBSD
> >setup?  The relevant ASP code is below.
> >
> >Ilya, worst case, you can tweak that code to make it
> >work for you, for example does a line like
> >
> > unless($r && ($r =~ /^Apache/)) {
> >
> >work instead ?  This might be a suitable test.
> >
> >--Josh
> >
> >sub handler {
> > my($package, $r) = @_;
> > my $status = 200;
> >
> > # allows it to be called as an object method
> > ref $package and $r = $package;
> >
> > # rarely happens, but just in case
> > unless($r && $r->can('filename')) {
> > # this could happen with a bad filtering sequence
> > warn(< >No valid request object ($r) passed to ASP handler; if you are getting
> >this error message, you likely have a broken DSO version of mod_perl
> >which often occurs when using RedHat RPMs.  One fix reported is to
> >configure "PerlSendHeader On".  Another fix is to compile
> >statically the apache + mod_perl build as RedHat RPMs have been trouble.
> >Please check FAQ or mod_perl archives for more information.
> >ERROR
> >   ;
> >
> >Ilya Krel wrote:
> > >
> > > I am running Freebsd 4.2, Summary of my perl5 (5.0 patchlevel 5
subversion
> > > 3), Apache/1.3.14, mod_perl/1.24  (from ports collection).
> > > Apache:ASP installed from cpan says:
> > > Bundle id = Bundle::Apache::ASP
> > > CPAN_USERID  CHAMAS (Joshua Chamas <[EMAIL PROTECTED]>)
> > > CPAN_VERSION 1.00
> > > CPAN_FILEC/CH/CHAMAS/Apache-ASP-2.07.tar.gz
> > > MANPAGE  Bundle::Apache::ASP - Install Apache::ASP and related
> > > modules
> > > CONTAINS MLDBM Data::Dumper MD5 CGI HTML::Clean Net::SMTP
> > HTTP::Date
> > > Devel::Symdump Apache::DBI Compress::Zlib Tie::Cache Time::HiRes
> > Apache::ASP
> > > INST_FILE
/usr/local/lib/perl5/site_perl/5.005/Bundle/Apache/ASP.pm
> > > INST_VERSION 1.00
> > >
> > > when i try to access the examples in site/eg I get thsi in error_log :
> > > No valid request object (Apache=SCALAR(0x8461790)) passed to ASP
> > handler; if
> > > you are getting
> > > this error message, you likely have a broken DSO version of mod_perl
> > > which often occurs when using RedHat RPMs.  One fix reported is to
> > > configure "PerlSendHeader On".  Another fix is to compile
> > > statically the apache + mod_perl build as RedHat RPMs have been
trouble.
> > > Please check FAQ or mod_perl archives for more information.
> > >
> > > any suggestions how to fix it?
> > >
> > > thx
>
>
>




Apache::ASP

2001-01-25 Thread Ilya Krel

I am running Freebsd 4.2, Summary of my perl5 (5.0 patchlevel 5 subversion
3), Apache/1.3.14, mod_perl/1.24  (from ports collection).
Apache:ASP installed from cpan says:
Bundle id = Bundle::Apache::ASP
CPAN_USERID  CHAMAS (Joshua Chamas <[EMAIL PROTECTED]>)
CPAN_VERSION 1.00
CPAN_FILEC/CH/CHAMAS/Apache-ASP-2.07.tar.gz
MANPAGE  Bundle::Apache::ASP - Install Apache::ASP and related
modules
CONTAINS MLDBM Data::Dumper MD5 CGI HTML::Clean Net::SMTP HTTP::Date
Devel::Symdump Apache::DBI Compress::Zlib Tie::Cache Time::HiRes Apache::ASP
INST_FILE/usr/local/lib/perl5/site_perl/5.005/Bundle/Apache/ASP.pm
INST_VERSION 1.00

when i try to access the examples in site/eg I get thsi in error_log :
No valid request object (Apache=SCALAR(0x8461790)) passed to ASP handler; if
you are getting
this error message, you likely have a broken DSO version of mod_perl
which often occurs when using RedHat RPMs.  One fix reported is to
configure "PerlSendHeader On".  Another fix is to compile
statically the apache + mod_perl build as RedHat RPMs have been trouble.
Please check FAQ or mod_perl archives for more information.

any suggestions how to fix it?

thx






Apache::ASP

2001-01-25 Thread Ilya Krel

I am running Freebsd 4.2, Summary of my perl5 (5.0 patchlevel 5 subversion
3), Apache/1.3.14, mod_perl/1.24  (from ports collection).
Apache:ASP installed from cpan says:
Bundle id = Bundle::Apache::ASP
CPAN_USERID  CHAMAS (Joshua Chamas <[EMAIL PROTECTED]>)
CPAN_VERSION 1.00
CPAN_FILEC/CH/CHAMAS/Apache-ASP-2.07.tar.gz
MANPAGE  Bundle::Apache::ASP - Install Apache::ASP and related
modules
CONTAINS MLDBM Data::Dumper MD5 CGI HTML::Clean Net::SMTP HTTP::Date
Devel::Symdump Apache::DBI Compress::Zlib Tie::Cache Time::HiRes Apache::ASP
INST_FILE/usr/local/lib/perl5/site_perl/5.005/Bundle/Apache/ASP.pm
INST_VERSION 1.00

when i try to access the examples in site/eg I get thsi in error_log :
No valid request object (Apache=SCALAR(0x8461790)) passed to ASP handler; if
you are getting
this error message, you likely have a broken DSO version of mod_perl
which often occurs when using RedHat RPMs.  One fix reported is to
configure "PerlSendHeader On".  Another fix is to compile
statically the apache + mod_perl build as RedHat RPMs have been trouble.
Please check FAQ or mod_perl archives for more information.

any suggestions how to fix it?

thx






Re: how do I restart the server

2000-11-23 Thread Ilya Soldatkin



> I have changed some of my scripts and I need to reload them. for that I
need
> to restart the server. but the changes are in my subtree in the sandbox.
so
> if I restart the server is it going to be problem for the other users. if
> not is there any other way to reload my scripts. I have tried adding
> PerlModule Apache::StatINC
> PerlInitHandler Apache::StatINC
> but it didn't help me as I made changes to one of my .pm files. I need
help.

I am using file .htaccess for this purpose. Here is it. Place this file in
the directory where your script located.

SetHandler  perl-script
  PerlHandler Apache::Registry
  PerlInitHandler Apache::StatINC
  PerlSendHeader  On
  Options +ExecCGI
---

Ilya



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




open source projects on mod_perl

2000-11-21 Thread Ilya Soldatkin

Are there any open source projects running under mod_perl?
I am interested in OOP projects working with SQL databases with good style of 
programming.
I'd like to use them to make my code better. If you know such projects, could you give 
me links to them.
I will be also grateful if somebody emal me such examples of good code.

Thank you
Ilya 





moidperl, OOP & DBI

2000-11-21 Thread Ilya Soldatkin

I  am creating an object that make queries to database. But how shall I
explain to him what database handler he shall use?
Under mod_perl it is too dangerous to make $dbh global variable.
Well, I can create data field in this object that will store current $dbh,
but it seems too strange too me to have such data field in object:

$person={
name=>'Jack',
age=10,
...,
$dbh=>...
}

$dbh have no relation to information about Jack.
Is there any better solution?

There is some piece of code
---
mainscript.pl


my $dsn = "DBI:$config{'driver'}:database=$config{'dbname'};";
my $dbh = DBI->connect($dsn, $config{'user'}, $config{'pass'});

some SQL queries
..

$guest=new Person($dbh,$id);
print age;
END
;
..

--
Person.pm

Package Person;
use strict;

sub new
 {
my ($that, $dbh, $id) = @_;
my $class =ref($that)||$that;
my $table ='SITE';

my $sth = $dbh->prepare( qq{SELECT * FROM $table where id=?});
if (!$sth) { die "Error:" . $dbh->errstr . "\n"; }
if (!$sth->execute($id)) { die "Error:" . $sth->errstr . "\n";}

 if (my $ref = $sth->fetchrow_hashref)
  {
my $person->{'name'}=$ref->{'name'};
my $person->{'age'}=$ref->{'age'};
...
  }

bless $person, $that;
return $person;

}
 others methods



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: [ANNOUNCE] ApacheCon USA 2001: Call For Papers

2000-11-15 Thread Ilya Martynov

On 15 Nov 2000, David Hodgkinson wrote:

DH> Stas Bekman <[EMAIL PROTECTED]> writes:
DH> 
DH> > Ralf is always talking about SSL stuff, so if you want to do it, why don't
DH> > you just contact him and sync with him. It's not mod_perl but many of us
DH> > are using it. So it'd probably be questionable for TPC , but perfect for
DH> > ApacheCon.
DH> 
DH> Is there a way of doing mod_rewrite maps in perl?

RewriteMap config option allows you specify external program as source of
map information. It can be in perl. Apache documentation for mod_rewrite has
an example of such program.

-- 
Ilya Martynov
AGAVA Software Company, http://www.agava.com




Strange messages in mod_perl enabled Apache

2000-11-10 Thread Ilya Martynov

Hi,

Recently I've noticed strange lookin messages in error log of mod_perl
Apache. It looks like:

Backend sent D message without prior T
unexpected character n following 'I'

or sometimes like:

Unknown protocol character '.' read from backend.  (The protocol character
is the first character the backend sends in response to a query it receives).

Have anybody seen it? What can it mean?

Version of mod_perl 1.24
Version of Apache 1.3.14

I have suspicion that it can be DBD::Pg messages but I'm not sure yet.
Version of DBD::Pg is 0.93.

-- 
Ilya Martynov
AGAVA Software Company, http://www.agava.com




mod_perl examples

2000-09-07 Thread Ilya Soldatkin

Hi!
I am beginner in mod_perl.  I think it will be good for me to see some
mod_perl script examples. Above all I would like to see style of
programming. It will be great if these scripts work with DBI. Could you
recommend(give URL) or send me several scripts with good style of
programming in mod_perl?

Thanks
Ilya




Re[2]: [OT] mod_proxy tuning info?

2000-08-21 Thread Ilya Obshadko

Hello Edward,

ñðåäà, 16 àâãóñòà 2000 ã., you wrote:

EM> Yes, I have read that part of the mod_perl guide. I'm looking for a more
EM> detailed discussion on mod_proxy configuration and performance.

EM> But it doesn't answer the questions I have regarding the use of mod_proxy:
EM> * What affect does CacheGcInterval have on performance?

mod_proxy garbage collector virtually don't work with large sites. I have to
remove cache files manually via crontab.

EM> * Does setting CacheDirLevels to a high value cause a performance hit?
EM> * Does setting CacheDirLength to a small value increase performance?

Don't think those two play a big role in mod_proxy performance.

EM> * How does performance scale with 1GB, 2GB, or 4GB of memory?

It doesn't matter, as long as mod_proxy doesn't do memory caching.

EM> * How do you determine the overall hit rate? The hit rate from ram? The
EM> hit
EM> rate from disk?

see previous.

EM> * There are dynamic pages I want cached for a certain TTL. There are other
EM> dynamic pages I don't want cached at all. Do I have to use the NoCache
EM> directive on all the directories/files I don't want cached? Or is there a
EM> more effective way to do this?

Check patches at: http://www.w-m.ru/~ilya/source/apache/xfire_patches1.3.9.tar.gz
There's some functionality additions. Note: it doesn't work with
apache versions other than 1.3.9.


Best regards,
 Ilyamailto:[EMAIL PROTECTED]





Re[2]: [RFC] modproxy:modperl ratios...

2000-05-03 Thread Ilya Obshadko

Hello Matt,

÷åòâåðã, 27 àïðåëÿ 2000 ã., you wrote:

>> doing - and the TCP listen queue will hold a few more
>> connections if you are slightly short of backends.

MS> Is there any benefit of mod_proxy over a real proxy front end like "Oops"?

I don't think so, at least for "accelerator" application like mod_perl
frontend. Configurability of apache is great, and in conjunction with
mod_rewrite you can create very powerful configurations. Even more, if
you see the lack of some functionality, any time you can patch
mod_proxy to get it work is you want it to ;) I did some work about
it, and my "custom" mod_proxy can eliminate "pragma: no-cache" on
selected URIs and doesn't allow simultaneous requests to the same
resource on the mod_perl server, for obvious reasons. so, with that
we've got practically no limits on server bandwidth (currently we
serve 500 000 pages per day in peak, and all of them are dynamic).

I saw many people on this list that are working on some mod_proxy
issues. Really, the design is not very well for accelerator
application. Maybe we could join to rewrite it as a completely new
accelerator module...

Best regards,
 Ilyamailto:[EMAIL PROTECTED]





Re[2]: END blocks in perl modules

2000-02-12 Thread Ilya Obshadko

Hello James,

ñóááîòà, 12 ôåâðàëÿ 2000 ã., you wrote:

JGS> What you want to do, I think, is something like the following:

JGS>   sub tie_keys {
JGS> unless(tied %Keys or not defined $IPC::Shareable::VERSION) {
JGS>   tie(%Keys, 'IPC::Shareable', 'abcd', {  # random glue...
JGS>   mode => 0600,  # a bit more secure
JGS>   destroy => 'no',
JGS>   exclusive => 'no',
JGS>   create => 'yes',
JGS> });
JGS> }
JGS>   }

My point was NOT to tie separately in each child, but execute tie()
once during startup. The code of module that is being loaded
from startup.pl looks like this:

BEGIN {
use IPC::Shareable;
tie %RADDR_CACHE, 
'IPC::Shareable',
{ key => 'href', mode => 0666, create => 1 };
}

[bla-bla-bla]

END {
untie %RADDR_CACHE;
}

It works fine for me, i.e. all children has a proper access to
segment, can read & write all that I need and so on.
But if I tie() with { destroy => 1 }, segment is being destroyed in
approximately 10 seconds after httpd startup (seems like httpd
parent restarts itself after initialization). So I've tried to destroy
segment manually and then found that END {} is not executed during
parent shutdown...

Actually, that is not a REAL problem, because httpd is running already
and garbage collector is on its way ;)

Best regards,
 Ilyamailto:[EMAIL PROTECTED]




END blocks in perl modules

2000-02-12 Thread Ilya Obshadko

Hello modperl,

  Yet another mystic thing. I've been messing around with
  IPC::Shareable. The purpose was just simple: create shared memory
  segment on startup, give access to it for all child processes,
  destroy this segment after httpd shutdown. I've encountered a
  strange problem with the last action. I did not understand what's
  going on until I've printed PIDs that execute cleanup to STDERR.
  Then I found that END block IS NOT BEING EXECUTED BY PARENT
  HTTPD PROCESS. Of course httpd child, that is executed with ordinary
  user privileges, cannot destrroy shm object owned by root :(

  Question 2 all, (and especially to Doug): was this behaviour
  implemented 'on purpose', or it is just 'undocumented feature'? ;)

Best regards,
 Ilya  mailto:[EMAIL PROTECTED]




Apache::Request weirdness

2000-02-08 Thread Ilya Obshadko

Hello,

  I've discovered the following. Suggest that you use Apache::Request
  object in both fixup handler and registry script. So we have:
  
1) unpredictable segmentation faults
2) when parsing POST data, only first-time call (in fixup handler)
   produces correct results, the other one returns crap.
  
Best regards,
 Ilya  mailto:[EMAIL PROTECTED]




Re: X-Forwarded-For problem

2000-02-05 Thread Ilya Obshadko

Hello Ewan,

ïÿòíèöà, 4 ôåâðàëÿ 2000 ã., you wrote:

EE> Module Name: mod_proxy_add_forward.c
EE> Content handlers: none
EE> Configuration Phase Participation: none
EE> Request Phase Participation: Fixups
EE> Module Directives: none

EE> Looks good to me. My guess is that I'm missing something obvious, but I
EE> can't imagine what. I've checked the list archive for similar problems,
EE> but I can't find examples of anyone complaining about the header not
EE> appearing once the proxy_add_forward module was successfully compiled
EE> into the front-end server.

EE> Any assistance would be greatly appreciated.

It looks like wrong module execution order. By using
ClearModuleList/AddModule you can easily correct this. Note that
modules are being executed in 'reverse' order, i.e. module that you
'Add' first will be executed last.

Best regards,
 Ilyamailto:[EMAIL PROTECTED]




Re: mod_ssl in fronend-backend Apache configuration

2000-01-31 Thread Ilya Obshadko

Hello BeerBong,

ÐÏÎÅÄÅÌØÎÉË, 31 ÑÎ×ÁÒÑ 2000 Ç., you wrote:

B> mod_ssl is not a light thing, and I need encrypt mod_perl'd script results
B> only, therefore I think that mod_ssl should be in back-end server. Am I
B> right ? Does mod_proxy pass ssl encrypted data?

mod_proxy allows CONNECT method for SSL protocol support. I didn't try
it, though.

Best regards,
 Ilyamailto:[EMAIL PROTECTED]




Re: self url

2000-01-26 Thread Ilya Obshadko

Hello Vladimir,

ñðåäà, 26 ÿíâàðÿ 2000 ã., you wrote:

VI> Is there a way to get the URL of the current document in Embperl?
Sort of like $q->>self_url in CGI.pm.

Hmmm. Maybe [- $req_rec->uri -] could help? ($req_rec represents
apache request_rec object in Embperl).

Best regards,
 Ilyamailto:[EMAIL PROTECTED]




[ANNOUNCE] mod_proxy related patches

2000-01-21 Thread Ilya Obshadko

Hello,

  Finally, I've composed all the work I did this year about mod_proxy
  functionality as a dynamic content cache, into one patchset.
  This job was done during while developing and maintaining websites
  produced by http://web.masterskaya.ru (sorry, we have no english
  page yet). Those website include http://www.polit.ru, largest
  russian politics site, http://www.izvestia.ru, website of one of the
  major russian newspapers, and many, many others. We handle about
  1 000 000 http hits per day with common dual httpd model -
  lightweight frontend with mod_proxy and heavy backend with
  mod_perl.

  You can download diffs from here:
  http://web.masterskaya.ru/~ilya/xfire_patches.tar.gz

  DISCLAIMER
  
  I'm not responsible for any damage, lost profit, or any other
  disasters caused by the code.

  DESCRIPTION OF FIXES

  Fixes was done for apache version 1.3.9. But I think it should work
  with 1.3.4 and higher versions too. I've not tested it with versions
  other than 1.3.9, and I've not tested it on Win32 platform.

  1) Subtle problem with mod_include/mod_rewrite/mod_proxy.
 mod_include reports error when receiving response code other than
 HTTP_OK. So I've fixed mod_proxy so that it can return
 HTTP_NOT_MODIFIED only if request is not subrequest. Also, I've
 enabled mod_rewrite ruleflag [P] on subrequests.
 
  2) Large amount of reloads cause very high load on backend because
 requests bypass the cache. I've added IgnoreNoCache 
 directive to mod_proxy config.  is a mask for frontend
 server URIs. When mask is matched, Pragma: no-cache header is
 being deleted from incoming file headers, so if cached data
 present, it would be returned instead of getting data from
 backend server.

  3) On site with a very high traffic, there's a real risk of
 simultaneous reloading of the same URI by numerous clients.
 This is also causes problems on backend, especially with
 complicated dynamically-generated pages. I've fixed this by
 adding mod_proxy directive NoConcurrentCacheUpdates (On|Off),
 and new scoreboard status SERVER_PROXY_READ. When the flag is on
 and expired data found, server first checks if this URI is being
 downloaded from upstream by any other child. If so, it returns
 expired data to client while 'downloading' child doing its job of
 updating the cache.

  4) I've added X-Real-IP header to present real IP to the backend
 server. I think that X-Forwarded-For is for REAL proxies, so I
 don't want to mess with it.

  5) I've replaced ExplainX macros in proxy_cache.c for ap_log_rerror
 API call. Seems that those macros don't work, dunno why...

   So, that is all and here it is. Enjoy.

Best regards,
 Ilya  mailto:[EMAIL PROTECTED]




redirect after POST again?

1999-10-20 Thread Ilya Obshadko

Hello,

  Weird things: this simple & plain code

$req->header_out('Location' => $ENV{SCRIPT_NAME});
$req->status(REDIRECT);
$req->send_http_header;

  in POST script doesn't work with Netscape. It results in 'document
  contains no data' message. If $req->send_http_header is omitted,
  Netscape waits indefinitely until timeout. With IE, it's all ok.
  
  Even more strange - some weeks ago I've installed a VERY similar
  server with the same mod_perl & apache, and all such scripts
  worked fine. But don't advice to diff on all the config files -- it
  would take too long ;)

Best regards,
 Ilya  mailto:[EMAIL PROTECTED]




Perl implementation for ap_proxy_hash

1999-10-01 Thread Ilya Obshadko

Hello,

   Here's an interesing question. I need to implement an ap_proxy_hash
   (the function that translates URL into cache file name on disk) in
   perl (to get a working mechanizm for forced expiration of some
   URLs). AFAIK there is no mod_perl interface to mod_proxy, so it's
   necessary to make a dumb port from c to perl. But this function
   uses three apache api calls: ap_MD5Init, ap_MD5Update &
   ap_MD5Final. Is this possible to replace those ones for a
   Digest::MD5 and get the same results?

Best regards,
 Ilya  mailto:[EMAIL PROTECTED]