SID-02477: Perl issues while starting webserver
| Status: |
Answered |
TWiki version: |
6.1.0 |
Perl version: |
Red Hat Enterprise Linux Server release 7.9 (Maipo) |
| Category: |
CategoryInstallation |
Server OS: |
Red Hat Enterprise Linux Server release 7.9 (Maipo) |
Last update: |
4 years ago |
I am setting up a new twiki environment and keep getting "Invalid command 'PerlRequire', perhaps misspelled or defined by a module not included in the server configuration" when I try to start the webserver. Below information will be helpful.
[root@muvmp065 ~]# whereis perl
perl: /usr/bin/perl /usr/share/man/man1/perl.1.gz
/usr/share/perl5
[root@muvmp065 ~]# yum install perl
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Package 4:perl-5.16.3-299.el7_9.x86_64 already installed and latest version
Nothing to do
[root@muvmp065 ~]#
--
Anwar Ansari - 2021-11-15
Discussion and Answer
The directive
PerlRequire in the server configuration works only if you load
mod_perl into your web server. I'm not familiar with RHEL, but maybe the
Question in the Red Hat Customer Portal
helps. It seems that
mod_perl is at least available via
EPEL
.
--
Harald Jörg - 2021-11-15
Thanks. It helped to fix the problem but now I am getting new issue while starting httpd. Below is the error log. Please let me know if there is any help on this as well-
[Tue Nov 16 12:07:07.403629 2021] [perl:error] [pid 3750] Can't locate CGI.pm in
@INC
(
@INC
contains: /var/www/html/wiki5/lib . /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 /etc/httpd /var/www/html/wiki5/lib/CPAN/lib//arch /var/www/html/wiki5/lib/CPAN/lib//5.16.3/x86_64-linux-thread-multi /var/www/html/wiki5/lib/CPAN/lib//5.16.3 /var/www/html/wiki5/lib/CPAN/lib/) at /var/www/html/wiki5/lib/TWiki.pm line 76.\nBEGIN failed--compilation aborted at /var/www/html/wiki5/lib/TWiki.pm line 76.\nCompilation failed in require at /var/www/html/wiki5/lib/TWiki/UI.pm line 91.\nBEGIN failed--compilation aborted at /var/www/html/wiki5/lib/TWiki/UI.pm line 91.\nCompilation failed in require at /var/www/html/wiki5/bin/addsection line 30.\nBEGIN failed--compilation aborted at /var/www/html/wiki5/bin/addsection line 30.\nCompilation failed in require at (eval 2) line 1.\n
[Tue Nov 16 12:07:07.403648 2021] [perl:error] [pid 3750] Can't load Perl file: /var/www/html/wiki5/tools/mod_perl_startup.pl for server 10.135.40.108:80, exiting...
--
Anwar Ansari - 2021-11-16
If your provider doesn't provide CGI.pm (which is not unheard of in RHEL-world), then you could either install
CgiContrib dig into the CPAN module
CPAN:local::lib
which allows to install CPAN modules in an arbitrary directory. I thought that this plugin ships with recent TWiki versions - so please also check your settings in
bin/LocalLib.
--
Harald Jörg - 2021-11-16
Thanks for your help. After all setup I get below error when I hit
https://hostxyz/bin/configure
Software error:
Failed to load the perl module TWiki::Configure::Load. The module was found at /apps/data/wiki5/lib/TWiki/Configure/Load.pm, but I don't have permission to read it.
Please ensure that:
- TWiki::Configure::Load is installed,
- that the module is available on the @INC
path,
- that the webserver user (apache) has permission to read the TWiki/Configure/Load.pm file.
The detailed error seen was:
Use of qw(...) as parentheses is deprecated at /apps/data/wiki5/lib/TWiki/Configure/Load.pm line 89.
Compilation failed in require at (eval 28) line 2.
BEGIN failed--compilation aborted at (eval 28) line 2.
NOTE that I was unable to load
LocalLib.cfg because of the following error:
defined(
@array
) is deprecated at setlib.cfg line 53.
Compilation failed in require at (eval 9) line 1.
--
Anwar Ansari - 2021-11-26
You seem to run a pretty outdated version of TWiki, definitely not version 6.1.0.
- The "Use of qw() as parentheses" was fixed in 2011 and released with TWiki 5.1.1, see Bugs:Item6800
-
defined(@array
) - this was fixed in 2014 and released with TWiki 6.0.1, see Bugs:Item7487
So what you need to do to run with a "modern" Perl is upgrade to a TWiki version which can cope with the changes that came with Perl.
--
Harald Jörg - 2021-11-26
Thanks a lot for your response. I have installed latest twiki version TWiki-6.1.0 and when I start the webserver, getting below error. Could you please help.
[Sat Nov 27 08:38:27.448034 2021] [perl:error] [pid 25556] Content-type: text/plain\n\nPerl error when reading
LocalSite.cfg: \nPlease inform the site admin.\nBEGIN failed--compilation aborted at /var/www/html/twiki/lib/TWiki.pm line 585.\nCompilation failed in require at /var/www/html/twiki/bin/attach line 45.\nBEGIN failed--compilation aborted at /var/www/html/twiki/bin/attach line 45.\nCompilation failed in require at (eval 2) line 1.\n
[Sat Nov 27 08:38:27.448058 2021] [perl:error] [pid 25556] Can't load Perl file: /var/www/html/twiki/tools/mod_perl_startup.pl for server hostnamexxxx:80, exiting...
--
Anwar Ansari - 2021-11-27
Referring to below error-
[Sat Nov 27 08:38:27.448058 2021] [perl:error] [pid 25556] Can't load Perl file: /var/www/html/twiki/tools/mod_perl_startup.pl for server muvmp066.emea.nsn-net.net:80, exiting...
mod_perl_startup.pl did not come with the twiki "TWiki-6.1.0" and I copied it from older twiki version (5.1)
--
Anwar Ansari - 2021-11-27
Indeed,
mod_perl_startup.pl is not distributed with TWiki. There was some debate in 2008 about such a script in
ModPerlStartupScript, and I guess your installation has a copy of one of the versions mentioned in this topic.
I can't say from a distance, but maybe you need to copy your
lib/LocalSite.cfg from your old installation to your 6.1 installation? TWiki's bootstrapping in
configure usually fixes that for you, but
mod_perl_startup runs during before that, server startup. So if you try to compile TWiki modules in that file, it already needs
lib/LocalSite.cfg in place.
--
Harald Jörg - 2021-11-27
Unless you have many simultaneous users, or want the extra speed you do not really need to run TWiki under mod_perl.
Did you run the
ApacheConfigGenerator for your environment?
--
Peter Thoeny - 2021-11-27
Thanks Peter and Harald, my issue has been fixed.
--
Anwar Ansari - 2021-12-06
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.