Forum archive 2000-2006

Scott McCormack - WeBWorK2 with mod_perl 2.0 support

Scott McCormack - WeBWorK2 with mod_perl 2.0 support

by Arnold Pizer -
Number of replies: 0
inactiveTopicWeBWorK2 with mod_perl 2.0 support topic started 7/1/2003; 1:45:14 PM
last post 4/21/2004; 11:27:46 AM
userScott McCormack - WeBWorK2 with mod_perl 2.0 support  blueArrow
7/1/2003; 1:45:14 PM (reads: 2708, responses: 7)
I've been asked by a professor of mine to head the development of an on-campus WeBWorK server at Mercer University. I'd like to use mod_perl 2.0, since thats what I have installed on my system. So far everything has run perfectly except for a few things, which are as follows:

1) Missing modules:

I was missing a few perl modules, all of which I was able to install except one: Time::HiRes . I tried a CPAN install, but this yielded apparently broken makefiles everytime, which made the install impossible. If you have properly installed Time::HiRes before, please share with us how you succeeded. Or if anyone has ideas on how to edit the WeBWorK::Timing module to use another timing function, please share this also.

2) Changed Module Names for mod_perl 2.0:

As of mod_perl 2.0, the following modules have name changes: Apache::Constants => Apache::Const ; Apache::Request => Apache::RequestRec .

There may be others, but these are the few I found.

3) <Perl> Sections not supported yet in httpd.conf:

For some reason, the <Perl> sections which worked perfectly in mod_perl 1.X don't work at all in 2.0. To work around this, I did a little research in the mod_perl 2.0 documentation and chose to add the proper WeBWorK modules to @INC by adding the following to httpd.conf:

PerlRequire "/usr/local/apache2/lib/startup.pl"

This included a startup script in which I could use the proper "use lib qw(/path/to/new/lib /path/to/other/new/lib);". This let mod_perl properly find all the new WeBWorK modules.

4) Still more errors...

I'm still getting errors in the apache2 error_log about how some argument isn't a blessed object. However, it won't share enough debugging info for me to find the problem. But I will continue to post new discoveries as they come along.

- Scott McCormack

<| Post or View Comments |>


userMichael Gage - Re: WeBWorK2 with mod_perl 2.0 support  blueArrow
7/1/2003; 2:06:41 PM (reads: 3037, responses: 0)
Hi,

I have installed Timing::HiRes module with mod_perl 1x using the CPAN module without any difficulty.

sudo perl -MCPAN -e shell

gets me a cpan> prompt and

make Timing::HiRes test Timing::HiRes install Timing::HiRes allows it to be installed. (Actually I just used install Timing::HiRes because I knew that it had worked before.)

Does mod_perl 1 or mod_perl2 really make a difference here? I would have thought that mod_perl was not involved at all in installing the module.

--Mike

<| Post or View Comments |>


userScott McCormack - Re: WeBWorK2 with mod_perl 2.0 support  blueArrow
7/2/2003; 1:37:45 AM (reads: 3032, responses: 0)
No mod_perl actually has nothing to do with installing Time::HiRes. The module simply will not install on my system. I'm running RedHat 9 with perl 5.8.0, which shouldn't have any problems installing the module. But every time I try it tells me the makefile is missing separators. So I tried editing the makefile by hand and that only led to more errors. Oh well.

But on another note, another difference in mod_perl 2.0 is that the apache config term "PerlHandler" has been changed to "PerlResponseHandler". Not a big deal if mod_perl was configured with MP_COMPAT_1X=1.

--Scott McCormack

<| Post or View Comments |>


userMatt Hyclak - Re: WeBWorK2 with mod_perl 2.0 support  blueArrow
4/20/2004; 4:21:18 PM (reads: 2793, responses: 0)
RedHat provides perl-Time-HiRes-1.38-3 rpms with RH9, I've been using that.

I can't manage to get the PerlRequire method to work correctly. I get

[Tue Apr 20 16:14:00 2004] [error] /opt/webwork2/lib/startup.pl did not return a true value at (eval 1) line 1.!

Scott, could you post your startup.pl and anything else that might be useful to getting me on the right track?

Thanks!

Matt

<| Post or View Comments |>


userMichael Gage - Re: WeBWorK2 with mod_perl 2.0 support  blueArrow
4/21/2004; 8:47:09 AM (reads: 2780, responses: 0)
The startup.pl script should end with

1;

to make the require function happy.

Is that the problem? or is it something else?

--Mike

<| Post or View Comments |>


userMatt Hyclak - Re: WeBWorK2 with mod_perl 2.0 support  blueArrow
4/21/2004; 10:24:27 AM (reads: 2764, responses: 0)
Yes, the 1; fixed that. Next problem is the blessed object errors Scott mentioned, specifically:

[Wed Apr 21 10:22:53 2004] [error] [client 132.235.36.57] argument is not a blessed reference (expecting an APR::Table derived object) at /opt/webwork2/lib/Apache/WeBWorK.pm line 127.!

Ideas?

<| Post or View Comments |>


userMichael Gage - Re: WeBWorK2 with mod_perl 2.0 support  blueArrow
4/21/2004; 11:25:58 AM (reads: 2772, responses: 0)
This probably has to do with using apache2.0 or mod_perl2.0. It's beyond what I know at the moment. Is there a page somewhere on the web of converting mod_perl applications to run with apache2.0 and mod_perl2? Anyone?

(See also http://webhost.math.rochester.edu/webworkdocs/discuss/msgReader$2186) --Mike

<| Post or View Comments |>


userArnold K. Pizer - Re: WeBWorK2 with mod_perl 2.0 support  blueArrow
4/21/2004; 11:27:46 AM (reads: 2788, responses: 0)

Hi Matt,

With regard to installing Time-HiRes, here is the solution.  Quoting from the WW 1.9 documentation "Installing WeBWorK on a Red Hat Linux 9.0 System" http://webhost.math.rochester.edu/webworkdocs/discuss/msgReader$1656

Step 5: Install the required Perl Modules

Before we begin, as root run

# unset LANG

since otherwise the installation of Time::HiRes will fail. We will use CPAN to install the modules. As this is the first time you're run CPAN, you will be asked to configure it (you can say "no" and it will autoconfigure). As root, run the command

# perl -MCPAN -e shell
cpan> install HTML::Parser Net::SMTP MIME::Base64 GD Time::HiRes
cpan>exit

During the installation of GD select JPEG but not FreeType or XPM support. Otherwise accept all defaults.

 

Arnie

<| Post or View Comments |>