Gossamer Forum
Home : General : Perl Programming :

Mod_Perl Set-up Error

Quote Reply
Mod_Perl Set-up Error
Hi,

I'm having a problem getting mod_perl set-up with LinksSQL (I was wanting to use it with community as well but I'm starting with LinksSQL) :

I get this error :

[Fri Sep 17 01:20:52 2004] [error] Can't locate Apache/DBI.pm in @INC
(@INC contains: /usr/local/apache/perl/my_site_name/admin
/www/perl/my_site_name/admin
/usr/local/lib/perl5/5.6.1/i386-freebsd
/usr/local/lib/perl5/5.6.1
/usr/local/lib/perl5/site_perl/5.6.1/i386-freebsd
/usr/local/lib/perl5/site_perl/5.6.1
/usr/local/lib/perl5/site_perl
/usr/local/lib/perl5/5.00503
/usr/local/lib/site_perl .
/usr/local/apache/
/usr/local/apache/lib/perl)
at /www/perl/my_site_name/admin/Links/mod_perl.pm line 24.\
nBEGIN failed--compilation aborted at /www/perl/my_site_name/admin/Links/mod_perl.pm line 26.\
nCompilation failed in require at /usr/local/apache/conf/startup.pl line 10.\
nBEGIN failed--compilation aborted at /usr/local/apache/conf/startup.pl line 10.\
nCompilation failed in require at (eval 2) line 1.\n
Syntax error on line 985 of /usr/local/apache/conf/httpd.conf:

This my httpd.conf file at line 985 (985 is the PerlRequire line):
<IfModule mod_perl.c>
# mod_perl directives

PerlRequire /usr/local/apache/conf/startup.pl

<Location /usr/local/apache/perl/>
SetHandler perl-script
PerlHandler Apache::Registry
PerlSendHeader On
Options +ExecCGI
</Location>

This is my startup.pl file :
#!/usr/bin/perl5

$ENV{GATEWAY_INTERFACE} =~ /^CGI-Perl/ or die "GATEWAY_INTERFACE not Perl!";

use strict;

use lib
'/www/perl/my_site_name/admin';

use Links::mod_perl;

1; # return true


And so I had just installed DBI so I checked and get this :
cpan> install DBI

DBI is up to date.

(location: /usr/local/lib/perl5/site_perl/5.6.1/i386-freebsd/DBI)

cpan> exit


Can anyone figure out what is wrong here !
Significant Media
Quote Reply
Re: [Jag] Mod_Perl Set-up Error In reply to
Quote:
[Fri Sep 17 01:20:52 2004] [error] Can't locate Apache/DBI.pm in @INC

It looks like you also need to install Apache::DBI. Give that a shot.

~Charlie
Quote Reply
Re: [Chaz] Mod_Perl Set-up Error In reply to
Thanks, I'll give that a try.

PS looks as if it's going to take longer than expected :

------------->

Running install for module Apache::DBI
Running make for A/AB/ABH/Apache-DBI-0.94.tar.gz
Is already unwrapped into directory /root/.cpan/build/Apache-DBI-0.94
Has already been processed within this session
Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl -Iblib/arch -Iblib/lib -I/usr/local/lib/perl5/5.6.1/i386-freebsd -I/usr/local/lib/perl5/5.6.1 -e 'use Test::Harness qw(&runtests $verbose); $verbose=0; runtests @ARGV;' t/*.t
t/10mysql....ok 5/10# Failed test (t/10mysql.t at line 39)
t/10mysql....NOK 6# Failed test (t/10mysql.t at line 42)
t/10mysql....ok 8/10# Failed test (t/10mysql.t at line 47)
t/10mysql....NOK 9# Failed test (t/10mysql.t at line 49)
t/10mysql....NOK 10Use of uninitialized value in sprintf at /usr/local/lib/perl5/site_perl/5.6.1/Test/Builder.pm line 618.
# 'ne'
#
# undef
# Looks like you failed 4 tests of 10.
t/10mysql....dubious
Test returned status 4 (wstat 1024, 0x400)
DIED. FAILED tests 6-7, 9-10
Failed 4/10 tests, 60.00% okay
Failed Test Stat Wstat Total Fail Failed List of Failed
-------------------------------------------------------------------------------
t/10mysql.t 4 1024 10 4 40.00% 6-7 9-10
Failed 1/1 test scripts, 0.00% okay. 4/10 subtests failed, 60.00% okay.
*** Error code 2

Stop in /root/.cpan/build/Apache-DBI-0.94.
/usr/bin/make test -- NOT OK
Running make install
make test had returned bad status, won't install without force

<-------------

(As you can see I tried a second time just to make sure)

I'll try and contact the techincal staff at the hosting place !

John
Significant Media

Last edited by:

Jag: Sep 16, 2004, 5:03 PM
Quote Reply
Re: [Jag] Mod_Perl Set-up Error In reply to
Quote:
I'll try and contact the techincal staff at the hosting place !

Good idea. I googled for the errors a bit but nothing really came up for that. Maybe it will be something obvious to one of the mod_perl gurus around here.

~Charlie
Quote Reply
Re: [Chaz] Mod_Perl Set-up Error In reply to
Finally, got it to work !

Installation by forcing it after having tried it manually with make and make install.

However even though I get this :
Preloading Links SQL modules into mod_perl:
. . . . . . . .
All modules loaded ok!
Compiling all functions ... All modules compiled and loaded okay!

Syntax OK
/www/bin/apachectl stop: httpsd stopped

Preloading Links SQL modules into mod_perl:
. . . . . . . .
All modules loaded ok!
Compiling all functions ... All modules compiled and loaded okay!

/www/bin/apachectl start: httpsd started

in the LinksSQL part setup / environment I get :

Perl Version: 5.006001
Links SQL Version: 2.2.0
Running under mod_perl: No
Running under SpeedyCGI: No
@INC =
/usr/local/apache/perl/my_site_name/admin
/usr/local/lib/perl5/5.6.1/i386-freebsd
/usr/local/lib/perl5/5.6.1
/usr/local/lib/perl5/site_perl/5.6.1/i386-freebsd
/usr/local/lib/perl5/site_perl/5.6.1
/usr/local/lib/perl5/site_perl
/usr/local/lib/perl5/5.00503
/usr/local/lib/site_perl
.


Frown

Anybody got any ideas

Edit :
just tried it with Community and LinksSQL and got this :

Preloading Links SQL modules into mod_perl:
. . . . . . . .
All modules loaded ok!
Compiling all functions ... All modules compiled and loaded okay!

Preloading Community scripts into mod_perl:
. . . . . .
All scripts compiled and loaded ok!

Syntax OK
/www/bin/apachectl stop: httpsd stopped

Preloading Links SQL modules into mod_perl:
. . . . . . . .
All modules loaded ok!
Compiling all functions ... All modules compiled and loaded okay!

Preloading Community scripts into mod_perl:
. . . . . .
All scripts compiled and loaded ok!

/www/bin/apachectl start: httpsd started

So that seems to work as well but there is exactly the same message in Community :

Perl Version: 5.006001
Running under mod_perl: No
Running under SpeedyCGI: No
@INC =
/usr/local/apache/private/my_site_name/lib
/usr/local/lib/perl5/5.6.1/i386-freebsd
/usr/local/lib/perl5/5.6.1
/usr/local/lib/perl5/site_perl/5.6.1/i386-freebsd
/usr/local/lib/perl5/site_perl/5.6.1
/usr/local/lib/perl5/site_perl
/usr/local/lib/perl5/5.00503
/usr/local/lib/site_perl

However I was wondering, everything works OK without mod_perl but would I need to add something to my location directives since the community scripts are in a different area. The main CGI script is in /usr/local/apache/perl/ but there seem to be other parts in /usr/local/apache/private/my_site_name/lib not that this changes anything with my mod_perl problem ! Unsure

<Location /usr/local/apache/perl/>
SetHandler perl-script
PerlHandler Apache::Registry
PerlSendHeader On
Options +ExecCGI
</Location>

Thanks, John
Significant Media

Last edited by:

Jag: Sep 17, 2004, 6:36 AM
Quote Reply
Re: [Jag] Mod_Perl Set-up Error In reply to
I have just modified my httpd.conf file to include the location parameters below in the virtual server part rather than in the <IfModule mod_perl.c> directives :

I have changed this :

<IfModule mod_perl.c>
# mod_perl directives

PerlRequire /usr/local/apache/conf/startup.pl

<Location /usr/local/apache/perl/>
SetHandler perl-script
PerlHandler Apache::Registry
PerlSendHeader On
Options +ExecCGI
</Location>

</IfModule>

to this :

<IfModule mod_perl.c>
# mod_perl directives

PerlRequire /usr/local/apache/conf/startup.pl

</IfModule>

in the httpd.conf file and further down for the virtual hosts added the location parameters to the virtual host where both LinkSQL and Community are running

<VirtualHost XXX.XXX.XXX.XXX:80>
SSLDisable
ServerName myserver.net
ServerAlias www.myserver.net
ServerAdmin webmaster@myserver.net
DocumentRoot /usr/local/apache/htdocs/myserver/
ScriptAlias /cgi-bin/ /usr/local/apache/cgi-bin/myserver/
ScriptAlias /perl/ /usr/local/apache/perl/myserver/
User www
Group www
<Location /usr/local/apache/perl/myserver>
SetHandler perl-script
PerlHandler Apache::Registry
PerlSendHeader On
Options +ExecCGI
</Location>
</VirtualHost>

I was thinking this may have been the issue that is stopping me from getting mod_perl to work within LinksSQL or Community.

Does anybody have any ideas ?

Thanks, John
Significant Media
Quote Reply
Re: [Jag] Mod_Perl Set-up Error In reply to
<Location> should be a web path, not a system path; try changing your Location to:

<Location /perl/>
....
</Location>

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [Jagerman] Mod_Perl Set-up Error In reply to
Oh my Jagerman, you're the KING and make sure you have a wonderful week-end ! Angelic

Perl Version: 5.006001
Links SQL Version: 2.2.0
DBI.pm Version: 1.42
Running under mod_perl: Yes (version 1.27)
Running under SpeedyCGI: No

Thanks ever so much...

Sweet Dreams ! Smile
Significant Media