RE: Apache showing Perl code

2003-03-06 Thread Miroslav Madzarevic
Hi,

This is because your perl handler is not active.
How did you setup your apache for perl scripts under mod_perl ?
I see you're using windows ?
Are you sure mod_perl is working (check out Apache error log when it starts) ?

Take a look at the docs for Apache::Registry or Apache::PerlRun.


I just installed Apache and mod_perl, but for some reason when I execute
scripts through my Apache server it shows all of the Perl code:

#!C:/Perl/bin/Perl.exe
print Content-type: text/html\n\n;

foreach $var (sort(keys(%ENV))) {
$val = $ENV{$var};
$val =~ s|\n|\\n|g;
$val =~ s||\\|g;
print ${var}=\${val}\\n;
}

I got the path found on the first line from an example Perl script
(printenv.pl) that came with the latest version of the Apache server.

Could anybody give me a hand with a suggestion or two?


-- 



Miroslav Madzarevic, [EMAIL PROTECTED]
Mod Perl Development  - http://www.modperldev.com
Telephone: +381 64 1193 501
ICQ: 15880893
Linux user #217444 DEBIAN
jamph



Re: mod_perl training companies?

2002-03-24 Thread Miroslav Madzarevic


A young, startup company of 15 local people (believers) is doing traning and 
development on mod_perl, web and system administration (Linux). We are 
located in Yugoslavia, Belgrade but we also work with people and companies 
from other countries (Canada, Germany, Cyprus, USA). Much of our expirience 
comes from this mailing list, perl books and jobs we've worked on abroad. We 
got a lot from open source community and we're giving it back. 

Prices are very low since our country living standard is very low and there 
are not many perl jobs around here, unfortunatelly.
We respect all the clients we have. 

Our biggest accomplishment is in progress, since we've given a chance of 
assisting in moving old cgi-bin applications to mod-perl for 
www.cleverform.com (British company, rewiewed in January's edition of PC 
Magazine). I hope in time to come you'll be able to put this site in Powered 
by mod-perl section.

You can reach us at http://www.modperldev.com (a website we're making to 
serve open community).

-- 
Best regards,

Miroslav Madzarevic, Senior Perl Programmer
[EMAIL PROTECTED]
Mod Perl Development  - http://www.modperldev.com
Telephone: +381 64 1193 501
ICQ: 15880893
jamph

$_=,,.,,.,,,.,,,.,,,..,,.,,,.,.,,,;
s/\s//gs;tr/,./05/;my(@a,$o,$i)=split//;$_=DATA;tr/~`'^/0-4/;map{$o
.=$a[$i]+$_;$i++}split//;@a=$o=~m!...!g;map{print chr}@a; __DATA__
`~^`~~``^`~`~`^``~`~``''~^'`~^``'``^```~^``'```'~`~




Re: Serious bug, mixing mod-perl content

2002-03-13 Thread Miroslav Madzarevic



Stas: I have 1.24 ver. of mod-perl and as I see 
current Apache Registry sets $Apache::Registry::NameWithVirtualHost 
explicitly to 1 if it's not defined (I've seen the sources).

These are apache's startup messages:

[Fri Mar 1 11:47:28 2002] [notice] 
Apache-AdvancedExtranetServer/1.3.14 (Linux-Mandrake/2mdk) mod_perl/1.24 
configured -- resuming normal operations[Fri Mar 1 11:47:28 2002] 
[notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)

Ernest: I don't use server aliases but I'm going to 
fix that. I wish that the problem is so simple. Actually the two virt. hosts are 
beta.domain.com and www.domain.com

Christian: The setup is consisting of two httpd's, 
one without mod-perl and one with mod-perl. First apache serves as a proxy to a 
second one using mod-proxy and mod-rewrite. The second one is mod-perl enabled 
and hosts Apache::Registry scripts. First one hosts plain cgi-scripts.On 
both apaches there are two virt hosts, first apache one contains world viewable 
virt. hosts and the second one contains internal virt hosts (accessible only 
from 127.0.0.1, from first apache). The names and paths are different but the 
error occurs, although it's very rare. I'm not using HTML::Mason here. 


I noticed the error when I got error messages from 
beta which contains new code and I was actually working with www.

tnx. for suggestions
-Best 
regards,

Miroslav Madzarevic, Senior Perl Programmer[EMAIL PROTECTED]Mod Perl 
Development http://www.modperldev.comTelephone: 
+381 64 1193 501jamph

$_=",,.,,.,,,.,,,.,,,..,,.,,,.,.,,,";s/\s//gs;tr/,./05/;my(@a,$o,$i)=split//;$_=DATA;tr/~`'"^/0-4/;map{$o.=$a[$i]+$_;$i++}split//;@a=$o=~m!...!g;map{print 
chr}@a; 
__DATA__`~^`~~``^`~`~`^``~`~``''~^'`~^``'``^```~^``'```'~`~


Serious bug, mixing mod-perl content

2002-03-12 Thread Miroslav Madzarevic



It seems that my mod-perl virtual hosts are mixing 
content :(
I don't know why ?

I have virthost1 and virthost2 on mod-perl apache, 
most of the time you get the right content when calling respective virthost but 
sometimes when you call virthost2 you get response from virt. host 1. This is a 
rare bug but happens.

We're using Mandrake Linux and it's 2 apache's (1 
mod-perl enabled and the other without mod-perl - this one uses mod proxy and 
mod rewrite).

Can someone please direct me how can I solve this 
problem ?
-Best 
regards,

Miroslav Madzarevic, Senior Perl Programmer[EMAIL PROTECTED]Mod Perl 
Development http://www.modperldev.comTelephone: 
+381 64 1193 501jamph

$_=",,.,,.,,,.,,,.,,,..,,.,,,.,.,,,";s/\s//gs;tr/,./05/;my(@a,$o,$i)=split//;$_=DATA;tr/~`'"^/0-4/;map{$o.=$a[$i]+$_;$i++}split//;@a=$o=~m!...!g;map{print 
chr}@a; 
__DATA__`~^`~~``^`~`~`^``~`~``''~^'`~^``'``^```~^``'```'~`~


Re: mod_perl training companies?

2002-03-07 Thread Miroslav Madzarevic


A young, startup company of 15 local people (believers) is doing traning and
development on mod_perl, web and system administration (Linux). We are
located in Yugoslavia, Belgrade but we also work with people and companies
from other countries (Canada, Germany, Cyprus, USA). Much of our expirience
comes from this mailing list, perl books and jobs we've worked on abroad. We
got a lot from open source community and we're giving it back.

Prices are very low since our country living standard is very low and there
are not many perl jobs around here, unfortunatelly.
We respect all the clients we have.

Our biggest accomplishment is in progress, since we've given a chance of
assisting in moving old cgi-bin applications to mod-perl for
www.cleverform.com (British company, rewiewed in January's edition of PC
Magazine). I hope in time to come you'll be able to put this site in Powered
by mod-perl section.

These days we applied for Belgrade Perl Mongers since the two grops from Yu
reported on pm seem that either 1) don't have a website on or 2) not to have
any
members

You can reach us at http://www.modperldev.com (a website we're making to
serve open community).

-
Best regards,

Miroslav Madzarevic, Senior Perl Programmer
[EMAIL PROTECTED]
Mod Perl Development http://www.modperldev.com
Telephone: +381 64 1193 501
jamph

$_=,,.,,.,,,.,,,.,,,..,,.,,,.,.,,,;
s/\s//gs;tr/,./05/;my(@a,$o,$i)=split//;$_=DATA;tr/~`'^/0-4/;map{$o
.=$a[$i]+$_;$i++}split//;@a=$o=~m!...!g;map{print chr}@a; __DATA__
`~^`~~``^`~`~`^``~`~``''~^'`~^``'``^```~^``'```'~`~




Subrequests

2002-02-07 Thread Miroslav Madzarevic

Is it possible that my perl script (Apache::Registry, Apache::PerlRun, 
HTML::Mason or whatever) could run multiple times with same parameters when the
user just invokes the URL once (for example clicks on A tag)  and if so how 
can I prevent this from happening.

I guess this is because of subrequests being fired and I _explicitly_ don't 
wish my code to run multiple times because strange things might happen.




caching

2002-01-18 Thread Miroslav Madzarevic

How can kill If-Modified-Since and E-Tag incoming headers ?

Do I do it in my custom PerlInitHandler module ?

I have a development server and I don't wish anything to be cached (304 
messages, not modified).
Right now my Cookies are not set because of this.

10x




mixing cgi-bin mod_perl

2001-12-20 Thread Miroslav Madzarevic

The scenario:
There are two folders
/cgi-binwith plain perl cgi
/mod-perl   with Apache::Registry scripts

The application is being moved from cgi to mod_perl (Apache::Registry) one
script at a time.
My friend has a strange idea.
He wants to mix cgi-bin  mod_perl by testing all of the scripts in
cgi-bin and putting one cgi-script at a time into mod-perl folder.
He wants to do this internaly in Apache, changing the request for
a particular script so for example when you reference /cgi-bin/some_scr.pl
you actually end with /mod-perl/some_scr.pl. He doesn't want to
change the a href code from html files to stop pointing at /cgi-bin.
By moving all of them one at a time all of the application will
eventually end up working under mod_perl.

How can he do that ?

He thought of using mod_proxy or mod_rewrite.
The scripts are badly written and have been developed for three years
so far by various perl programmers.





Re: PPerl

2001-11-14 Thread Miroslav Madzarevic

PPerl is written in C and from a superficial look at the source code I'd say it's not 
very difficult to understand.
If you want a pure perl solution take a look at POE (its being worked on ithreads 
these days but can use event
driven fork) or consider writing something yourself. I guess the whole idea is in 
using socets and selects for 
waiting and then using eval on your end code.
-- 
Regards,

   mire

perl -Mstrict -e 'print pack(h*, d69627560496e616d656e236f6d6),\n'





keeping perl in memory

2001-09-14 Thread Miroslav Madzarevic

Blank
This question does and doesn't have to do with mod_perl.
I wish to keep perl binary (nothing related to apache) in memory so that
each time a specific script is invoked there is no cost of perl startup
time. The script gets executed many times (intercepts corporate, virtual
domain email).


Regards,
Mire
--
perl -Mstrict -e 'print pack(h*, d69627560496e616d656e236f6d6),\n'
OPTIMISED FOR HUMAN OPTICAL NERVE
BEST VIEWED WITH A MONITOR grin




Re: keeping perl in memory

2001-09-14 Thread Miroslav Madzarevic


I don't wan't anything related to Apache (no Apache, not even
Apache::Registry or anything else, I'm a mod perl, Mason programmer so I'm
familiar with them).

I just wanted to have perl binary persistent in memory (_like_ in mod_perl)
so that perl doesn't have to be loaded #!/usr/local/bin/perl on each _shell_
request and there could be many of requests (once per email).

But I found a solution with Matt Sergeant's help in using POE or some other
daemon and communicating with it. This way I have perl in some sort of
persistance. It's not a true replacement but it will do.

If there is another list to wich I should direct questions like these please
direct me.

Rgds,
  mire

- Original Message -
From: Ged Haywood [EMAIL PROTECTED]
To: Miroslav Madzarevic [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Friday, 14 September, 2001 14:55
Subject: Re: keeping perl in memory


  This question does and doesn't have to do with mod_perl.
  I wish to keep perl binary (nothing related to apache) in memory

 See the Guide:

 http://perl.apache.org/guide

 And read about Apache::Registry.







sharing % across requests

2001-09-06 Thread Miroslav Madzarevic

BlankWhat is the best way to share % across multiple requests ?

I first tried with $r-notes('name'='value') but that wasn't persistent
across requests (or maybe I was doing it wrong ?).
Then I made a system to load data from database once at process ($$) startup
and then fetch it from % (module global) on every request reloading hash if
there were any changes (add, delete, I used a file modif. date as an
indicator) and it works well but:
1) it wasn't easy for me - this was my first time doing this
2) I think it could be improved by making a module and tying hash to
that class. Now I have to call a sub to see if the hash needs to be reloaded
before using it in any sub.

The main point is that a have a small subset of variables that don't change
often but are often queried.

I'm developing in HTML::Mason. tnx.




mod_perl memory consumption

2001-08-27 Thread Miroslav Madzarevic

BlankI wrote a program that converts 5 gigs of emails stored in mysql to
phisical messages on disk (resulting in approximately 10 gigs). The program
consumes way to much memory although I've wrote it in a very clean way (use
strict, no globals, use of udef $var; to help free memory). I start it
telneting to :80 and through time process takes from 15 megs to more than
100 megs and only about 20% of messages are converted so far. The program
uses vpopmail.pm and should run approximately one day. Maybe it would be
faster if I used Apache::FakeRequest or something similar eleminating use of
mod_perl (plain cgi) ? I'm using HTML::Mason.

Why is the memory consumption so high ? According to my calculations it
should take less than 100 kilobytes.


Regards,
Mire
--
perl -Mstrict -e 'print pack(h*, d69627560496e616d656e236f6d6),\n'
OPTIMISED FOR HUMAN OPTICAL NERVE
BEST VIEWED WITH A MONITOR grin




new CGI.pm and multipart/form-data

2001-07-10 Thread Miroslav Madzarevic

Had the same problem two days ago, solved it by copying old CGI.pm (luckily
we have few computers running linux).

Does Cpan have old module versions ? I believe so ...




switch user id

2001-07-09 Thread Miroslav Madzarevic


As you know, apache runs as nobody.nogroup so these are the files I'm
allowed to access.
I wish to access files owned by otheruser.othergroup. How can I do this
under mod_perl (mason) ?
Is there a thing I can use to change my current uid so I can read the file
or directory I don't own ?

I don't want/cann't modify file permissions or ownership.


Regards,
Mire
--
In a world without fences who needs Gates?