WeBWorK Main Forum

Adding Moodle to Webwork Live Install

Adding Moodle to Webwork Live Install

by Dusan Vuckovic -
Number of replies: 11
Hi.
I've installed WebWork to Virtual Machine from Live DVD. I would like to add moodle to same VM. Where should I put it ? You have lighthttp and Apache started. One default web directory is /var/www, another is /opt/webwork/webwork2/htdocs.

Would You please be so kind to give me some more info where should I put moodle and which URL to call so I could run index.php from moodle dir. Also , whish GRP/OWN/MOD should Moodle dir have ?

Thx.
In reply to Dusan Vuckovic

Re: Adding Moodle to Webwork Live Install

by Arnold Pizer -
Hi Dusan,

I haven't tried installing Moodle myself so I can not directly answer your questions. I assume the Moodle installation chooses a default directory and I would opt for that (but maybe not). The /opt/webwork/webwork2/htdocs directory is a "special" webwork2 directory so that wouldn't be the best choice.

I would be interested if there is enough interest in Moodle so that I should add it to the next version of the WeBWorK Live DVD. If readers using the Live DVD install would comment on this (positively or negatively) it would be useful. Also people may be interested in what virtual machine software you are using and how well it is working (I know I am).

Arnie
In reply to Arnold Pizer

Re: Adding Moodle to Webwork Live Install

by Dusan Vuckovic -
Hi Arnie,

well, I've managed to install Moodle onto same Virtual Machine. I'll give You a brief description of it.
Concept of Virtual Machines is a rather new one,. It's around for some 3-5 years. The Idea is that in regular deployment conditions You would buy one server for Database , one server for WEB and one server for user authentication. All of them would utilize some 20-30% of resources. And what about other 70% ? That's where Virtual Machines kick in . You can get program like Microsoft's Hyper V or, even better VM Ware (www.vmware.com) ECS server. That would allow You to , after you install that program on naked hardware, create several virtual machines (think of them like mini computers inside one big computer) which would activly share Memory, processor time and HDD. The concept is so improved during the years that now VIrtual servers are very much common. The benefit is, less money for hardware, better utilization and better data protection (if one of machines goes down, others keep on working). That's all on a server level for large systems. Regular people like us, may use several free solutions like Microsofts Virtual PC 2007 , or VMWare Player.
You install the program , run it and all the sudden You have a comuter starting inside the window. That virtual machine addresses the real CD ROM like it's own, so You can put Ubuntu , or windows , or any disk in it and the installation will start.
The best thing of all is that one Virtual machine corresponds to one file on Your physical disk. So You can copy it on a USB, find another machine, like the one on Your working place. Install Virtual PC, load the machine and You can continue working. Like carring the complete computer in Your pocket.
All of this allowed me to install WebWork from Your Live DVD, add Moodle, so I could now put my virtual machine for everyone to download it (In VMWare terminology, they are called "Virtual appliencies" ).
In my next post, I'll put some screen shots and some links for You.

I hope I was clear enough. Sorry for my English. I tend to misspell words, even with spell checker on smile

-----
Virtual Machines cont.

In the attachment You can find screen shot from Dual Core machine with Vista on which I run Your Live DVD install inside the VM Ware Virtual Machine. The best thing of all is that VIrtual Machines (the appropriate term is "Guest machine" are sharing network resources with Physical machine (the term is "Host machine"), so You can access it from anywhere. If You like You can access my virtual machine on http://logic.e-learn.me . It will be one for few days, until I move it to a really big server smile.

Relevant links are:
Microsoft Virtual PC 2007 download
VMWare Player download page
VMWare Server download page (also free, and available for Linux too)

p.s. I work for Microsoft , so I have to put them first, but If I was You I would look the other two. big grin.

Wish You all a good time, and If any question arises, I'm here to help.

Bye
Attachment fullscreen.png
In reply to Dusan Vuckovic

Re: Adding Moodle to Webwork Live Install

by Arnold Pizer -
Hi Dusan,

Thanks very much for the information. I was thinking of setting up Xen and trying that but haven't done so yet. One of the reasons I built the WeBWorK Live DVD was so people could install WeBWorK on virtual machines but you are the first person I know of who has done so.

I have a tiny bit of experience with the free version of VMWare (when I set up Sage on my XP machine) but I'm not sure people can use the WeBWorK LiveDVD directly with VMWare --- you seem to indicate that they can.

I didn't know about MS Virtual PC 2007. That (or VMWare) seems like it would be an ideal solution for MS shops that want to run WeBWorK.

Arnie
In reply to Arnold Pizer

Re: Adding Moodle to Webwork Live Install

by Raghu Gompa -
Dear Arnie and Dusan,

Thank you very much for your posts. I just want to inform you that I have used WeBWorK Live DVD to install WeBWorK. There may have been many others like me who did not get chance to thank Arnie for his helpful work. Thanks, Arnie. smile I, now, have to learn about MS Virtual PC 2007. I may have questions later. .. Raghu
In reply to Raghu Gompa

Re: Adding Moodle to Webwork Live Install

by Dusan Vuckovic -
No problem. Any Time.

I have another question considering moodle/webwork integration. I've followed these instructions :

2)In the WeBWorK installation (with url: http://host.name.edu/webwork2 ) you must make these modifications.

(2a) In the file webwork2/conf/webwork.apache-config uncomment the lines for the SOAP installation in the final stanzas (or add them if they are missing all together).


(2b) Finally you must modify one line at the top of the file:

webwork2/lib/WebworkSOAP/WSDL.pm

to include the full domain name of the host of the WeBWorK installation.

use constant RPC_URL => 'http://host.name.edu/webwork2_rpc';

(note the agreement with the stanzas in the webwork.apache-config file.

(2c) and modify one line at the top of the file:

webwork2/lib/WebworkSOAP.pm to contain your secret code:

WebworkSOAP.pm:$WebworkSOAP::SeedCE{soap_authen_key} = "YourSecretCodeHere";

(3) Reboot the webwork server.

(4) Some checks:

  • Try the url http ://host.name.edu/webwork2_wsdl

This is a simple check and it should return a (complicated) wsdl file.

http ://host.name.edu/webwork2_rpc will return a blank page but should not create an error.

  • If moodle is returning the error "Communication error between the Moodle client and WeBWorK server." double check that the

address in the WSDL.pm file is correct (and remember to reboot the server). Check the apache error log for more detailed error messages.


For 2a - I did not have SOAP section in my conf file. I've added complete block You gave on the end of the file .

2b - OK

2c - OK

But where are webwork2_rpc and webwork2_wsdl directories? When should I create them? If I do create them, they are empty. What priviledges should I use ? I get "Internal Server Error" whenever I try to access http://logic.e-learn.me/webwork2_wsdl or http://logic.e-learn.me/webwork2_rpc . I'm not sure that Apache2 restart will initiate WSDL file creation? Am I right ?

In reply to Dusan Vuckovic

Re: Adding Moodle to Webwork Live Install

by Vincent Grovestine -
I, too, have encountered the exact same problem: "_wsdl" and "_rpc" URLs return an Internal Server Error from Apache.

The Apache log says:

[Fri Jan 23 10:13:27 2009] [error] [client 127.0.0.1] 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.8 /usr/local/share/perl/5.8.8 /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.

BEGIN failed--compilation aborted at /opt/webwork/webwork2/lib/WebworkSOAP/WSDL.pm line 4.

Compilation failed in require at (eval 848) line 3.

And "webwork2/lib/WebworkSOAP/WSDL.pm" contains:

package WebworkSOAP::WSDL;

use lib '/opt/webwork/webwork2/lib';
use Pod::WSDL;
use WebworkSOAP;

use constant MP2 => ( exists $ENV{MOD_PERL_API_VERSION} and $ENV{MOD_PERL_API_VERSION} >= 2 );
use constant RPC_URL => 'http://localhost/webwork2_rpc';

sub handler($) {
my ($r) = @_;
my $pod = new Pod::WSDL(
source => 'WebworkSOAP',
location => RPC_URL,
pretty => 1,
withDocumentation => 0
);
#$r->content_type('application/wsdl+xml');
if (MP2) {
#$r->send_http_header;
} else {
$r->send_http_header;
}
print($pod->WSDL);
return 0;
}

1;

Note that "Pod/WSDL.pm" does not exist on the system (mentioned in the logged Apache error).

For interest's sake, I've installed the WeBWorK v.2.4 LiveDVD to a VirtualBox 2.1.0 disk image. Moodle v.1.9 has also been installed and is running quite happily along side.

--V

In reply to Vincent Grovestine

Re: Adding Moodle to Webwork Live Install

by Vincent Grovestine -
WSDL problem solved, but RPC problem remains...

In an "A-ha!" moment, drew the parallel that as PEAR is to PHP, CPAN is to Perl. (I'm a PHP guy.) Installed the missing Perl module and "/webwork2_wsdl" returns XML content as it should.

sudo perl -MCPAN -e "install Pod::WSDL"

For the RPC page, Apache was logging a similar missing module error for "Apache::SOAP". Installed that package. RPC is still broken, however; and Apache now says this:

[Fri Jan 23 10:54:48 2009] [error] [client 127.0.0.1] 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.8 /usr/local/share/perl/5.8.8 /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.8/SOAP/Transport/HTTP.pm line 707

Looks like the server would have bounced back an HTTP "bad request" message if it had not error'd. Apache error or not, I'm faily certain that "bad request" is not what should be returned anyway.

Can anyone shed some light on what's triggering this behavior and suggest a solution?

--V
In reply to Vincent Grovestine

Re: Adding Moodle to Webwork Live Install

by Michael Gage -

I, too, have encountered the exact same problem: "_wsdl" and "_rpc" URLs return an Internal Server Error from Apache. The Apache log says: [Fri Jan 23 10:13:27 2009] [error] [client 127.0.0.1] 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.8 /usr/local/share/perl/5.8.8 /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.

This error tells me that you don't have the Pod/WSDL.pm module installed from CPAN

cpan install Pod::WSDL

should do it. You will probably need root privileges on your machine. The other adjustment you must make is:

use constant RPC_URL => 'http://localhost/webwork2_rpc';

must be adjusted to be the correct URL for your machine. You can check that the WSDL file is properly available by typing a version of this
http://hosted2.webwork.rochester.edu/webwork2_wsdl

into your browser. You should get back an XML like file that describes the capabilities of the WeBWorK webserver.

Note that

http://hosted2.webwork.rochester.edu/webwork2_rpc

will just give you a blank page (this is normal).



In reply to Dusan Vuckovic

Re: Adding Moodle to Webwork Live Install

by Michael Gage -

But where are webwork2_rpc and webwork2_wsdl directories? When should I create them? If I do create them, they are empty. What priviledges should I use ? I get "Internal Server Error" whenever I try to access http://logic.e-learn.me/webwork2_wsdl or http://logic.e-learn.me/webwork2_rpc . I'm not sure that Apache2 restart will initiate WSDL file creation? Am I right ?

webwork2_rpc is a url --- not a directory -- is handled by the SOAP stanzas in the webwork.apache-conf. Make sure you inspect your apache log files when you get an "Internal server error" message since there will be more information there. You may be missing some other file. Also always restart the server after any change since the .conf file is read only when the server starts up. Hope this helps. Let us know how this goes.
In reply to Michael Gage

Re: Adding Moodle to Webwork Live Install

by Dusan Vuckovic -
Thank You very much. I'll try now to make it work. Sorry for delayed response, but I did not get any e-mails to inform me about Your posts. Thanx again.
In reply to Dusan Vuckovic

Re: Adding Moodle to Webwork Live Install

by Dusan Vuckovic -
Well, it seems that RPC problem remains indeed. But, I can make connection from moodle to Webwork. In what way can RPC problem influence communication between them ?

Thank Y'all