SID-00061: Mod_Perl_Startup Error
| Status: |
Answered |
TWiki version: |
4.2.0 |
Perl version: |
IndigoPerl |
| Category: |
|
Server OS: |
Windows 2003 Server |
Last update: |
16 years ago |
This package can't be used under threaded MPMs at D:/INDIGO~1/perl/site/lib/ModPerl/RegistryPrefork.pm line 12.
Compilation failed in require at D:/INDIGO~1/perl/site/lib/ModPerl/RegistryLoader.pm line 153.\nCompilation failed in require at (eval 2) line 1.
[Wed Jan 28 11:50:46 2009] [error] Can't load Perl file: D:/twiki/twiki/tools/mod_perl_startup.pl for server icdevsrv01.intra.schuf.biz:0, exiting...
This is the error message I get when I use the mod_perl_startup script generated from
ApacheConfigGenerator
Am I missing something?
--
RajeshN - 28 Jan 2009
Discussion and Answer
#!/usr/bin/perl -w
use strict;
use warnings;
$ENV{MOD_PERL} =~ /mod_perl/ or die "mod_perl_startup called, but mod_perl not used!";
use ModPerl::RegistryLoader;
use File::Spec;
my $binurlbase = '/twiki/bin'; # must be set by the user
my $binbase = 'd:/twiki/twiki/bin'; # must be set by the user
my $registrymodule = 'ModPerl::RegistryPrefork'; # must be set by the user
my $rl = ModPerl::RegistryLoader->new(
package => $registrymodule, # must be set by the user
);
chdir $binbase;
foreach my $binscript (<$binbase/*>) {
my (undef,undef,$scriptname) = File::Spec->splitpath($binscript);
$scriptname =~ m|^([^/]+)$|;
my $script = $1;
if ($script !~ m/configure|register|resetpasswd/) { # don't precompile uncommon commands especially configure which has a ton of unnecessary s***
$binscript =~ m|^(.+)$|;
my $bin = $1;
open BINSCRIPT,'<',$binscript;
if (<BINSCRIPT> =~ m|^\#\!/usr/bin/perl|) {
$rl->handler("$binurlbase/$script", $bin);
}
close BINSCRIPT;
}
}
1;
This is the startup script that I used
--
RajeshN - 28 Jan 2009
Try disabling mod_perl by commenting out the mod_perl_startup script call. You will not need it unless you have a lot of traffic. TWiki.org currently runs under plain CGI.
--
PeterThoeny - 01 Feb 2009
Hi Peter, My Twiki page open up very slowly, an normal page takes upto 15 secs to open up ! So I thought of using an cache techniques... and when I was surfing through the help pages.. I found that Mod_perl could be used for such purposes... What should I do in this case...? Any suggestions ?
--
RajeshN - 02 Feb 2009
Something is wrong. Even with 3 year old server you should get 1-2 sec access time. On Windows you could try a Linux based TWiki inside a VMware image, such as
TWikiVMDebianStable.
--
PeterThoeny - 02 Feb 2009
I would suerly try out the VMware image !
BTW., Specification of my server is as follows... Dell
PowerEdge 850 Windows Server 2003 R2 Pentium D 3.0 GHz 3 GB RAM 2x 160 GB SATA 7200 RPM disks – no RAID.
The slowest page is 675 KB when loaded, and contains a Treebrowser with approx 380 nodes - This takes nearly 15 to 20 seconds
A simple page with no treebrower and a single paragraph of text takes 7 to 8 seconds to open up
Is this normal?
Also I can see the CPU usage spiking to 100% for perl.exe from the time that you click the link to the time that the page is displayed.
Is there are any tool avaliable to actually see what is happening.
--
RajeshN - 02 Feb 2009
Hi Rajesh, I got the same message and have crawled thru several apache and mod-perl man pages. Finally I got for me as solution:
Change the following line in your mod_perl_startup script:
my $registrymodule = 'ModPerl::RegistryPrefork'; # must be set by the user
To :
my $registrymodule = 'ModPerl::Registry'; # must be set by the user
The RegistryPrefork module is not threadsafe and so it dies
"if Apache2::MPM->is_threaded;" but ModPerl::Registry will not die.
--
MartinKedaj - 23 Mar 2009
Now my mod_perl startup script looks like below
#!c:/perl/bin/perl.exe -w
use strict;
use warnings;
use ModPerl::RegistryLoader;
use File::Spec;
my $binurlbase = '/twiki/bin'; # must be set by the user
my $binbase = 'd:/twiki/twiki/bin'; # must be set by the user
my $libbase = 'd:/twiki/twiki/lib'; # must be set by the user
my $registrymodule = 'ModPerl::Registry'; # must be set by the user
my $rl = ModPerl::RegistryLoader->new(
package => $registrymodule, # must be set by the user
);
chdir $binbase;
foreach my $binscript (<$binbase/*>) {
my (undef,undef,$scriptname) = File::Spec->splitpath($binscript);
$scriptname =~ m|^([^/]+)$|;
my $script = $1;
if ($script !~ m/configure|register|resetpasswd|statistics/) { # don't precompile uncommon commands especially configure which has a ton of unnecessary s***
$binscript =~ m|^(.+)$|;
my $bin = $1;
open BINSCRIPT,'<',$binscript;
if (<BINSCRIPT> =~ m|^\#\!c:/perl/bin|) {
$rl->handler("$binurlbase/$script", $bin);
}
close BINSCRIPT;
}
}
1;
And when I use this startup script , I get the following error:-
[Tue Mar 24 02:38:19 2009] mod_perl_startup.pl: readline() on closed filehandle BINSCRIPT at d:/twiki/twiki/tools/mod_perl_startup.pl line 26.
[Tue Mar 24 02:38:19 2009] [error] syntax error at d:/twiki/twiki/bin/benchmark line 46, near "/twiki\t\t# path relative to twiki host, not full URL\nviewurl=$baseurl/view\ntries"\nsyntax error at d:/twiki/twiki/bin/benchmark line 87, near "# Redirect output, flush header before stderr gets in the way\t\necho "Content-type: text/plain\n\n""\nsyntax error at d:/twiki/twiki/bin/benchmark line 96, near "d)\t"\nsyntax error at d:/twiki/twiki/bin/benchmark line 97, near "h)\t"\nsyntax error at d:/twiki/twiki/bin/benchmark line 115, near ""\n\t\texit 0;;\n\tq)\tv=:;;\n\tv)\tviewurl="$OPTARG"\nCompilation failed in require at (eval 3) line 1.\n
[Tue Mar 24 02:38:19 2009] [error] Can't load Perl file: d:/twiki/twiki/tools/mod_perl_startup.pl for server icdevsrv01.intra.schuf.biz:0, exiting...
Did you get something like this????
--
RajeshN - 24 Mar 2009
Closing this question after more than 30 days of inactivity. Feel free to reopen if needed. Consider engaging one of the
TWiki consultants if you need timely help. We invite you to
get involved with the community, it is more likely you get community support if you support the open source project!
--
PeterThoeny - 2009-05-02
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.