## Features & Development

### Installation of Moodle assignment

by Samuel Lundqvist -
Number of replies: 10
Hi,

I have some a problem with the Webwork-part of the installation of Moodle assignment.
According to http://webwork.maa.org/wiki/Moodle_Assignment, the file
webwork2/conf/webwork.apache-config should be modified by uncommenting three stanzas. Since we run apache2, the file of interest should be webwork.apache2-config. It does not contain any of the three stanzas mentioned in the installation part (2a). Thus, I add the lines

$ENV{WEBWORK_ROOT} =$webwork_dir;

$PerlConfig .= <<EOF; PerlModule WebworkSOAP <Location /webwork2_rpc> PerlHandler Apache::SOAP SetHandler perl-script PerlSetVar dispatch_to "WebworkSOAP" PerlSetVar options "compress_threshold => 10000" Order Allow,Deny Allow from All </Location> <Location /webwork2_wsdl> PerlSetVar dispatch_to "WebworkSOAP::WSDL" PerlSetVar options "compress_threshold => 10000" PerlHandler WebworkSOAP::WSDL SetHandler perl-script Order Allow,Deny Allow from All </Location> EOF However, when I restart the Apache-server, it fails. Without the extra lines, everything works just fine. Any idea? In reply to Samuel Lundqvist ### Re: Installation of Moodle assignment by Xiong Chiamiov - What message do you get when it fails? Take a look especially at Apache's error log - it should be at either /var/log/apache2/error_log or /var/log/httpd/error_log, or something similar. Of particular usefulness is the tail command; if you tail -f the file, then you'll see the new errors as they come in. In reply to Samuel Lundqvist ### Re: Installation of Moodle assignment by Michael Gage - Here are excerpts from my webwork.apache2-config file (used on my MacBook installation) ... # Customize the variable$webwork_dir below to match the location of your
# WeBWorK installation.
#
# ATTENTION APACHE 2.2 USERS: There is a bug in mod_perl 2.0.2 that prevents the
# FollowSymlinksOption from working when specified
# in a <Perl> section. See below for workaround.

# This allows the "show source" button to work for demonstration "courses"
# See for example Davide Cervone's Knoxville lectures on math objects

ScriptAliasMatch /webwork2_course_files/([^/]*)/show-source.cgi/(.*) /opt/webwork/courses/$1/html/show-source.cgi/$2

PerlModule mod_perl2

<Perl>

# Set this variable to the path to your WeBWorK installation.

....
....
....

</Perl>

# APACHE 2.2 USERS: uncomment the following lines and customize the paths.
# The path for this block should be $webwork_htdocs_dir. <Directory /opt/webwork/webwork2/htdocs> Options FollowSymLinks </Directory> # The path for this block should be$webwork_courses_dir, followed by "/*/html".
<Directory /opt/webwork/courses/*/html>
</Directory>
<Directory /Users/gage/webwork/courses/*/html>
</Directory>
PerlModule WebworkSOAP

#WEBWORK SOAP CONFIGURATION
<Location /webwork2_rpc>
PerlHandler Apache2::SOAP
SetHandler perl-script
PerlSetVar dispatch_to "WebworkSOAP"
PerlSetVar options "compress_threshold => 10000"
Order Allow,Deny
Allow from All
</Location>

#WEBWORK SOAP WSDL HANDLER :: TO BE REPLACED WITH A FILE FOR PRODUCTION SERVERS
<Location /webwork2_wsdl>
PerlSetVar dispatch_to "WebworkSOAP::WSDL"
PerlSetVar options "compress_threshold => 10000"
PerlHandler WebworkSOAP::WSDL
SetHandler perl-script
Order Allow,Deny
Allow from All
</Location>

####################################################
notice that because of the bug that existed (exists?) in
mod_perl we are specifying the stanzas directly rather than
using the Perl evaluation. Since there are few variables
that need customizing in this section this is much of
an imposition.

Hope this helps.

-- Mike


### Re: Installation of Moodle assignment

by Samuel Lundqvist -
Thanks. I still have problems though. We are running Ubuntu 6.06.2, Webwork 2.4.5, Apache 2.0.55 and Modperl 1.29. Not being an expert on Perl, it is hard for me to know which parts of the config file that are specific to Apache 2.2 and Modperl 2?
Perhaps I should add that this server is just a test-server. Our production server runs Apache 2.2.8, Modperl 2.000003 and Ubuntu 8.04.3. We will first try to get the installation working on the test-server, and if we are happy with it, we will use in production mode. We are currently using a Shibboleth authorisation mechanism in Moodle. This way, we do not need to deal with local Moodle-accounts for our students. The idea of using your nice bridge is that we wish to avoid local Webwork-accounts as well.

Best,
Samuel

### Re: Installation of Moodle assignment

by Xiong Chiamiov -
Not that this is of any immediate help (and I realize that some things you cannot change), but you should really strive to have your test server be as exact a clone of the production one as possible. Otherwise, it's not really testing for problems on the production server ahead of time, is it? You may spend a significant amount of time fixing a problem that only occurs in Modperl <2, or, conversely, not catch an error that results from newer versions of Modperl.

### Re: Installation of Moodle assignment

by Samuel Lundqvist -
Yes, that is a good point. However, I got the fealing that installation of the Moodle Assignement module was pretty easy, and there was no information on the installation page that modperl 2 was actually needed, so I decided to try an installation just to see if the bridge would fit our needs. Maybe one should update the documentation a bit?

### Re: Installation of Moodle assignment

by Xiong Chiamiov -
Since the documentation is all on a wiki, if you sign up for an account (they might be tied to this site - I don't remember), you can edit the documentation yourself to match your experiences.

Apologies if this sounds unfriendly; I'm in no way associated with the development of WebWork, so please don't associate my curtness with the devs - they're much nicer and more helpful than I. :)

### Re: Installation of Moodle assignment

by Michael Gage -
Samuel,

Do the stanzas that I sent you (see parent messages above) enable the webservice on your Apache2 installation? The main difference from Apache1
is that the stanzas aren't processed through Perl so any URLs have to be
entered by hand rather than by referencing the information in global.conf.

If the webservice is not enabled what are the error messages in wwlog? Can you access the WSDL directly? e.g. using http://hosted2.webwork.rochester.edu/webwork2_wsdl (but with your server's url)

-- Mike

### Re: Installation of Moodle assignment

by Samuel Lundqvist -
Thanks for your answer and sorry for the delay due to my vacation.

I succeded to restart apache2 and reboot the server after using your stanzas. However, I can't access the webwork2_wsdl-file. It gives me an "Internal Server Error" page. The error log says the following:
...
failed to resolve handler `WebworkSOAP::WSDL': Can't locate Pod/WSDL.pm in @INC (@INC contains: /opt/webwork/webwork2/lib /opt/webwork/pg/lib /etc/perl /usr/local/lib/perl/5.8.7 /usr/local/share/perl/5.8.7 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl . /etc/apache2) at /opt/webwork/webwork2/lib/WebworkSOAP/WSDL.pm line 4.\nBEGIN failed--compilation aborted at /opt/webwork/webwork2/lib/WebworkSOAP/WSDL.pm line 4.\nCompilation failed in require at (eval 108) line 3.\n

All the best,
Samuel

### Re: Installation of Moodle assignment

by Samuel Lundqvist -
I found out that I missed the Pod/WSDL.pm-module and after I installed it, I got xml-stanzas by accessing localhost/webwork2_wsdl. But I won't get a blank page when I access localhost/webwork2_rpc. The error log says
...
Can't locate auto/Apache2/Const/HTTP_BAD_RE.al in @INC (@INC contains: /opt/webwork/pg/lib /opt/webwork/webwork2/lib /etc/perl /usr/local/lib/perl/5.8.7 /usr/local/share/perl/5.8.7 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl . /etc/apache2) at /usr/local/share/perl/5.8.7/SOAP/Transport/HTTP.pm line 707\n

Samuel