Tech List

[index] [prev] [next] [options] [help]
See the Mailing Lists Page for how to subscribe and unsubscribe.

eprints_tech messages

Please note: this page shows emails that have been sent to the eprints_tech mailing list. Some of these may be spam emails we have failed to filter.

Re: [EP-tech] mod_perl @INC problems

From: Simon McLeish <s.mcleish AT lse.ac.uk>
Date: Thu, 24 Jul 2008 15:15:46 +0100


Threading: [EP-tech] mod_perl @INC problems from simon.mcleish AT googlemail.com
      • This Message

*** 
http://www.eprints.org/tech.php/id/%3CEMEW-k6NFFnb40e461b7e7880df6f77f41b459ab960-48888E92.2080700%40lse.ac.uk%3E
*** EPrints community wiki - http://wiki.eprints.org/

OK, I've finally solved this issue, which is itself due to not wanting 
to run the webserver as a user with a login account. The following steps 
were required to get the repository to the stage where it displays a 
screen rather than a 500 or 404 HTTP error. I'm not convinced that all 
of the errors I encountered are related to file permission problems, so 
some might be connected to how red hat set up the apache and mod_perl 
configuration for the versions I'm running, or something of that sort.

Software versions were included in the original email, and the setup is 
to have the eprints installed in /var/www/eprints, a directory owned by 
the user/group eprints/eprints.

I won't claim that these are the best possible fixes for anyone in the 
future who ends up in my situation, but these work. The fixes are:

Use suexec to run virtual host serving eprints as the EPrints user (see 
http://httpd.apache.org/docs/2.0/suexec.html and 
http://httpd.apache.org/docs/2.0/mod/mod_suexec.html#suexecusergroup) - 
warning: I found that this was somewhat delicate and hard to get to work

Change permissions of each directory in the EPrints installation to 
disallow group write (this is a requirement of suexec - only the owner 
should able to write to create files) (actually, I just did chmod -R g-w 
which would do the same to group access to all files, but since the only 
user in the eprints group is eprints, this shouldn't matter)

Add "PerlSwitches -I/var/www/eprints/perl_lib" to 
/etc/httpd/conf.d/perl.conf (fixes error " failed to resolve handler 
`EPrints::Apache::Rewrite': Can't locate Apache2/Utils.pm in  AT INC")

Add "use EPrints::Repository;" near start of 
EPrints/Apache/Rewrite.pm 
(fixes error message "Can't locate object method "new" via 
package 
"EPrints::Repository" (perhaps you forgot to load 
"EPrints::Repository"?) at 
/var/www/eprints/perl_lib/EPrints/Apache/Rewrite.pm line 75.\n")

Add "PerlOptions +GlobalRequest" to /etc/httpd/conf.d/perl.conf 
(fixes 
error "Global $r object is not available. Set:\n\tPerlOptions 
+GlobalRequest\nin httpd.conf at (eval 10) line 32")

Cheers,
Simon

Simon McLeish wrote:
> Any other suggestions for this problem?
> 
> The failing test only runs if( defined $av && $av eq "2" 
) so the apache 
> version won't be relevant - it only runs if the apache version is indeed 
> set to 2.
> 
> Simon
> 
> Simon McLeish wrote:
>> It is:
>>
>> %  grep apache perl_lib/EPrints/SystemSettings.pm
>>                                   'apache' => '2',
>>
>> Simon
>>
>> Tim Brody wrote:
>>> *** 
>>> 
http://www.eprints.org/tech.php/id/%3C485F7B61.9070406%40ecs.soton.ac.uk%3E 
>>>
>>> *** EPrints community wiki - http://wiki.eprints.org/
>>>
>>> Hi Simon,
>>>
>>> Looks like your SystemSettings.pm is wrong. Make sure apache is 
set 
>>> to '2' in perl_lib/EPrints/SystemSettings.pm.
>>>
>>> All the best,
>>> Tim.
>>>
>>> Simon McLeish wrote:
>>>> *** 
>>>> 
http://www.eprints.org/tech.php/id/%3CEMEW-k5KGhJ663e7ba1065292a722326ab5fef4a4f8-485D2195.3090604%40googlemail.com%3E 
>>>>
>>>> *** EPrints community wiki - http://wiki.eprints.org/
>>>>
>>>> Hi,
>>>>
>>>> I'm attempting to run EPrints 3.10 rc2 under https, on a RH5 
machine 
>>>> with apache 2.2.3, perl 5.8.8 and mod_perl 2.0.2. I get this 
error 
>>>> in the log when I try to access the server:
>>>>
>>>> [Sat Jun 21 16:20:38 2008] [error] [client 158.143.8.34] 
failed to 
>>>> resolve handler `EPrints::Apache::Rewrite': Can't locate 
>>>> Apache2/Utils.pm in  AT INC ( AT INC contains: 
>>>> /usr/local/eprints/perl_lib/ 
>>>> /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi 
>>>> /usr/lib/perl5/site_perl/5.8.7/i386-linux-thread-multi 
>>>> /usr/lib/perl5/site_perl/5.8.6/i386-linux-thread-multi 
>>>> /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi 
>>>> /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7 
>>>> /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5 
>>>> /usr/lib/perl5/site_perl 
>>>> /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi 
>>>> /usr/lib/perl5/vendor_perl/5.8.7/i386-linux-thread-multi 
>>>> /usr/lib/perl5/vendor_perl/5.8.6/i386-linux-thread-multi 
>>>> /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi 
>>>> /usr/lib/perl5/vendor_perl/5.8.8 
/usr/lib/perl5/vendor_perl/5.8.7 
>>>> /usr/lib/perl5/vendor_perl/5.8.6 
/usr/lib/perl5/vendor_perl/5.8.5 
>>>> /usr/lib/perl5/vendor_perl 
>>>> /usr/lib/perl5/5.8.8/i386-linux-thread-multi 
/usr/lib/perl5/5.8.8 . 
>>>> /etc/httpd) at (eval 5) line 3.\n\t...propagated at 
>>>> /usr/local/eprints/perl_lib//EPrints/Apache/AnApache.pm line 
>>>> 207.\nCompilation failed in require at 
>>>> /usr/local/eprints/perl_lib//EPrints/Apache/Rewrite.pm line 
>>>> 59.\nBEGIN failed--compilation aborted at 
>>>> /usr/local/eprints/perl_lib//EPrints/Apache/Rewrite.pm line 
>>>> 59.\nCompilation failed in require at (eval 2) line 3.\n
>>>>
>>>> According to rpm, mod_perl installed the following:
>>>> % rpm --query --list mod_perl | grep Util
>>>> 
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/APR/Util.pm
>>>> 
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/Apache/TestUtil.pm 
>>>>
>>>> 
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/Apache2/RequestUtil.pm 

>>>>
>>>> 
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/Apache2/ServerUtil.pm 
>>>>
>>>> 
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/Apache2/Util.pm 
>>>>
>>>> 
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/ModPerl/MapUtil.pm 
>>>>
>>>> 
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/ModPerl/Util.pm 
>>>>
>>>> 
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/auto/APR/Util
>>>> 
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/auto/APR/Util/Util.so 
>>>>
>>>> 
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/auto/Apache2/RequestUtil 
>>>>
>>>> 
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/auto/Apache2/RequestUtil/RequestUtil.so 
>>>>
>>>> 
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/auto/Apache2/ServerUtil 
>>>>
>>>> 
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/auto/Apache2/ServerUtil/ServerUtil.so 
>>>>
>>>> 
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/auto/Apache2/Util 
>>>>
>>>> 
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/auto/Apache2/Util/Util.so 
>>>>
>>>> 
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/auto/ModPerl/Util 
>>>>
>>>> 
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/auto/ModPerl/Util/Util.so 
>>>>
>>>> /usr/share/doc/mod_perl-2.0.2/docs/api/APR/Util.pod
>>>> /usr/share/doc/mod_perl-2.0.2/docs/api/Apache2/RequestUtil.pod
>>>> /usr/share/doc/mod_perl-2.0.2/docs/api/Apache2/ServerUtil.pod
>>>> /usr/share/doc/mod_perl-2.0.2/docs/api/Apache2/Util.pod
>>>> /usr/share/doc/mod_perl-2.0.2/docs/api/ModPerl/Util.pod
>>>> /usr/share/man/man3/APR::Util.3pm.gz
>>>> /usr/share/man/man3/Apache2::RequestUtil.3pm.gz
>>>> /usr/share/man/man3/Apache2::ServerUtil.3pm.gz
>>>> /usr/share/man/man3/Apache2::Util.3pm.gz
>>>> /usr/share/man/man3/Apache::TestUtil.3pm.gz
>>>> /usr/share/man/man3/ModPerl::Util.3pm.gz
>>>>
>>>> so the error is reasonable: there is no Apache2/Utils.pm. If I 

>>>> modify EPrints/Apache/AnApache.pm to require Apache2::Util 
instead 
>>>> of Apache2::Utils, I get
>>>>
>>>> [Sat Jun 21 16:34:22 2008] [error] [client 158.143.8.34] 
failed to 
>>>> resolve handler `EPrints::Apache::Rewrite': Died at 
>>>> /usr/local/eprints/perl_lib//EPrints/Apache/AnApache.pm line 
>>>> 207.\nCompilation failed in require at 
>>>> /usr/local/eprints/perl_lib//EPrints/Apache/Rewrite.pm line 
>>>> 59.\nBEGIN failed--compilation aborted at 
>>>> /usr/local/eprints/perl_lib//EPrints/Apache/Rewrite.pm line 
>>>> 59.\nCompilation failed in require at (eval 2) line 3.\n
>>>>
>>>> which suggests that this isn't the solution: any ideas?
>>>>
>>>> Cheers,
>>>> Simon
>>>>
>>>
>>
> 

Please access the attached hyperlink for an important electronic communications 
disclaimer: http://www.lse.ac.uk/collections/secretariat/legal/disclaimer.htm


[index] [prev] [next] [options] [help]