I am trying to set up Bugzilla REST api (bzapi) but I've hit a roadblock. I'm setting it up as a FastCGI prosess in a virtualhost in apache. I can execute the script from /var/www/bzapi by executing ./script/bugzilla_api_fastcgi.pl, but not from /var/www/bzapi/script using ./bugzilla_api_fastcgi.pl as a I get the same error as in apache.
The apache error:
[Tue Mar 06 15:04:49 2012] [warn] FastCGI: server "/var/www/bzapi/script/bugzilla_api_fastcgi.pl" started (pid 13329)
Can't locate Bugzilla/API.pm in #INC (#INC contains: /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at /usr/local/share/perl/5.10.1/Module/Runtime.pm line 317.
at /usr/local/share/perl/5.10.1/Catalyst/ScriptRunner.pm line 50
[Tue Mar 06 15:04:50 2012] [warn] FastCGI: server "/var/www/bzapi/script/bugzilla_api_fastcgi.pl" (pid 13329) terminated by calling exit with status '2'
The apache config:
FastCgiServer /var/www/bzapi/script/bugzilla_api_fastcgi.pl -processes 10 -idle-timeout 180
Alias /bzapi /var/www/bzapi/script/bugzilla_api_fastcgi.pl/
The script:
#!/usr/bin/env perl
use Catalyst::ScriptRunner;
Catalyst::ScriptRunner->run('Bugzilla::API', 'FastCGI');
1;
What's a clean way of solving this issue?
Add use lib lines to your script. Locate Api.pm file and add that line to your script. Maybe this works.
#!/usr/bin/env perl
use lib '/var/www/bzapi';
use Catalyst::ScriptRunner;
Catalyst::ScriptRunner->run('Bugzilla::API', 'FastCGI');
1;
Related
I want to deploy a PSGI based web application by using an uWSGI gateway interface.
To accomplish this I installed Perlbrew locally on my Debian server where no root access is available.
perlbrew init
# close shell and reopen new shell
perlbrew self-install
# close shell and reopen new shell
perlbrew self-upgrade
# close shell and reopen new shell
perlbrew install-patchperl
perlbrew install-cpanm
# close shell and reopen new shell
perlbrew install -j 10 perl-5.26.1
perlbrew lib create perl-5.26.1#main
perlbrew switch perl-5.26.1#main
# close shell and reopen new shell
Then I checked using cpanm -V the Perl environment:
cpanm (App::cpanminus) version 1.7043 (/home/soeren/perl5/perlbrew/bin/cpanm)
perl version 5.026001 (/home/soeren/perl5/perlbrew/perls/perl-5.26.1/bin/perl)
%Config:
archname=x86_64-linux
installsitelib=/home/soeren/perl5/perlbrew/perls/perl-5.26.1/lib/site_perl/5.26.1
installsitebin=/home/soeren/perl5/perlbrew/perls/perl-5.26.1/bin
installman1dir=/home/soeren/perl5/perlbrew/perls/perl-5.26.1/man/man1
installman3dir=/home/soeren/perl5/perlbrew/perls/perl-5.26.1/man/man3
sitearchexp=/home/soeren/perl5/perlbrew/perls/perl-5.26.1/lib/site_perl/5.26.1/x86_64-linux
sitelibexp=/home/soeren/perl5/perlbrew/perls/perl-5.26.1/lib/site_perl/5.26.1
archlibexp=/home/soeren/perl5/perlbrew/perls/perl-5.26.1/lib/5.26.1/x86_64-linux
privlibexp=/home/soeren/perl5/perlbrew/perls/perl-5.26.1/lib/5.26.1
%ENV:
PERL5LIB=/home/soeren/.perlbrew/libs/perl-5.26.1#main/lib/perl5
PERLBREW_HOME=/home/soeren/.perlbrew
PERLBREW_LIB=main
PERLBREW_MANPATH=/home/soeren/.perlbrew/libs/perl-5.26.1#main/man:/home/soeren/perl5/perlbrew/perls/perl-5.26.1/man
PERLBREW_PATH=/home/soeren/.perlbrew/libs/perl-5.26.1#main/bin:/home/soeren/perl5/perlbrew/bin:/home/soeren/perl5/perlbrew/perls/perl-5.26.1/bin
PERLBREW_PERL=perl-5.26.1
PERLBREW_ROOT=/home/soeren/perl5/perlbrew
PERLBREW_SHELLRC_VERSION=0.82
PERLBREW_VERSION=0.82
PERL_LOCAL_LIB_ROOT=/home/soeren/.perlbrew/libs/perl-5.26.1#main
PERL_MB_OPT=--install_base /home/soeren/.perlbrew/libs/perl-5.26.1#main
PERL_MM_OPT=INSTALL_BASE=/home/soeren/.perlbrew/libs/perl-5.26.1#main
#INC:
FatPacked::93953009226544=HASH(0x557323bd9330)
/home/soeren/.perlbrew/libs/perl-5.26.1#main/lib/perl5/x86_64-linux
/home/soeren/.perlbrew/libs/perl-5.26.1#main/lib/perl5
/home/soeren/perl5/perlbrew/perls/perl-5.26.1/lib/site_perl/5.26.1/x86_64-linux
/home/soeren/perl5/perlbrew/perls/perl-5.26.1/lib/site_perl/5.26.1
/home/soeren/perl5/perlbrew/perls/perl-5.26.1/lib/5.26.1/x86_64-linux
/home/soeren/perl5/perlbrew/perls/perl-5.26.1/lib/5.26.1
Everything looks good so I installed Dancer2 as the web framework of choice and successfully launched a skeleton test application:
dancer2 gen --application DemoApp
cd ./DemoApp
plackup ./bin/app.psgi
The Plack-internal HTTP web server has started and was ready to serve the application.
Again, so far so good. But I wanted to go with uWSGI instead of having yet another fully fledged web server in the service chain.
So I installed uwsgi-plugin-psgi which automatically comes with uwsgi-core:
apt install uwsgi-plugin-psgi
Now I wanted to start the uWSGI gateway interface...:
uwsgi_psgi --uwsgi-socket 127.0.0.1:5999 --psgi /home/soeren/DemoApp/bin/app.psgi
...and the application has crashed:
[uwsgi] implicit plugin requested psgi
*** Starting uWSGI 2.0.14-debian (64bit) on [Fri Feb 9 10:41:20 2018] ***
compiled with version: 6.2.1 20161124 on 07 December 2016 16:14:59
os: Linux-4.9.0-5-amd64 #1 SMP Debian 4.9.65-3+deb9u2 (2018-01-04)
nodename: skde-deu-02.sklink.de
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 8
current working directory: /home/soeren/DemoApp
detected binary path: /usr/bin/uwsgi-core
*** WARNING: you are running uWSGI without its master process manager ***
your processes number limit is 256817
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to TCP address 127.0.0.1:5999 fd 3
initialized Perl 5.24.1 main interpreter at 0x557337c6fd40
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 72768 bytes (71 KB) for 1 cores
*** Operational MODE: single process ***
Error while loading /home/soeren/DemoApp/bin/app.psgi: Can't locate WWW/Form/UrlEncoded.pm in #INC (you may need to install the WWW::Form::UrlEncoded module) (#INC contains: /home/soeren/DemoApp/bin/../lib /home/soeren/.perlbrew/libs/perl-5.26.1#main/lib/perl5/5.24.1/x86_64-linux-gnu-thread-multi /home/soeren/.perlbrew/libs/perl-5.26.1#main/lib/perl5/5.24.1 /home/soeren/.perlbrew/libs/perl-5.26.1#main/lib/perl5/x86_64-linux-gnu-thread-multi /home/soeren/.perlbrew/libs/perl-5.26.1#main/lib/perl5 /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.24.1 /usr/local/share/perl/5.24.1 /usr/lib/x86_64-linux-gnu/perl5/5.24 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.24 /usr/share/perl/5.24 /usr/local/lib/site_perl) at /home/soeren/.perlbrew/libs/perl-5.26.1#main/lib/perl5/HTTP/Entity/Parser/UrlEncoded.pm line 5.
BEGIN failed--compilation aborted at /home/soeren/.perlbrew/libs/perl-5.26.1#main/lib/perl5/HTTP/Entity/Parser/UrlEncoded.pm line 5.
Compilation failed in require at /usr/share/perl/5.24/Module/Load.pm line 77.
Can't locate HTTP/Entity/Parser/UrlEncoded in #INC (#INC contains: /home/soeren/DemoApp/bin/../lib /home/soeren/.perlbrew/libs/perl-5.26.1#main/lib/perl5/5.24.1/x86_64-linux-gnu-thread-multi /home/soeren/.perlbrew/libs/perl-5.26.1#main/lib/perl5/5.24.1 /home/soeren/.perlbrew/libs/perl-5.26.1#main/lib/perl5/x86_64-linux-gnu-thread-multi /home/soeren/.perlbrew/libs/perl-5.26.1#main/lib/perl5 /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.24.1 /usr/local/share/perl/5.24.1 /usr/lib/x86_64-linux-gnu/perl5/5.24 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.24 /usr/share/perl/5.24 /usr/local/lib/site_perl) at /usr/share/perl/5.24/Module/Load.pm line 77.
Compilation failed in require at /home/soeren/.perlbrew/libs/perl-5.26.1#main/lib/perl5/Plack/Request.pm line 17.
BEGIN failed--compilation aborted at /home/soeren/.perlbrew/libs/perl-5.26.1#main/lib/perl5/Plack/Request.pm line 17.
Compilation failed in require at /usr/share/perl/5.24/parent.pm line 16.
BEGIN failed--compilation aborted at /home/soeren/.perlbrew/libs/perl-5.26.1#main/lib/perl5/Dancer2/Core/Request.pm line 6.
Compilation failed in require at /home/soeren/.perlbrew/libs/perl-5.26.1#main/lib/perl5/Dancer2/Core/App.pm line 29.
BEGIN failed--compilation aborted at /home/soeren/.perlbrew/libs/perl-5.26.1#main/lib/perl5/Dancer2/Core/App.pm line 29.
Compilation failed in require at /home/soeren/.perlbrew/libs/perl-5.26.1#main/lib/perl5/Dancer2.pm line 11.
BEGIN failed--compilation aborted at /home/soeren/.perlbrew/libs/perl-5.26.1#main/lib/perl5/Dancer2.pm line 11.
Compilation failed in require at /home/soeren/DemoApp/bin/../lib/DemoApp.pm line 2.
BEGIN failed--compilation aborted at /home/soeren/DemoApp/bin/../lib/DemoApp.pm line 2.
Compilation failed in require at /home/soeren/DemoApp/bin/app.psgi line 10.
BEGIN failed--compilation aborted at /home/soeren/DemoApp/bin/app.psgi line 10.
unable to find PSGI function entry point.
*** no app loaded. going in full dynamic mode ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI worker 1 (and the only) (pid: 9769, cores: 1)
The fist thing that I see was the architecture. While the other (cpnam and plackup) programs using "x86_64-linux" architecture, only uWSGI is using "x86_64-linux-gnu-thread-multi" instead.
Well Perl's architecture folder for "x86_64-linux-gnu-thread-multi" is available but does not contain any modules. Most modules are installed in the "root library path" and "x86_64-linux" architecture folder.
/home/soeren/.perlbrew/libs/perl-5.26.1#main/lib/perl5
/home/soeren/.perlbrew/libs/perl-5.26.1#main/lib/perl5/x86_64-linux
I tried to work around this by using the uwsgi_psgi command line switch --perl-local-lib but had no luck:
uwsgi_psgi --uwsgi-socket 127.0.0.1:5999 --psgi /home/soeren/DemoApp/bin/app.psgi --perl-local-lib /home/soeren/.perlbrew/libs/perl-5.26.1#main/lib/perl5
uwsgi_psgi --uwsgi-socket 127.0.0.1:5999 --psgi /home/soeren/DemoApp/bin/app.psgi --perl-local-lib /home/soeren/.perlbrew/libs/perl-5.26.1#main/lib/perl5/x86_64-linux
I also have messed around with different uWSGI operation modes (single process, prefork, threaded), but also no luck.
Why is uWSGI modifying the include path and how do I either start uWSGI so it works like with the other programs or install the modules for that architecture in addition?
I found a solution, thanks to #simbabque.
My issue was that I was using the system native uwsgi_psgi, which was compiled with the system Perl installation and was not compatible with my local Perlbrew installation.
This mailing list thread suggest to recompile uwsgi within the Perlbrew scope to be able to work (only) with the local Perlbrew installation.
So by doing the following compile I get managed to start the Perl application:
curl http://uwsgi.it/install | bash -s psgi /home/soeren/perl5/perlbrew/bin/uwsgi
However the above shown command is not the best way since it lacks all further important compile switches (e.g. pcre, jit).
I will improve this answer over time with the further compile switches.
Could anyone point me to possible causes of Perl not finding an installed module?
$ ll /usr/share/perl5/Unix/Processors.pm
-rw-r--r-- 1 root root 3.2K Sep 11 12:39 /usr/share/perl5/Unix/Processors.pm
Ok,
$ perldoc -l Unix::Processors
/usr/share/perl5/Unix/Processors.pm
Ok, but
$ perl -MUnix::Processors -e1
Can't locate loadable object for module Unix::Processors in #INC (#INC contains: /usr/lib/cegma /usr/share/mocat/src /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at -e line 0
Compilation failed in require.
BEGIN failed--compilation aborted.
FIXED: I had put the compiled Processors.so next to the .pm when it should be in the auto directory.
The Unix::Processors module has an XS (C) component that has to be compiled and linked as part of the installation process. The error message Can't locate loadable object is referring to this component (a shared library) rather than the .pm module file itself
This is a symptom of a wrongly-installed module, and most often happens when the .pm file has been simply copied into place instead of being installed properly as described in perldoc perlmodinstall. It can also happen if the installation has been forced, regardless of any errors in the build and test phases.
I have installed the Apache::PageKit module and while testing this module it shows below error.
But the availability of module, using below it is there
bash-3.2$
bash-3.2$ perl -MApache::PageKit -e1
bash-3.2$
bash-3.2$ ./t/TEST -start-httpd
[warning] setting ulimit to allow core files
ulimit -c unlimited; /usr/bin/perl /install/others/Apache-PageKit-1.14/t/TEST -start-httpd --documentroot '/install/others/Apache-PageKit-1.14/eg'
/install/others/apache2/bin/httpd -d /install/others/Apache-PageKit-1.14/t -f /install/others/Apache-PageKit-1.14/t/conf/httpd.conf -D APACHE2 -D PERL_USEITHREADS
using Apache/2.2.25 (prefork MPM)
waiting 60 seconds for server to start: .Syntax error on line 24 of /install/others/Apache-PageKit-1.14/t/conf/extra.last.conf:
Can't locate loadable object for module Apache::URI in #INC (#INC contains: /tmp/apache_test /install/others/Apache-PageKit-1.14/blib/lib /install/others/Apache-PageKit-1.14/blib/arch /install/others/lib/perl5/site_perl/5.8.8 /install/others/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/ /install/others/lib64/perl5/5.8.8/x86_64-linux-thread-multi /install/others/lib/perl5/site_perl /install/others/lib/CPAN/lib /install/others/Apache-PageKit-1.14/t /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at /install/others/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi//mod_perl.pm line 14\nCompilation failed in require at /install/others/Apache-PageKit-1.14/t/conf/extra.last.conf line 28.\nBEGIN failed--compilation aborted\t(in cleanup) Can't locate loadable object for module Apache::URI in #INC (#INC contains: /tmp/apache_test /install/others/Apache-PageKit-1.14/blib/lib /install/others/Apache-PageKit-1.14/blib/arch /install/others/lib/perl5/site_perl/5.8.8 /install/others/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/ /install/others/lib64/perl5/5.8.8/x86_64-linux-thread-multi /install/others/lib/perl5/site_perl /install/others/lib/CPAN/lib /install/others/Apache-PageKit-1.14/t /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at /install/others/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi//mod_perl.pm line 14\nCompilation failed in require at /install/others/Apache-PageKit-1.14/t/conf/extra.last.conf line 28.\nBEGIN failed--compilation aborted at /install/others/Apache-PageKit-1.14/t/conf/extra.last.conf line 28.\n
[ error]
server has died with status 255 (t/logs/error_log wasn't created, start the server in the debug mode)
sh: line 1: 25604 Terminated /usr/bin/perl /install/others/Apache-PageKit-1.14/t/TEST -start-httpd --documentroot '/install/others/Apache-PageKit-1.14/eg'
bash-3.2$
bash-3.2$
bash-3.2$
bash-3.2$ perl -MApache::URI -e1
bash-3.2$
Here line 24 is <Perl>. so pagekit could not able to parse this line.
bash-3.2$ vi /install/others/Apache-PageKit-1.14/t/conf/extra.last.conf
# WARNING: this file is generated (from /install/others/Apache-PageKit-1.14/t/conf/extra.last.conf.in), do not edit
# generated on Thu Jul 11 08:09:38 2013
# 01: /install/others/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi//Apache/TestConfig.pm:961
# 02: /install/others/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi//Apache/TestConfig.pm:979
# 03: /install/others/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi//Apache/TestConfig.pm:1452
# 04: /install/others/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi//Apache/TestConfig.pm:1564
# 05: /install/others/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi//Apache/TestRun.pm:502
# 06: /install/others/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi//Apache/TestRunPerl.pm:107
# 07: /install/others/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi//Apache/TestRun.pm:713
# 08: /install/others/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi//Apache/TestRun.pm:713
# 09: /install/others/Apache-PageKit-1.14/t/TEST:72
# Apache::Reload is very very helpfull during development,
# but it is not required. So install it and uncomment
# the following lines
#
# PerlModule Apache::Reload
# PerlInitHandler Apache::Reload
# PerlSetVar ReloadAll On
# <Perl >
<Perl>
# It is not necasary to preload this modules, but it helps
How can i resolve this.
Thanks
Shanmugam A.
Hi,
Thanks for your reply, now i have installed Perl 5.8.8, Apache 2.2.25, Modperl 2.0.8 and Apache2::PageKit for this combination i have below error while starting the apache.
bash-3.2$
bash-3.2$ /install/others/apache2/bin/apachectl start
[Mon Jul 15 11:28:10 2013] [error] Can't locate loadable object for module Apache::Constants in #INC (#INC contains: /install/others/lib/perl5/5.8.8 /install/others/lib/perl5/site_perl/5.8.8 /install/others/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/ /install/others/lib64/perl5/5.8.8/x86_64-linux-thread-multi /install/others/lib/perl5/site_perl/5.8.8 /install/others/lib/perl5/site_perl /install/others/lib/CPAN/lib /dso/dsoapps/iesdev/qtngsas70/DSOMP/lib /dso/dsoapps/iesdev/qtngsas70/DSOMP/bin. /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 . /install/others/apache2) at /install/others/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi//mod_perl.pm line 14.\nCompilation failed in require at /install/others/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi//ModPerl/P2.pm line 2.\nBEGIN failed--compilation aborted at /install/others/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi//ModPerl/P2.pm line 2.\nCompilation failed in require at (eval 2) line 3.\n
[Mon Jul 15 11:28:10 2013] [error] Can't load Perl module ModPerl::P2 for server (null):0, exiting...
Note: Here i am setting up from Unix to Linux server.
In Unix it was the combination of Apache 1.3.27, mod_perl 1.27 Apache::PageKit And in Apache Configuration below is the additional part added with default
#################################################################
<IfModule mod_perl.c>
PerlModule ModPerl::P2
<Location /P2>
SetHandler perl-script
PerlHandler ModPerl::P2
PerlSendHeader On
</Location>
PerlModule ModPerl::P1
<Location /P1>
SetHandler perl-script
PerlHandler ModPerl::P1
PerlSendHeader On
</Location>
PerlModule Apache::DBI
#### Entered by Tom Frizzell April 25 2008
PerlFixupHandler Apache::SIG
</IfModule>
###############################################################
# PageKit setup
PassEnv ORACLE_HOME ORACLE_SID ORACLE_USERID TAPEMON_HOME TAPEMON_LIB
<Perl>
use lib "/chshttp/prod/qtngsas70/DSOMP/lib";
</Perl>
SetHandler perl-script
PerlSetVar PKIT_ROOT /chshttp/prod/qtngsas70/DSOMP/www
PerlSetVar PKIT_SERVER test
PerlHandler +Apache::PageKit
<Perl>
Apache::PageKit->startup('/chshttp/prod/qtngsas70/DSOMP/www', 'test');
</Perl>
PerlInitHandler +Apache::Reload
# Error Handling
PerlModule Apache::ErrorReport
PerlSetVar ErrorReportHandler display
This Configuration i have changed all Apache::PageKit to Apache2::PageKit and respective source code as well. I have just copied the files ModPerl::P1 and ModPerl::P2 from Unix server to Linux. But it shows the error as above.
Shall i know how to resolve this.
Thanks
Hi,
When i access the page is shows 500 internal error. and the apache log says that (Can't locate object method "is_main" in the perl module Apache::SIG). Shall i know how to resolve this.
bash-3.2$ more error_log
[Sun Jul 14 09:38:12 2013] [notice] Apache/2.2.25 (Unix) configured -- resuming normal operations
[Sun Jul 14 09:40:01 2013] [notice] caught SIGTERM, shutting down
[Tue Jul 16 06:39:59 2013] [notice] Apache/2.2.25 (Unix) mod_perl/2.0.8 Perl/v5.8.8 configured -- resuming normal operations
[Tue Jul 16 06:41:01 2013] [error] [client 10.191.51.22] Can't locate object method "is_main" via package "Apache2::RequestRec" at /install/
others/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi//Apache/SIG.pm line 14.\n
my updated apache configuration is
#################################################################
<IfModule mod_perl.c>
PerlModule ModPerl::P2
<Location /P2>
SetHandler perl-script
PerlHandler ModPerl::P2
# PerlSendHeader On
PerlOptions +ParseHeaders
</Location>
PerlModule ModPerl::P1
<Location /P1>
SetHandler perl-script
PerlHandler ModPerl::P1
# PerlSendHeader On
PerlOptions +ParseHeaders
</Location>
PerlModule Apache::DBI
PerlFixupHandler Apache::SIG
LogFormat "%h %l %u %t \"%r\" %s %b %{SIGPIPE}e"
</IfModule>
###############################################################
# PageKit setup TAPEMON_HOME TAPEMON_LIB
PassEnv ORACLE_HOME ORACLE_SID ORACLE_USERID
<Perl>
use mod_perl2;
# It is not necasary to preload this modules, but it helps
# to find errors in your instalation.
use Apache2::URI ();
use Apache2::Cookie ();
use Apache2::Request ();
use Apache::SessionX ();
use Apache2::Util ();
use Compress::Zlib ();
use File::Find ();
use HTML::FillInForm ();
use HTML::Parser ();
use HTML::Template ();
use XML::LibXML ();
use Apache2::PageKit();
use lib "/dso/dsoapps/iesdev/qtngsas70/DSOMP/lib";
</Perl>
SetHandler perl-script
PerlSetVar PKIT_ROOT /dso/dsoapps/iesdev/qtngsas70/DSOMP/www
PerlSetVar PKIT_SERVER test
PerlHandler +Apache2::PageKit
<Perl>
Apache2::PageKit->startup('/dso/dsoapps/iesdev/qtngsas70/DSOMP/www', 'test');
</Perl>
PerlInitHandler +Apache2::Reload
# Error Handling
PerlModule Apache2::ErrorReport
PerlSetVar ErrorReportHandler display
Shall i know how can i resolve this
Thanks
Shanmugam A.
It looks like Apache-PageKit works only with mod_perl1, but not with mod_perl2 (the latter would use Apache2::URI, not Apache::URI). So you should probably look for an alternative, or if you really need this module, then you have to find a way to install Apache1 and mod_perl1 on your system.
I will try to make my problem as clear as possible.
After logging to a server I get this message:
Last login: Sat Apr 13 02:52:11 2013 from this_and_that
Can't locate local/lib.pm in #INC (#INC contains: /.../perl5/lib/perl5/x86_64-linux-thread-multi /.../perl5/lib/perl5 /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .).
BEGIN failed--compilation aborted.
How can I fix this problem?
Check your shell startup files (e.g. ~/.bashrc). It seems that you have a command for bootstrapping local::lib there which throws the error.
I'm trying to set up an apache server to show a map for FlightGear using FGMap. All the web server files for the map page are in /var/www/fgmap. It calls an fg_server_xml.cgi script, that tries to use a library at /var/www/fgmap/sg_perl/blib/lib/sgmath.pm. (Blib, for reference, is a symlink to another folder in the same directory - to /var/www/fgmap/sg_perl/blibx86-64)
fg_server_xml.cgi gives ma a 500 Internal Server Error when I try to access the page, and apache error logs show:
[Sat Jun 30 07:59:48 2012] [warn] -T switch is ignored, enable with 'PerlSwitches -T' in httpd.conf\n
[Sat Jun 30 07:59:48 2012] [error] Can't locate sgmath.pm in #INC (#INC contains: /var/www/sg_perl/blib/arch/auto/sgmath
/var/www/sg_perl/blib/lib /etc/perl /usr/local/lib/perl/5.14.2
/usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14
/usr/local/lib/site_perl . /etc/apache2)
at /var/www/fgmap/fg_server_xml.cgi line 14.\nBEGIN failed--compilation aborted at /var/www/fgmap/fg_server_xml.cgi
line 14.\n
However, I dropped another perl script, sg_test.pl into the same directory, that references the same library and runs one function from it and prints the output. This script works fine, and can find the library.
Why would one script, identical in its library calls to another and in the exact same location, be unable to find a file the other has no trouble accessing?
One of my theories is that Apache is trying to access it as a user that doesn't have permissions or something to access the folder with sgmath.pm in it, so I made every folder/subfolder/file of WWW accessible to all users. Still no luck.
Apache can definitely use the .cgi, it's no trouble with that, I made a test .cgi file that works just fine.
Thanks!
Edit: The library call in question
use lib "/var/www/sg_perl/blib/lib";
use lib "/var/www/sg_perl/blib/arch/auto/sgmath";
use sgmath;
Using use lib, you added
/var/www/sg_perl/blib/lib
but you said the file is in
/var/www/fgmap/sg_perl/blib/lib
This latter path isn't present in #INC (as confirmed by checking the error message).