WeBWorK Main Forum

webserver can't access webwork2_files/helpFiles/

webserver can't access webwork2_files/helpFiles/

by Lars Jensen -
Number of replies: 11
Hi,

We get the error message
when accessing an explanatory link for students in a problem (for example like the link included in Library/LoyolaChicago/Precalc/Chap9Sec2/Q05.pg)

The webserver has no problems accessing files in /htdocs. The permissions for htdocs and /htdocs/helpFiles are exactly the same, so I don't understand why the webserver can't access the latter directory. We are using apache2 and lighttpd.

Below is a copy of the relevant part of our global.conf. Thanks for any help.
-Lars.

$webworkDirs{htdocs}        = "$webwork_htdocs_dir" || "$webworkDirs{root}/htdocs";
$webworkURLs{htdocs}        = "$webwork_htdocs_url";
# Location of web-accessible temporary files, such as equation images.
#$webworkDirs{htdocs_temp}   = "$webworkDirs{htdocs}/tmp";
#$webworkURLs{htdocs_temp}   = "$webworkURLs{htdocs}/tmp";
$webworkDirs{htdocs_temp}   = '/var/www/wwtmp';
#$webworkURLs{htdocs_temp}   = "/wwtmp";
$webworkURLs{htdocs_temp}   = 'http://bartok.tmcc.edu:8080/wwtmp';
# Location of cached equation images.
$webworkDirs{equationCache} = "$webworkDirs{htdocs_temp}/equations";
$webworkURLs{equationCache} = "$webworkURLs{htdocs_temp}/equations";
# Contains context-sensitive help files.
$webworkDirs{local_help}    = "$webworkDirs{htdocs}/helpFiles";
$webworkURLs{local_help}    = "$webworkURLs{htdocs}/helpFiles";

In reply to Lars Jensen

Re: webserver can't access webwork2_files/helpFiles/

by Michael Gage -
Does the webserver operatingon port 8080 also have permission to access the file?  I believe the error message is coming from that webserver -- the one that serves the auxiliary files
In reply to Lars Jensen

Re: webserver can't access webwork2_files/helpFiles/

by Lars Jensen -
Hi Mike,

It looks to me that this directory is accessed by apache - not by lighttpd. Isn't that correct? From the definitions in global.conf, it looks to me that lighttpd only has access to files in /var/www/wwtmp...?

After I posted I thought that perhaps the reason for the error is that the file is not on the server. Ought a link like this not to point to some place in /opt/webwork/libraries? isn't this where a help file of this kind ought to be located?  
In reply to Lars Jensen

Re: webserver can't access webwork2_files/helpFiles/

by Lars Jensen -
Hi Mike,

It turns out that the particular problem, Library/LoyolaChicago/Precalc/Chap9Sec2/Q05.pg, has a call to load macros AnswerFormatHelp.pl. The only macro file with this name on my system is located in /opt/webwork/libraries/NationalProblemLibrary/macros/FortLewis/AnswerFormatHelp.pl. Note that this is a FortLewis macro file. The problem is from the Loyola library. 

Does this mean that I am (and the repository is) missing some Loyola macro file(s)?  

Also, I still find the error message produced by the webserver about forbidden access to /webwork2_files/helpFiles/ strange...!?

Thanks,
Lars.
In reply to Lars Jensen

Re: webserver can't access webwork2_files/helpFiles/

by Lars Jensen -
Arnie,

My global.conf setting for $pg{directories}{macrosPath}  looks exactly like yours - see below.

Am I correct that webwork2_files/helpFiles refers to webwork2/htdocs/helpFiles ? If not, what does "access to webwork2_files/helpFiles forbidden" mean?

If so, why would the webserver complain about access to webwork2_files/helpFiles/ when it clearly has access to files in webwork2_files/images (like the MAA logo, etc), in mathjax, etc? My webwork2_files/images has the exact same permissions as webwork2_files/helpFiles?

What should I expect see if I enter http://servername.edu/webwork2/webwork2_files into my browser?

Lars.

from my global.conf:

$pg{directories}{macrosPath} = [
   ".",                     # search the problem file's directory
   $courseDirs{macros},
   $pg{directories}{macros},
   "$courseDirs{templates}/Library/macros/Union",
   "$courseDirs{templates}/Library/macros/Michigan",
   "$courseDirs{templates}/Library/macros/CollegeOfIdaho",
   "$courseDirs{templates}/Library/macros/FortLewis",
   "$courseDirs{templates}/Library/macros/TCNJ",
   "$courseDirs{templates}/Library/macros/NAU",
   "$courseDirs{templates}/Library/macros/Dartmouth",
   "$courseDirs{templates}/Library/macros/WHFreeman",
   "$courseDirs{templates}/Library/macros/HughesHallett",
   "/opt/webwork/libraries/nau_problib/macros",
];

Since this works on your system, I guess this is a webserver issue. 

In reply to Lars Jensen

Re: webserver can't access webwork2_files/helpFiles/

by Lars Jensen -
Hi All,

It turns out that the error message that "access by the webserver to webwork2_files/helpFiles is forbidden," is wrong: I found this problem Library/Rochester/set0/set00prob07.pg which also has a link to webwork2_files/helpFiles in it, and it works fine and produces no error message.

Of course this still doesn't solve my problem... 

How do I find out what triggers this bogus error message?

Lars.
In reply to Lars Jensen

Re: webserver can't access webwork2_files/helpFiles/

by Lars Jensen -
Hi again,

The problem appears to be that 

\{ AnswerFormatHelp("fractions") \} 

doesn't work properly. 

\{ AnswerFormatHelp("units") \}, on the other hand, works fine.

Can someone confirm this?

Lars.
In reply to Lars Jensen

Re: webserver can't access webwork2_files/helpFiles/

by Lars Jensen -
Hi again,

According to the documentation at http://webwork.maa.org/wiki/AnswerFormatHelp#.UPGzvKqbCoM, AnswerFormatHelp is supposed to work with:

  • angles
  • decimals
  • exponents
  • formulas
  • fractions
  • inequalities
  • intervals
  • logarithms
  • limits
  • numbers
  • points
  • syntax
  • units
  • vectors

in fact, the only topics for which AnswerFormatHelp actually works are

  • syntax
  • units

all the other topics produce the same error message I first reported.

Lars.
In reply to Lars Jensen

Re: webserver can't access webwork2_files/helpFiles/

by Paul Pearson -
Hi Lars,

There is a recent (5 month old) version of AnswerFormatHelp.pl available on github that appears to use dynamically generated JavaScript instead of static html files to display the help messages. This update was done by John Jones last summer.

https://github.com/openwebwork/webwork-open-problem-library/blob/master/OpenProblemLibrary/macros/FortLewis/AnswerFormatHelp.pl

Could you download this most recent version of AnswerFormatHelp.pl and put it in the macros subdirectory of the course templates directory and report whether that makes all help links work? (What I mean is: log into a course, click the file manager, double click the macros directory, and then upload the AnswerFormatHelp.pl file.)

If you do get this to work for a single course, you can make the changes for your entire site by uploading the most recent version of AnswerFormatHelp.pl to overwrite your copy of

/OpenProblemLibrary/macros/FortLewis/AnswerFormatHelp.pl

or

/NationalProblemLibrary/macros/FortLewis/AnswerFormatHelp.pl

(as appropriate) in your webwork installation.

Best regards,

Paul Pearson
In reply to Lars Jensen

Re: webserver can't access webwork2_files/helpFiles/

by Lars Jensen -
Hi Everyone,

For those that follows this thread: Apparently the help feature is broken in the svn version of webwork.... I "fixed" this issue by installing the github version which works fine in this respect.

Lars.
In reply to Lars Jensen

Re: webserver can't access webwork2_files/helpFiles/

by Arnold Pizer -
Hi everyone,

Here is an update on this. The file
NationalProblemLibrary/macros/FortLewis/AnswerFormatHelp.pl
was
 Modified Sun Sep 9 07:07:55 2012 UTC  by jj 
Pulling changes from git repository.

Unfortunately, the git version was not compatible with the svn distribution of WeBWorK. We have reverted to the previous version of AnswerFormatHelp.pl which works with the svn distribution.

Arnie