Tags:
create new tag
view all tags

SID-01652: Enabling mod_perl Causes Working Twiki to Fail

Status: Answered Answered TWiki version: 5.1.4 Perl version: 5.10.1, mod_perl 2.0.4
Category: CategoryInstallation Server OS: RHEL 6.1 Last update: 10 years ago

I have a fresh installation of Twiki 5.1.4 on RHEL 6.1. I believe I've followed the instructions because I can easily get a working version of Twiki up and running. (I used the ApacheConfigGenerator to create twiki.conf and the mod_perl_startup.pl script). This is on a system without mod_perl installed. When I install mod_perl (using yum), and make no other changes other than restarting apache, going to any Twiki page generates a

"Could not find template view"

error message.

I don't see anything in the httpd log files that looks relevant.

Does anybody have any ideas? I've googled around but I didn't see anything.

Thanks

-- Jon Forrest - 2013-03-06

Discussion and Answer

I think I now know what's causing the problem, although I don't know why.

I changed the apache configuration to only have one worker process so that I could run strace on that process. Strace shows something very interesting, e.g.

stat("$TWiki::cfg{TemplateDir}/view.tagme.tmpl", 0x7f25a2c93240) = -1 ENOENT (No such file or directory) stat("$TWiki::cfg{TemplateDir}/view.topmenu.tmpl", 0x7f25a2c93240) = -1 ENOENT (No such file or directory) stat("$TWiki::cfg{TemplateDir}/view.pattern.tmpl", 0x7f25a2c93240) = -1 ENOENT (No such file or directory) stat("$TWiki::cfg{TemplateDir}/Main/view.tmpl", 0x7f25a2c93240) = -1 ENOENT (No such file or directory) stat("$TWiki::cfg{TemplateDir}/Main/view.tmpl", 0x7f25a2c93240) = -1 ENOENT (No such file or directory) stat("$TWiki::cfg{TemplateDir}/Main/view.tmpl", 0x7f25a2c93240) = -1 ENOENT (No such file or directory)

Note the unexpanded perl variables in the stat calls. I modified lib/LocalSite.cfg so that $TWiki::cfg{TemplatePath} has the explicit paths in addition to the ones that appear in the stat calls, e.g.

/var/www/html/twiki/templates/$name.tmpl $TWiki::cfg{TemplateDir}/$name.tmpl

That fixed the problem! So, for some reason, mod_perl is preventing these Perl variables from being expanded. Anybody have any ideas why this might be happening?

-- Jon Forrest - 2013-03-07

Not sure why the variable does not resolve. However, I am wondering why you have the variable unexpanded. When you run configure for the first time, the LocalSite.cfg file is created with all variables in variables expanded.

-- Peter Thoeny - 2013-03-10

That's interesting. I'll do a test run of configure to double check, but I'm pretty sure this isn't happening. That is, the variables appear unexpanded. Meanwhile, let's say that I'm right. What could cause this?

-- Jon Forrest - 2013-03-13

I don't know why the vars do next get expanded under mod_perl. Time to debug.

-- Peter Thoeny - 2013-03-13

Peter,

I just started over from scratch and the same thing happened again. The fix was the same.

Here are the steps I use to install Twiki:

yum install rcs zip perl-CGI-Session perl-CGI perl-URI mlocate perl-libwww-perl
cp twiki.gz into /usr/local/src
cd /var/www
tar -zxvf /usr/local/src/TWiki-5.1.4.tgz
cd twiki
chown -R apache:apache .
cd bin
cp LocalLib.cfg.txt LocalLib.cfg
chown apache:apache LocalLib.cfg
vi LocalLib.cfg
   change $twikiLibPath = "/var/www/twiki/lib";
Use  http://twiki.org/cgi-bin/view/TWiki/ApacheConfigGenerator to generate /etc/httpd/conf.d/twiki.conf
   and /var/www/twiki/tools/mod_perl_startup.pl
chown -R apache:apache /var/www/twiki
restart apache
run https://example.com/twiki/bin/configure
yum install mod_perl
chown -R apache:apache /var/www/twiki
restart apache

I suspect that anybody trying to use Twiki with mod_perl on RHEL will have this problem. I'd be happy to work with you to try to resolve this.

-- Jon Forrest - 2013-03-18

I do not understand why your LocalSite.cfg has an unexpanded {TemplatePath}. I just did another test install, and after run configure I get this properly expanded template path:

$TWiki::cfg{TemplatePath} = '/var/www/thoeny.org/test/twiki514/templates/$web/$name.$skin.tmpl, /var/www/thoeny.org/test/twiki514/templates/$name.$skin.tmpl, /var/www/thoeny.org/test/twiki514/templates/$web/$name.tmpl, /var/www/thoeny.org/test/twiki514/templates/$name.tmpl, $web.$skinSkin$nameTemplate, TWiki.$skinSkin$nameTemplate, $web.$nameTemplate, TWiki.$nameTemplate';

-- Peter Thoeny - 2013-03-19

I don't understand why either. Would you like to do a WebEx (or equivalent) sometime to see what's going on? I've got my new Twiki site up and running so I don't need this resolved myself but if it would help other people that would be great.

Did you use RHEL6 (or CentOS6) when you did your test?

-- Jon Forrest - 2013-03-21

I did the test on CentOS 5.9.

-- Peter Thoeny - 2013-03-21

I am closing this after > 30 days.

-- Peter Thoeny - 2013-05-01

      Change status to:
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.
SupportForm
Status Answered
Title Enabling mod_perl Causes Working Twiki to Fail
SupportCategory CategoryInstallation
TWiki version 5.1.4
Server OS RHEL 6.1
Web server Apache 2.2.15
Perl version 5.10.1, mod_perl 2.0.4
Browser & version All
Edit | Attach | Watch | Print version | History: r10 < r9 < r8 < r7 < r6 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r10 - 2013-05-01 - PeterThoeny
 
  • 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-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.