Mailing List Archive

How to set EMBPERL_whatever in CGI environment?
I am using the old Apache 1.2.6 and it apparently doesn't recognize
SetEnv so I don't know how to change the environment variables in
my scripts (which are running as CGI, not EmbPerl). Is there a way
to do this?

--
Scott Chapman
Technical Support Specialist
Lund Performance Solutions
Scott@lund.com or Support@lund.com
Phone: 541-926-3800 www.lund.com
Re: How to set EMBPERL_whatever in CGI environment? [ In reply to ]
Scott Chapman wrote:

> I am using the old Apache 1.2.6 and it apparently doesn't recognize
> SetEnv so I don't know how to change the environment variables in
> my scripts (which are running as CGI, not EmbPerl). Is there a way
> to do this?
>

Someone please step in if I am leading him astray since I have never run
Emperl in CGI mode. Set the variables at the top of the script - i.e.
$ENV{EMBPERL_LOG} = "/where/ever/it/is/embperl.log"

I don't know if all the variables work the same under CGI as they do
under mod_perl.

What is the performance like when used CGI based vs. mod_perl?
Do sessions work and if they do, do they work the same way?

Aaron Johnson

>
> --
> Scott Chapman
> Technical Support Specialist
> Lund Performance Solutions
> Scott@lund.com or Support@lund.com
> Phone: 541-926-3800 www.lund.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> For additional commands, e-mail: embperl-help@perl.apache.org
Re: How to set EMBPERL_whatever in CGI environment? [ In reply to ]
Thanks for the reply,

I think I can set them during the script. The question (I should have
been more clear) is do they have to be set prior to running the
script, as they are when set via SetEnv?

As for speed, I haven't had the chance to compare the two methods
and the subjective speed of a CGI request is not useful as a point of
comparison. My perception is that it's quite slow but I think this is a
busy server. It's in a virtual server environment so I can't find the
actual cpu usage, etc. for the entire system. :-( I'm going to see if I
can increase the debug options via the environment vars and get
more details on performance.

I haven't experimented with sessions yet. Gerald can give you a
definitive answer on that one.

On 24 May 00, at 12:54, Aaron Johnson wrote:
> Scott Chapman wrote:
>
> > I am using the old Apache 1.2.6 and it apparently doesn't recognize
> > SetEnv so I don't know how to change the environment variables in
> > my scripts (which are running as CGI, not EmbPerl). Is there a way
> > to do this?
> >
>
> Someone please step in if I am leading him astray since I have never run
> Emperl in CGI mode. Set the variables at the top of the script - i.e.
> $ENV{EMBPERL_LOG} = "/where/ever/it/is/embperl.log"
>
> I don't know if all the variables work the same under CGI as they do
> under mod_perl.
>
> What is the performance like when used CGI based vs. mod_perl?
> Do sessions work and if they do, do they work the same way?

--
Scott Chapman
Technical Support Specialist
Lund Performance Solutions
Scott@lund.com or Support@lund.com
Phone: 541-926-3800 www.lund.com
RE: How to set EMBPERL_whatever in CGI environment? [ In reply to ]
>
> I think I can set them during the script. The question (I should have
> been more clear) is do they have to be set prior to running the
> script, as they are when set via SetEnv?
>

If you want to set them via the %ENV hash, you must place them at the top of
embpcgi.pl.

But SetEnv with Apache works! "make test" uses just that to make the CGI
tests and I always tests Embperl on many different Apache version before I
release a new version, so I am sure SetEnv & CGI & Apache 1.2.6 works
together!

There must be another problem, why SetEnv doesn't work for you.

Note: SetEnv can only occur in server or virtual server context, not in
.htaccess or directory blocks like PerlSetEnv.

> As for speed, I haven't had the chance to compare the two methods
> and the subjective speed of a CGI request is not useful as a point of
> comparison. My perception is that it's quite slow but I think this is a
> busy server. It's in a virtual server environment so I can't find the
> actual cpu usage, etc. for the entire system. :-( I'm going to see if I
> can increase the debug options via the environment vars and get
> more details on performance.
>

CGI is much slower then mod_perl, because under mod_perl the Perl code (of
Embperl itself and of every Embperl page) is compiled only within the first
request. So starting with the second request Embperl will serve pages _much_
faster.

> I haven't experimented with sessions yet. Gerald can give you a
> definitive answer on that one.
>

Sessions works exactly the same way under CGI, then under mod_perl. The main
difference between CGI and mod_perl environement, beside speed, is that you
can't use the Apache API under CGI.

Gerald


-------------------------------------------------------------
Gerald Richter ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: richter@ecos.de Voice: +49 6133 925151
WWW: http://www.ecos.de Fax: +49 6133 925152
-------------------------------------------------------------
Re: How to set EMBPERL_whatever in CGI environment? [ In reply to ]
> Thanks for the answers. Is there a way to set up virtual log under
> the CGI environment? I can't set up a place like this in httpd.conf:
>
> <Location /embperl/log>
> SetHandler perl-script
> PerlHandler HTML::Embperl
> Options ExecCGI
> </Location>
>
> Any clues? :-)
>

I didn't tried it, but I think

ScriptAlias /embperl/log /path/to/embpcgi.pl

should do the job.

Gerald