You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by randy reed <rw...@linkline.com> on 2002/07/22 20:17:27 UTC

.bml files not executing in apache

Hi All,

I am setting up a livejournal server and have installed modperl on a windows xp machine. Livejournal uses bradfitz bml (better markup language) to control its look. On my system however, the .bml files do not execute. When I access them I get source only. I'm told BML is a standard part of modperl now, but I suspect there is not something set up correctly 
in my httpd.conf file to make it execute properly bml.pm. I created a minimal httpd.conf file based on the livejournal manual which I have attached my httpd file at the end of this message. Can anyone help me?
Thanks in advance
Randy

Httpd.conf contains:
ServerType standalone
ServerRoot "c:\apache"
PidFile logs/httpd.pid
ScoreBoardFile logs/apache_runtime_status
Timeout 30
KeepAlive Off

MinSpareServers 5
MaxSpareServers 40
#StartServers 10
MaxClients 20
MaxRequestsPerChild 500

LoadFile "C:/openssl/bin/libeay32.dll"
LoadFile "C:/openssl/bin/ssleay32.dll"
LoadModule ssl_module modules/mod_ssl.so
LoadFile "C:/Apache/modules/php4ts.dll"
LoadModule php4_module modules/php4apache.dll
LoadFile "C:/Perl/bin/perl56.dll"
LoadModule perl_module modules/mod_perl.so

ClearModuleList
#AddModule mod_env.c
AddModule mod_mime.c
#AddModule mod_negotiation.c
#AddModule mod_status.c
#AddModule mod_info.c
#AddModule mod_include.c
AddModule mod_autoindex.c
AddModule mod_dir.c
#AddModule mod_perl.c
AddModule mod_so.c
AddModule mod_setenvif.c
AddModule mod_php4.c
AddModule mod_perl.c
AddModule mod_ssl.c

Port 80
#User lj
#Group lj

SendBufferSize 131072

ServerName   www.thefreemachine.cc

DocumentRoot "c:\livejournal\htdocs"

PerlSetEnv   LJHOME c:\livejournal
PerlRequire  c:\livejournal\cgi-bin\modperl.pl




Re: .bml files not executing in apache

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Tue, 23 Jul 2002, randy reed wrote:

> Hi Randy,
> 
> Thanks for your reply. Please excuse my utter newbie status at
> all this. Ok, looking at your message and the documentation for
> mod_perl as well as the LJ documentation here's what I see.
> 
> BML is actually setup up as a perl module Apache::BML its
> excuted in a file called modperl.pl In httpd.conf there is a
> PerlRequire c:/livejournal/cgi-bin/modperl.pl but, as you can
> see if you try to get on my site
> (www.thefreemachine.cc/index.bml) it doesn't excute. So whats
> missing that would get httpd to call it when it receives a
> request for a .bml file. Is there something I'm missing here
> (this is running on a windows machine), the code seems fairly
> straightforward
> 
> PerlInitHandler +Apache::LiveJournal
> DirectoryIndex index.html index.bml
> });
> 
> unless ($LJ::SERVER_TOTALLY_DOWN)
> {
>     Apache->httpd_conf(qq{
> # BML support:
> PerlSetVar BMLDomain lj-$LJ::DOMAIN
> PerlModule Apache::BML
> <Perl>
>   Apache::BML::load_config("lj-$LJ::DOMAIN", "$LJ::HOME/cgi-bin/bmlp.cfg");
> </Perl>
> <Files ~ "\\.bml\$">
>   SetHandler perl-script
>   PerlHandler Apache::BML
> </Files>
> });
> }

I'm not familiar enough with how the bml stuff works to
offer anything specific there to look at. Is there anything
in the error logs that might help? Also, are you sure that
that c:/livejournal/cgi-bin/modperl.pl is successfully loaded,
and in particular that variables like $LJ::DOMAIN and
$LJ::SERVER_TOTALLY_DOWN are reaching Apache->httpd_conf()?
And is the bmlp.cfg file being read? One way to check these
things is to put some print statements in various locations
to let you know that that point is being reached.

-- 
best regards,
randy kobes


Re: .bml files not executing in apache

Posted by randy reed <rw...@linkline.com>.
Hi Randy,

Thanks for your reply. Please excuse my utter newbie status at all this. Ok,
looking at your message and the documentation for mod_perl as well as the LJ
documentation here's what I see.

BML is actually setup up as a perl module Apache::BML
its excuted in a file called modperl.pl  In httpd.conf there is a
PerlRequire c:/livejournal/cgi-bin/modperl.pl
but, as you can see if you try to get on my site
(www.thefreemachine.cc/index.bml) it doesn't excute. So whats missing that
would get httpd to call it when it receives a request for a .bml file. Is
there something I'm missing here (this is running on a windows machine), the
code seems fairly straightforward

PerlInitHandler +Apache::LiveJournal
DirectoryIndex index.html index.bml
});

unless ($LJ::SERVER_TOTALLY_DOWN)
{
    Apache->httpd_conf(qq{
# BML support:
PerlSetVar BMLDomain lj-$LJ::DOMAIN
PerlModule Apache::BML
<Perl>
  Apache::BML::load_config("lj-$LJ::DOMAIN", "$LJ::HOME/cgi-bin/bmlp.cfg");
</Perl>
<Files ~ "\\.bml\$">
  SetHandler perl-script
  PerlHandler Apache::BML
</Files>
});
}

any help you could give would be greatfully appreciated.
Randy R



Re: .bml files not executing in apache

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Mon, 22 Jul 2002, randy reed wrote:

> Hi All,
> 
> I am setting up a livejournal server and have installed modperl
> on a windows xp machine. Livejournal uses bradfitz bml (better
> markup language) to control its look. On my system however, the
> .bml files do not execute. When I access them I get source
> only. I'm told BML is a standard part of modperl now, but I
> suspect there is not something set up correctly in my
> httpd.conf file to make it execute properly bml.pm. I created a
> minimal httpd.conf file based on the livejournal manual which I
> have attached my httpd file at the end of this message. Can
> anyone help me? Thanks in advance 
> Randy
[ ... ] 
bml isn't part of a standard mod_perl distribution. From
the sources at http://www.bradfitz.com/bml/, it's apparent one
has to do some configuration to tell Apache what action to take
with bml files. Try getting that working under standard cgi, and
then from there try adapting it to mod_perl, perhaps under
Apache::Registry. However, this may be difficult, as the 
bml handler, bmlp.pl, doesn't compile under 'use strict;',
which is generally good practice to use for registry scripts.

-- 
best regards,
randy kobes