You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Patrick Tully <pt...@avatartechnology.com> on 2002/10/10 16:23:56 UTC

udat and embpcgi

Hi,
I'm having a problem with udat running under cgi mode.  It doesn't seem to
be keeping session data.  Do i need mod_perl installed in order for it to
work?  I have the following installed on a linux/Apache box:

Embperl-2.0b8
Apache-Session-1.54
Apache-SessionX-2.00b3

Embperl found both Apache::Session and Apache::SessionX when i ran the
Makefile.PL and installed successfully.  I also have the following defined
in my embpcgi.pl file:

BEGIN
    {
        push(@INC, q(/home/alienated/local/lib/perl5/site_perl/5.6.1));
        push(@INC,
q(/home/alienated/local/lib/perl5/site_perl/5.6.1/Apache/SessionX/Generate))
;
# This line above apparently fixed a problem with SessionX, which seemed to
complain about undefined MD5 function on any page where i called udat

        push(@INC,
q(/home/alienated/local/lib/perl5/site_perl/5.6.1/i386-linux));
        $ENV{EMBPERL_SESSION_CLASSES} = "FileStore NullLocker";
        $ENV{EMBPERL_SESSION_ARGS} =
            "Directory=/home/alienated/cgi-bin/tmp";

        %Embperl::initparam = (use_env => 1, use_redirect_env => 1) ;
    }

(and i created the 'Directory' w/ permissions 777 - not sure if i need to?)
The test i'm running is as follows:

$udat{'count'}++;
print OUT $udat{'count'};

#(always prints 1)

Please let me know what i'm doing wrong or if its not possible to run under
my setup.  Thanks,

-Patrick-


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: udat and embpcgi

Posted by Gerald Richter <ri...@ecos.de>.
Hi,
>         $ENV{EMBPERL_SESSION_CLASSES} = "FileStore NullLocker";

Should be

$ENV{EMBPERL_SESSION_CLASSES} = "File Null";

(The FileStore and NullLocker was from Apache::Sesion 0.17 and doesn't works
anymore)


>         $ENV{EMBPERL_SESSION_ARGS} =
>             "Directory=/home/alienated/cgi-bin/tmp";
>

You should create the tmp directory outside of a directory that is
accessable through the webserver (this is a security problem and a problem
that will not work)


>         %Embperl::initparam = (use_env => 1, use_redirect_env => 1) ;
>     }
>
> (and i created the 'Directory' w/ permissions 777 - not sure if i need
to?)

Yes you need to

> The test i'm running is as follows:
>
> $udat{'count'}++;
> print OUT $udat{'count'};
>
> #(always prints 1)
>
> Please let me know what i'm doing wrong or if its not possible to run
under
> my setup.  Thanks,
>

Yes, it works with 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 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------




---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org