You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Michael Stepanov <mi...@francoudi.com> on 2005/01/05 15:06:17 UTC

Embperl::Object configure problems

Hi there,

I've used Embperl for 2 years. So, now I've decided to
try Embperl::Object.

I've configured apache as noticed below but when I request
target script I see output of only that script, not base.epl:


perl.conf:

PerlSetEnv EMBPERL_LOG /tmp/embperl.log
PerlSetEnv EMBPERL_DEBUG 33825832

LoadModule  embperl_module 
/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/auto/Embperl/Embperl.so 


PerlModule Embperl
PerlModule Embperl::Object

AddType text/html .epl
<FilesMatch ".*\.htm.?|.*\.epl$">
    SetHandler  perl-script
    PerlHandler Embperl
    Options     ExecCGI
</FilesMatch>


http.conf:

<VirtualHost *:80>

. . .   

    <Location "/opt/my_app/html">
       Embperl_AppName              app
       Embperl_Object_Base          base.epl
       Embperl_UriMatch             "\.htm.?|\.epl$"
       EMBPERL_MAIL_ERRORS_TO       michael@app.dom
       EMBPERL_MAIL_ERRORS_LIMIT    0
       EMBPERL_OBJECT_FALLBACK      error.html
       SetHandler                   perl-script
       PerlHandler                  Embperl::Object
       Options                      ExecCGI
    </Location>

    PerlInitHandler Apache::Reload
    PerlSetVar ReloadAll On
    PerlSetVar ReloadModules "VG::*"

    PerlSetEnv EMBPERL_SESSION_CLASSES "File Semaphore"
    PerlSetEnv EMBPERL_SESSION_ARGS 
"Directory=/opt/videoguide/share/session"

</VirtualHost>

base.epl:
    [-
         Execute ('header.epl');
         Execute ('content.epl');
         Execute ('footer.epl');
    -]

content.epl:
    [- Execute('*'); -]

main.epl:
    [- print OUT "Hello world!"; -]

Any suggestions?

-- 
Best regards,
Michael Stepanov

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


Re: Embperl::Object configure problems

Posted by Luiz Fernando <lu...@engenhosolucoes.com.br>.
Hi,

There is a clash between the FilesMatch and Location directives.
A simple example using .epo for EmbperlObject, .epl for plain Embperl
and .epr for resource files (files that are executed only:

# httpd.conf ------------------------------------------------------

AddType text/html .epl
AddType text/html .epo

PerlSetEnv EMBPERL_OPTIONS 262144
PerlSetEnv EMBPERL_OBJECT_BASE base.epr
PerlSetEnv EMBPERL_COOKIE_PATH /
PerlSetEnv EMBPERL_DEBUG 0

PerlModule HTML::Embperl

<Files *.epo>
           SetHandler perl-script
           PerlHandler HTML::EmbperlObject
           Options ExecCGI
</Files>

<Files *.epl>
           SetHandler perl-script
           PerlHandler HTML::Embperl
           Options ExecCGI
</Files>

<Files *.epr>
           order deny,allow
           deny from all
</Files>

# ------------------------------------------------------------------

Luiz Fernando B. Ribeiro
Engenho Soluções para a Internet
+55 11 4485-0136



Michael Stepanov wrote:

> Hi there,
>
> I've used Embperl for 2 years. So, now I've decided to
> try Embperl::Object.
>
> I've configured apache as noticed below but when I request
> target script I see output of only that script, not base.epl:
>
>
> perl.conf:
>
> PerlSetEnv EMBPERL_LOG /tmp/embperl.log
> PerlSetEnv EMBPERL_DEBUG 33825832
>
> LoadModule  embperl_module 
> /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/auto/Embperl/Embperl.so 
>
>
> PerlModule Embperl
> PerlModule Embperl::Object
>
> AddType text/html .epl
> <FilesMatch ".*\.htm.?|.*\.epl$">
>    SetHandler  perl-script
>    PerlHandler Embperl
>    Options     ExecCGI
> </FilesMatch>
>
>
> http.conf:
>
> <VirtualHost *:80>
>
> . . .  
>    <Location "/opt/my_app/html">
>       Embperl_AppName              app
>       Embperl_Object_Base          base.epl
>       Embperl_UriMatch             "\.htm.?|\.epl$"
>       EMBPERL_MAIL_ERRORS_TO       michael@app.dom
>       EMBPERL_MAIL_ERRORS_LIMIT    0
>       EMBPERL_OBJECT_FALLBACK      error.html
>       SetHandler                   perl-script
>       PerlHandler                  Embperl::Object
>       Options                      ExecCGI
>    </Location>
>
>    PerlInitHandler Apache::Reload
>    PerlSetVar ReloadAll On
>    PerlSetVar ReloadModules "VG::*"
>
>    PerlSetEnv EMBPERL_SESSION_CLASSES "File Semaphore"
>    PerlSetEnv EMBPERL_SESSION_ARGS 
> "Directory=/opt/videoguide/share/session"
>
> </VirtualHost>
>
> base.epl:
>    [-
>         Execute ('header.epl');
>         Execute ('content.epl');
>         Execute ('footer.epl');
>    -]
>
> content.epl:
>    [- Execute('*'); -]
>
> main.epl:
>    [- print OUT "Hello world!"; -]
>
> Any suggestions?
>

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


Re: Embperl::Object configure problems

Posted by Michael Stepanov <mi...@francoudi.com>.
Gerald Richter wrote:

>><Location "/var/www/test/html">
>>    
>>
>
>Looks like you should use <Directory /var/www/test/html>
>  
>
Thanks, Gerald, it resolved my problem.

>Gerald
>
>
>  
>
>>EMBPERL_APPNAME test
>>EMBPERL_OBJECT_BASE base.html
>>EMBPERL_URIMATCH "\.htm.?|\.epl$"
>>SetHandler perl-script
>>PerlHandler Embperl::Object
>>Options ExecCGI
>></Location>
>></VirtualHost>
>>------------------------------------
>>
>>And in this case Embperl doesn't work at all. A browser 
>>displays source of page.
>>
>>Any suggestions?
>>
>>--
>>Best regards,
>>Michael Stepanov
>>Perl/Linux Developer
>>
>>
>>    
>>
>
>  
>


-- 
Best regards, 
Michael Stepanov
Perl/Linux Developer
Francoudi & Stephanou Ltd
Tel: +357 25-867154
Email: michaelstepanov@francoudi.com


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


RE: Embperl::Object configure problems

Posted by Gerald Richter <ri...@ecos.de>.
> 
> <Location "/var/www/test/html">

Looks like you should use <Directory /var/www/test/html>

Gerald


> EMBPERL_APPNAME test
> EMBPERL_OBJECT_BASE base.html
> EMBPERL_URIMATCH "\.htm.?|\.epl$"
> SetHandler perl-script
> PerlHandler Embperl::Object
> Options ExecCGI
> </Location>
> </VirtualHost>
> ------------------------------------
> 
> And in this case Embperl doesn't work at all. A browser 
> displays source of page.
> 
> Any suggestions?
> 
> --
> Best regards,
> Michael Stepanov
> Perl/Linux Developer
> 
> 


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


Re: Embperl::Object configure problems

Posted by Michael Stepanov <mi...@francoudi.com>.
Gerald Richter wrote:

>
>For every virtual host define a different name with
>
>Embperl_Appname
>  
>
Thanks, I understand that. But I don't understand whole picture.
Let's see configuration of Embperl:
1) load mo_perl.so;
2) load Embperl.so;
3) Add new file type - text/html - *.epl;
4) load Embperl.pm;
3) specify handler for *.epl.

perl.conf
------------------------
LoadModule perl_module modules/mod_perl.so
LoadModule embperl_module 
/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/auto/Embperl/Embperl.so
AddType text/html .epl
PerlModule Embperl
<FilesMatch ".*\.epl|.*\.html$">
SetHandler perl-script
PerlHandler Embperl
Options ExecCGI
</FilesMatch>
------------------------
All those definitions I've put into conf.d/perl.conf

Well, than I've tried to configure Embperl::Object:

perl.conf
--------------------------
LoadModule perl_module modules/mod_perl.so
LoadModule embperl_module 
/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/auto/Embperl/Embperl.so

EMBPERL_DEBUG 33825832
EMBPERL_LOG /tmp/embperl.log
EMBPERL_OBJECT_BASE base.html

AddType text/html .epl

PerlModule Embperl

<FilesMatch ".*\.epl|.*\.htm?$">
SetHandler perl-script
PerlHandler Embperl::Object
Options ExecCGI
</FilesMatch>
--------------------------

http.conf
------------------------------------
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/test/html
DirectoryIndex index.html
ServerName test.misha.dom
ErrorLog logs/test-error_log
CustomLog logs/test-access_log common

<Location "/var/www/test/html">
EMBPERL_APPNAME test
EMBPERL_OBJECT_BASE base.html
EMBPERL_URIMATCH "\.htm.?│\.epl$"
SetHandler perl-script
PerlHandler Embperl::Object
Options ExecCGI
</Location>
</VirtualHost>
------------------------------------

And in this case Embperl doesn't work at all. A browser displays
source of page.

Any suggestions?

-- 
Best regards, 
Michael Stepanov
Perl/Linux Developer


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


RE: Embperl::Object configure problems

Posted by Gerald Richter <ri...@ecos.de>.
> Sorry for that stupid question but I still have the problem 
> with configuration of Embperl::Object. Well, I'd like to have 
> the different configuration of Embper::Object but I couldn't 
> setup it into <VitualHost> ... </VitualHost>. Possibly, it 
> happend because it needs to define configuration directives 
> before load Embperl module, doesn't it?
> 

For every virtual host define a different name with

Embperl_Appname


Gerald


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


Re: Embperl::Object configure problems

Posted by Michael Stepanov <mi...@francoudi.com>.
Gerald Richter wrote:

>><FilesMatch ".*\.htm.?|.*\.epl$">
>>    SetHandler  perl-script
>>    PerlHandler Embperl
>>    Options     ExecCGI
>></FilesMatch>
>>
>>    
>>
>
>Remove this block, or put it in a different <Directoy ...> block then the
>Embperl::Object stuff
>  
>
Sorry for that stupid question but I still have the problem with 
configuration of
Embperl::Object. Well, I'd like to have the different configuration of 
Embper::Object
but I couldn't setup it into <VitualHost> ... </VitualHost>. Possibly, 
it happend because
it needs to define configuration directives before load Embperl module, 
doesn't it?

So, could somebody send me example of http.conf and perl.conf for case using
Embperl and Embperl::Object together into virtual hosts, please?

Thanks in advanced!

--

Best regards, 
Michael Stepanov
Perl/Linux Developer



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


Re: Embperl::Object configure problems

Posted by Michael Stepanov <mi...@francoudi.com>.
Gerald Richter wrote:

>>Thanks, Gerald, for your answer. But I still have a problem 
>>with configuration of Embperl::Object. I see in the browser error:
>>
>>
>>  Internal Server Error
>>
>>
>>and there are not any error messages into main http error log 
>>of virtual host error log. Any suggestions?
>>
>>    
>>
>
>Are you really sure that you don't get an error message in some error log.
>Every Internal Server Error shows up somewhere in the error log. Maybe there
>is an area in your config, which has disabled the error log?
>  
>
Yes, I'm sure. It's very strange. I've checked log file of virtual host and
main log file. There were not any messages!

>Gerald
>
>
>  
>
>>>Gerald
>>>
>>> 
>>>
>>>      
>>>
>>--
>>Best regards,
>>Michael Stepanov
>>Perl/Linux Developer
>>Francoudi & Stephanou Ltd
>>Tel: +357 25-867154
>>Email: michaelstepanov@francoudi.com
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
>>For additional commands, e-mail: embperl-help@perl.apache.org
>>
>>
>>    
>>
>
>  
>


-- 
Best regards, 
Michael Stepanov
Perl/Linux Developer
Francoudi & Stephanou Ltd
Tel: +357 25-867154
Email: michaelstepanov@francoudi.com


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


RE: Embperl::Object configure problems

Posted by Gerald Richter <ri...@ecos.de>.
> Thanks, Gerald, for your answer. But I still have a problem 
> with configuration of Embperl::Object. I see in the browser error:
> 
> 
>   Internal Server Error
> 
> 
> and there are not any error messages into main http error log 
> of virtual host error log. Any suggestions?
> 

Are you really sure that you don't get an error message in some error log.
Every Internal Server Error shows up somewhere in the error log. Maybe there
is an area in your config, which has disabled the error log?

Gerald


> >Gerald
> >
> >  
> >
> 
> 
> --
> Best regards,
> Michael Stepanov
> Perl/Linux Developer
> Francoudi & Stephanou Ltd
> Tel: +357 25-867154
> Email: michaelstepanov@francoudi.com
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> For additional commands, e-mail: embperl-help@perl.apache.org
> 
> 


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


Re: Embperl::Object configure problems

Posted by Michael Stepanov <mi...@francoudi.com>.
Gerald Richter wrote:

>><FilesMatch ".*\.htm.?|.*\.epl$">
>>    SetHandler  perl-script
>>    PerlHandler Embperl
>>    Options     ExecCGI
>></FilesMatch>
>>
>>    
>>
>
>Remove this block, or put it in a different <Directoy ...> block then the
>Embperl::Object stuff
>  
>
Thanks, Gerald, for your answer. But I still have a problem with
configuration of Embperl::Object. I see in the browser error:


  Internal Server Error


and there are not any error messages into main http error log of
virtual host error log. Any suggestions?

>Gerald
>
>  
>


-- 
Best regards, 
Michael Stepanov
Perl/Linux Developer
Francoudi & Stephanou Ltd
Tel: +357 25-867154
Email: michaelstepanov@francoudi.com


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


RE: Embperl::Object configure problems

Posted by Gerald Richter <ri...@ecos.de>.
> <FilesMatch ".*\.htm.?|.*\.epl$">
>     SetHandler  perl-script
>     PerlHandler Embperl
>     Options     ExecCGI
> </FilesMatch>
> 

Remove this block, or put it in a different <Directoy ...> block then the
Embperl::Object stuff

Gerald


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