TWiki Dakar 4.0.
mod_perl enabled.
With Template login I quite often get garbage numbers on top of the page - especially when logging out right after having edited a page.
With Apache login the
WebLeftBar top keep on showing "Login Register" even though I have been authenticated. If I edit a page it sometimes finds out I am authenticated and shows my personal web bar and my name.
The minute I turn off mod_perl these errors go away
KJL
Please complete bugreport, stating full
mod_perl
setup.
--
SP
Here is more.
Here is the
LocalSite.cfg
$TWiki::cfg{DataDir} = '/usr/local/apache2/dakar/data';
$TWiki::cfg{Password} = 'noneofyourbusiness';
$TWiki::cfg{Site}{Lang} = 'en';
$TWiki::cfg{LocalesDir} = '/usr/local/apache2/dakar/locale';
$TWiki::cfg{ScriptUrlPath} = '/dakar/bin';
$TWiki::cfg{DefaultUrlHost} = 'http://www.lavrsen.dk';
$TWiki::cfg{Site}{FullLang} = 'en-us';
$TWiki::cfg{PubUrlPath} = '/dakar/pub';
$TWiki::cfg{PubDir} = '/usr/local/apache2/dakar/pub';
$TWiki::cfg{TemplateDir} = '/usr/local/apache2/dakar/templates';
$TWiki::cfg{Site}{CharSet} = 'iso-8859-15';
$TWiki::cfg{AntiSpam}{EmailPadding} = 'PLEASENOSPAM';
$TWiki::cfg{Languages}{fr}{Enabled} = 0;
$TWiki::cfg{Languages}{da}{Enabled} = 0;
$TWiki::cfg{Languages}{nl}{Enabled} = 0;
$TWiki::cfg{Languages}{es}{Enabled} = 0;
$TWiki::cfg{Languages}{'zh-cn'}{Enabled} = 0;
$TWiki::cfg{Languages}{de}{Enabled} = 0;
$TWiki::cfg{Languages}{pt}{Enabled} = 0;
$TWiki::cfg{Languages}{'zh-tw'}{Enabled} = 0;
$TWiki::cfg{NumberOfRevisions} = 5;
$TWiki::cfg{Plugins}{WysiwygPlugin}{Enabled} = 1;
$TWiki::cfg{Plugins}{RenderListPlugin}{Enabled} = 1;
$TWiki::cfg{Plugins}{EmptyPlugin}{Enabled} = 1;
$TWiki::cfg{LoginManager} = 'TWiki::Client::ApacheLogin';
$TWiki::cfg{Plugins}{BlackListPlugin}{Enabled} = 1;
$TWiki::cfg{Plugins}{TWikiDrawPlugin}{Enabled} = 1;
1;
I have attached the dakar.conf which is included from the httpd.conf.
The mod_perl module is loaded in httpd.conf.
Apache is version 2.0.55 and mod_perl is 2.0.2 - both compiled from Sources.
Note that I never see the issue with mod_perl off.
Let me know if there are additional info I can provide.
PS. I know I can try SpeedyCGI - but the purpose of this is to fix the bug.
KJL
/usr/local/apache2/conf/dakar-perl-uses.pl
might have important info as well.
--
SP
I have attached the dakar-perl-uses.pl. I wonder if it needs some updating - I copied it from twiki.org two months ago. And are all these use::libs actually needed?
I have tried something.
I tried to only run
view
with mod_perl and then the login/logout works.
I will attach the modified apache config.
KJL
I currently run with a simpler dakar-perl-uses.pl
use strict;
# make sure we are in a sane environment.
#$ENV{GATEWAY_INTERFACE} =~ /^CGI-Perl/ or die "GATEWAY_INTERFACE not Perl!";
# check $ENV{MOD_PERL}, $ENV{GATEWAY_INTERFACE} is deprecated for mod_perl2
$ENV{MOD_PERL} =~ /mod_perl/ or die "MOD_PERL not used!";
# --
# set twiki lib path!
# --
use lib "/usr/local/apache2/dakar";
use lib "/usr/local/apache2/dakar/bin";
use lib "/usr/local/apache2/dakar/lib";
use lib "/usr/local/apache2/dakar/lib/CPAN/lib";
use CGI (); CGI->compile(':cgi');
use CGI::Carp ();
and with selective mod-perl so only "view" is mod-perl'ed
Here is my current httpd.conf included apache config file
PerlSwitches -T
Perlrequire /usr/local/apache2/conf/dakar-perl-uses.pl
ScriptAlias /dakar/bin "/usr/local/apache2/dakar/bin"
Alias /dakar "/usr/local/apache2/dakar"
<Directory "/usr/local/apache2/dakar/bin">
# Password file for TWiki users
AuthUserFile /usr/local/apache2/dakar/data/.htpasswd
AuthName 'Enter your WikiName: (First name and last name, no space, no dots, capitalized, e.g. JohnSmith). Cancel to register if you do not have one.'
AuthType Basic
# File to return on access control error (e.g. wrong password)
# By convention this is the TWikiRegistration page, that allows users
# to register with the TWiki. Apache requires this to be a *local* path.
ErrorDocument 401 /usr/local/apache2/dakar/bin/view/TWiki/TWikiRegistration
<FilesMatch "^(configure)$">
SetHandler cgi-script
Order deny,allow
Deny from all
Allow from 192.168.1.4 192.168.1.9 127.0.0.1
</FilesMatch>
<FilesMatch "(attach|edit|manage|rename|save|upload|mail|logon|.*auth).*">
require valid-user
</FilesMatch>
<FilesMatch "^(view)$">
Options +ExecCGI +FollowSymLinks
SetHandler perl-script
PerlResponseHandler ModPerl::Registry
PerlSendHeader On
PerlOptions +ParseHeaders
</FilesMatch>
Options +ExecCGI +FollowSymLinks
SetHandler cgi-script
Allow from all
</Directory>
<Directory "/usr/local/apache2/dakar/pub">
Options FollowSymLinks +Includes
AllowOverride None
Allow from all
</Directory>
<Directory "/usr/local/apache2/dakar/data">
deny from all
</Directory>
<Directory "/usr/local/apache2/dakar/templates">
deny from all
</Directory>
<Directory "/usr/local/apache2/dakar/lib">
deny from all
</Directory>
<Directory "/usr/local/apache2/dakar/locale">
deny from all
</Directory>
and I have seen the error mode where the page has strange numbers in it and the fonts gets larger because of this.
It is a rare error. You have to try many times to see it. But somewhere there must be a global or on-initialized variable hiding in the code. I never see the error when mod_perl is disabled.
The problem where the "Login Register" does not change to the personal bar in the left bar does not happen when only "view" is mod-perl'ed.
KJL
You can review the use of globals in the TWiki code by searching for "use vars". I would be surprised if you can find any cases in the core where a global variable is used in a way that could cause the problem yous describe. That doesn't mean there are no globals; TWiki relies on a variety of CPAN modules, any one of which might carry the global virus.
I wonder if CGI has some memory of prior sessions?
CC
4.0.0 After installing a plugin while beeing logged in, no login/logout is possible any more.
sounds similar
FerinandGassauer
Out of scope problem refactored to Item1627
DCK
I just installed the latest copy of dakar on a fairly stock FC4 system. The twiki is sitting in a directory protected with .htaccess. TWiki insists that I am logged in as the user authenticated via .htaccess despite trying to login to the TWiki with a TWiki name. I either end up not being able to logout (click logout and nothing happens) or being unable to login (authenticate via the template, success, but still showing up as the .htaccess user.)
DavidKovar
Out of scope problem refactored to Item1628
I do not think the errors reported by Ferinand and David has anything to do with the original bug report which is related to mod_perl. I have refactored them out in two new bug reports so we can keep the scope on this bug reports which is that login/logout in an environment where it works in non-mod-perl fails when you enable mod-perl (for all scripts and not only view).
KJL
It seems the original scope of this bug has gone lost because of all the noise some guys added to it.
This is the bug in short.
With Apache login the
WebLeftBar top keep on showing "Login Register" even though I have been authenticated by clicking the login link. If I edit a page it normally finds out I am authenticated and shows my personal web bar and my name.
The minute I turn off mod_perl these errors go away
If I only run mod_perl with view this problem also goes away but then
Item1576 kicks in.
KJL
Some good news.
When you run mod_perl the way it is described in
TWiki:ModPerlUnix
after it has been updated this bug does not show itself.
I have now my httpd config so the following scripts:
attach|edit|manage|rename|save|upload|view|.*auth
are running under mod_perl. login/logon are not
There may still be a global variable worth chasing but since there is a good workaround I change the status to LOW.
KJL
I am closing this.
The "there is probably a global variable to chase" is not a bug anyone can act one. New bugs will be raised if the bug somehow is still lurking somewhere.
KJL