Tags:
create new tag
view all tags

Question

Hello TWiki experts,

I really appreciate this platform. I use it to manage the different Projects we develop in our office.

I am using TWiki 4.1.2 on Ubuntu Gutsy with apache and mod_perl without many difficulties. This week i started installing the new version 4.2.0 in a different directory to start moving data from old version to the new one.

I followed the installation instructions to configure apache+mod_perl. I ran the apache config+mod_perl generator to configure apache. I used the TWiki configure script to verify and finish configuring the platform, and all went well. But, when i first accessed the TWiki.WebHome, it showed the data from the old version. I'm pretty sure that the config files are all pointing to the right places. After verifying all the config files, i found what i think could be the problem.

The mod_perl init scripts (mod_perl_startup.pl) of the installed versions (4.1.2 and 4.2.0) have a path that points for each installation path. This is conflicting to have both versions running simultaneously. Actually, if i try to load apache2 with both scripts, apache fails to run. When i comment out the line where it calls the mod_perl script of version 4.2.0, i see the data of my old version in both urls (old and new system). When I comment out the line of mod_perl script of version 4.1.2, i see the data of 4.2.0 in both urls.

This is the contents of mod_perl_startup.pl for the two versions:

Version 4.1.2

$ENV{MOD_PERL} =~ /mod_perl/ or die "mod_perl_startup called, but mod_perl not used!";
use lib qw( /var/lib/twiki/bin );
require 'setlib.cfg';
1;

Version 4.2.0

#!/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 = '/twiki2/bin'; # must be set by the user
my $binbase = '/media/md0/twiki4.2.0/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;

Am I thinking right? is this a bug? How can i solve it?

Thanks for any help.

Environment

TWiki version: TWikiRelease04x02x00
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: Ubuntu Linux 7.10 Gutsy, kernel 2.6.22-14-server
Web server: Apache 2.2.4
Perl version: perl v5.8.8
Client OS:  
Web Browser:  
Categories: Installation, Fatal error

-- MarcioFigueira - 17 Jul 2008

Answer

ALERT! 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.

Running two different versions of TWiki both under mod_perl is close to impossible. With mod_perl, the web server processes compile Perl modules into their own memory; and Perl allows only one instance of every module to be loaded simultaneously. If you try, your apache processes will end up with having loaded modules from both versions at random, depending on the sequence of requests.

There's a simple workaround, and a difficult solution:

The workaround
Run only one version under mod_perl and the other version under mod_cgi. That's what I usually do: Production is under mod_perl, testing under mod_cgi. By the way: There is no problem with multiple simultaneous mod_cgi instances.
The solution
Run different instances of the web server process. This is difficult because it forces you to abandon the simple administration interfaces of your Linux distribution, and dive into the innards of how to start two HTTP daemons, using different apache config files.

-- HaraldJoerg - 17 Jul 2008

That's why I said TWiki Experts!

-- MarcioFigueira - 18 Jul 2008

Change status to:
Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2008-07-18 - MarcioFigueira
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.