Forum archive 2000-2006

Quoc Nguyen - webwork installation and configuration

Quoc Nguyen - webwork installation and configuration

by Arnold Pizer -
Number of replies: 0
inactiveTopicwebwork installation and configuration topic started 12/18/2006; 6:40:41 PM
last post 12/19/2006; 4:58:00 PM
userQuoc Nguyen - webwork installation and configuration  blueArrow
12/18/2006; 6:40:41 PM (reads: 160, responses: 7)
Hi john,

I have problem in config the webwork on my local system, which run on Linux, Apache2.055, mod_perl-2.03, perl5.8.7 and PHP5 I've got the sources code and documentation on http://devel.webwork.rochester.edu/twiki/bin/view/Webwork/WebHome

after getting the webwork source code, I run bin/check_modules.pl. It looks OK(all modules installed!)



I want a URL looks like: http://webwork.ucmrced.edu so I have the webwork2 directory @ /opt/webwork/webwork2 and so pg: /opt/webwork/pg



Change in global.conf
$webwork_url = "/";
$webwork_htdocs_url = "/webwork2_files";
$webwork_courses_url = "/webwork2_course_files";



Change on Apache: httpd.conf
<VirtualHost *:80>
ServerAdmin ccb_info@ucmerced.edu
ServerName webwork.ucmerced.edu
ServerAlias webwork
#DocumentRoot /var/empty
DocumentRoot /opt/webwork/webwork2
#ScriptAlias /cgi-bin/ /opt/webwork/webwork2/cgi
ErrorLog /opt/webwork/logs/error-log
CustomLog /opt/webwork/logs/access-log common
</VirtualHost>



Does any one have any idea what wrong on my configuration? Thanks

-Q

<| Post or View Comments |>


userJohn Jones - Re: webwork installation and configuration  blueArrow
12/19/2006; 10:27:39 AM (reads: 175, responses: 0)
Hi,

It looks like you are trying to configure the top level page http://webwork.ucmerced.edu to be the one which has the automatic course listing. Normally, this would be at http://webwork.ucmerced.edu/webwork2. I don't know if this is possible, but it is likely related to your problem. I would change $webwork_url back to the more standard value of "/webwork2". There may be a corresponding change in your apache configuration.

In an earlier e-mail, you had asked about my site's configuration/setup. I realize now you may have been thinking specifically of our top level page http://webwork.asu.edu. That page is not generated by webwork. That page is essentially created by hand. The top/left/bottom are copied from another page to make this page match the other department web pages, and the big table in the middle is editted by hand every semester.

John

<| Post or View Comments |>


userQuoc Nguyen - Re: webwork installation and configuration  blueArrow
12/19/2006; 12:14:34 PM (reads: 172, responses: 0)
Hi John,

if the URL like http://webwork.ucmerced.edu/webwork2. and the global.conf is

# URL of WeBWorK handler.
$webwork_url = "/webwork2";



# Root directory of PG.
$pg_dir = "/opt/webwork/pg";



# URL and path to htdocs directory.
$webwork_htdocs_url = "/webwork2_files";
$webwork_htdocs_dir = "$webwork_dir/htdocs";



# URL and path to courses directory.
$webwork_courses_url = "/webwork2_course_files";
$webwork_courses_dir = "/opt/webwork/courses";

webwork.apache2-config

...
# Set this variable to the path to your WeBWorK installation.
my $webwork_dir = "/opt/webwork/webwork2";
...

Do I need to add

"Include /opt/webwork/webwork2/conf/webwork.apache-config"  line to main Apache Conf httpd.conf?

What do I need to change on httpd.conf file?

Thanks, -Q

<| Post or View Comments |>


userDavide P. Cervone - Re: webwork installation and configuration  blueArrow
12/19/2006; 12:47:37 PM (reads: 166, responses: 0)
You definitely DON'T want to set the DocumentRoot to be the webwork directory. In fact, if you are using this server only for WeBWorK, you can leave it /var/empty. All the pages for WeBWorK are generated dynamically, so the DocumentRoot never comes into play. If you change it to /opt/webwork/webwork2, that means you are allowing your server to send the files in those directories to any user (including, for example, the configuration files that include your mysql passwords, and so on).

If you really want the top level page for the server to be the webwork course-selection page, you can do that by using a line like

    Redirect permanent /index.html http://webwork.ucmrced.edu/webwork2/

As for apache's configuration file, you need to add

    Include /opt/webwork/webwork2/conf/webwork.apache2-config
to httpd.conf (note that you need the apache2 version, not the apache version that you indicated in your message). Also, make sure that you have followed the instructions in the Twiki that you cite above. Apache2 has to be compiled with specific options set, and it may not work with an out-of-the-box apache2 distribution. I haven't set up an apache2 installation, so I can't help much with that.

Davide

<| Post or View Comments |>


userQuoc Nguyen - Re: webwork installation and configuration  blueArrow
12/19/2006; 1:22:44 PM (reads: 168, responses: 1)
Thanks Davide, I am using Apache/2.0.55 (Unix) PHP/5.1.2 mod_perl/2.0.3 Perl/v5.8.7 on Linux OS. There are two sites running on this server and using one IP address so that I have to use VirtualHost to set up.
conf/httpd.conf
...
...
<VirtualHost *:80>
ServerAdmin ccb_info@ucmerced.edu
ServerName ccb.ucmerced.edu
ServerAlias ccb
DocumentRoot /usr/www/server/ccb/html
ScriptAlias /cgi-bin/ /usr/www/server/ccb/cgi-bin/
ErrorLog /var/log/apache2/ccb-error-log
CustomLog /var/log/apache2/ccb-access-log common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin ccb_info@ucmerced.edu
ServerName ccb.ucmerced.edu
ServerAlias ccb
DocumentRoot /usr/www/server/ccb/html
ScriptAlias /cgi-bin/ /usr/www/server/ccb/cgi-bin/
ErrorLog /var/log/apache2/ccb-error-log
CustomLog /var/log/apache2/ccb-access-log common
</VirtualHost>

Now come with webwork. I want to have the URL looks like either http://webwork.ucmerced.edu or http://webwork.ucmerced.edu/webwork2/

What do I need to change on http.conf file?

 

If I add this on httpd.conf 
<VirtualHost *:80>
ServerAdmin ccb_info@ucmerced.edu
ServerName webwork.ucmerced.edu
ServerAlias webwork
DocumentRoot /var/empty
ErrorLog /opt/webwork/logs/error-log
CustomLog /opt/webwork/logs/access-log common
</VirtualHost>



The http://webwork.ucmerced.edu static work.
Now I like http://webwork.ucmerced.edu/webwork2/
What do I need to do on the httpd.conf file?

I have the global.conf file: ( http://qsb.ucmerced.edu/ww-config/webwork2/conf/global.conf) and the webwork.apache2-config: http://qsb.ucmerced.edu/ww-config/webwork2/conf/webwork.apache2-config

If the URL is http://webwork.ucmerced.edu/webwork2/ what would be a right configuration? Any help would be very appreciated! Thank you very much.

Cheers, -Q

<| Post or View Comments |>


userDavide P. Cervone - Re: webwork installation and configuration  blueArrow
12/19/2006; 2:16:56 PM (reads: 191, responses: 0)
I've never used virtual hosting, but I think that all you should need to do is include
    Include /opt/webwork/webwork2/conf/webwork.apache2-config
in the httpd.conf file. It may need to be inside the VirtualHost directive, but I'm not sure. The links to your global.conf and webwork.apache2-config files didn't work for me, so if you were trying to let us access your configurations, I wasn't able to do so.

Davide

<| Post or View Comments |>


userQuoc Nguyen - Re: webwork installation and configuration  blueArrow
12/19/2006; 2:31:37 PM (reads: 163, responses: 0)
Hi Dave,

The links are working now. Thanks

<| Post or View Comments |>


userDavide P. Cervone - Re: webwork installation and configuration  blueArrow
12/19/2006; 4:58:00 PM (reads: 156, responses: 0)
When I follow the link to http://webwork.ucmerced.edu/webwork2/ I obtain the "Internal server error" page. That means that the server's error log file should contain more information about what went wrong (i.e., why WeBWorK failed to run). It turns out that I could access the logs through your links above (you will definitely want to disable them once you get this all working), and found the following message:

[Tue Dec 19 15:51:51 2006] [error] [client xx.xx.xx.xx] failed to resolve handler `Apache::WeBWorK': Can't locate Apache2/Cookie.pm in @INC (@INC contains: /opt/webwork/pg/lib /opt/webwork/webwork2/lib /usr/lib/perl5/5.8.7/x86_64-linux-thread-multi /usr/lib/perl5/5.8.7 /usr/lib/perl5/site_perl/5.8.7/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.7/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_perl . /usr/www/apache) at /opt/webwork/webwork2/lib/WeBWorK/Cookie.pm line 41.
BEGIN failed--compilation aborted at /opt/webwork/webwork2/lib/WeBWorK/Cookie.pm line 49.
Compilation failed in require at /opt/webwork/webwork2/lib/WeBWorK/Authen.pm line 53.
BEGIN failed--compilation aborted at /opt/webwork/webwork2/lib/WeBWorK/Authen.pm line 53.
Compilation failed in require at /opt/webwork/webwork2/lib/WeBWorK.pm line 47.
BEGIN failed--compilation aborted at /opt/webwork/webwork2/lib/WeBWorK.pm line 47.
Compilation failed in require at /opt/webwork/webwork2/lib/Apache/WeBWorK.pm line 35.
BEGIN failed--compilation aborted at /opt/webwork/webwork2/lib/Apache/WeBWorK.pm line 35.
Compilation failed in require at (eval 24) line 3.

This indicates that the Apache2::Cookie module is not being found by your perl installation. You will need to obtain it from www.cpan.org and install it in order to resolve this problem. Once you do that, you should continue to check the error log until no more similar errors occur.

At least it looks like the apache set up is working. It is now a matter of getting all the modules together for WeBWorK. Since you say you have already run check_modules.pl, you probably have nearly everything you need. Unfortunately, it doesn't check for Apache2::Cookie. (That should be added to the list.) Note that Apache2::Cookie is part of the libapreq2 distribution, so that is what you will need to obtain from CPAN.

Davide

<| Post or View Comments |>