Installation

MathJax not rendering in WW 2.18

MathJax not rendering in WW 2.18

by Hy Ginsberg -
Number of replies: 8

Hello  All,

I Did a migration from our old centos webwork server(2.12) to a new Ubuntu(2.18) I used the Webwork 2.18 virtual image, imported into our vcenter environment.

From there I Imported our courses, database,  SSL certificates and are using apache2 for my proxy. 

After Conquering some major issues along the way, using documentation and articles from this forum I am stuck on an issue regarding MathJax rendering problems on google chrome and firefox on the "Hmwk Sets editor" tab

I have the following in my localoverride.conf file 

"$webworkURLs{MathJax} = "$webworkURLs{htdocs}/mathjax/MathJax.js?config=TeX-MML-AM_HTMLorMML-full";"

I also Have tried to migrate the Mathjax directory from the old server and placed it in both /opt/webwork as well as /opt/webwork/webwork2/htdocs. this was aftering running the command 

-git clone https://github.com/mathjax/MathJax.git

I tried to run the following command  as well 'install npm'  

Ive tried to run the following commands 'npm ci'  in /opt/webwork/webwork2/htdocs/ (also in /opt/webwork/pg/htdocs)


At this point I am stuck on what to do any suggestions? Please let me know if anyone requires and more details.


Thank you For anyones response and time. 




Attachment webworkissue1.png
In reply to Hy Ginsberg

Re: MathJax not rendering in WW 2.18

by Glenn Rice -

You should not have $webworkURLs{MathJax} in your localOverrides.conf file at all.  It is not used in any case.  Run "npm ci" in your /opt/webwork/webwork/htdocs directory and also in your /opt/webwork/pg/htdocs directory.

In reply to Glenn Rice

Re: MathJax not rendering in WW 2.18

by Hy Ginsberg -

Hey Glenn,

Thank you for your fast response,  I commented out the  $webworkURLs{MathJax} in my localOverrides.conf file.

Afterwards I did as you mentioned and ran npm ci(in both directories)  then npm audit fix (to fix a few vulnerabilities).

I rebooted the virtual server and tried to render the problems again and I got the same results.


Any other Suggestions?

In reply to Hy Ginsberg

Re: MathJax not rendering in WW 2.18

by Danny Glin -

Do you see any errors in your browser's javascript console?

The next thing would be to check that the javascript files in /opt/webwork/webwork2/htdocs/js are readable by the web server.

In reply to Danny Glin

Re: MathJax not rendering in WW 2.18

by Hy Ginsberg -

Hello after opening up the browser in developer tools setting and seeing the console I see the following error 

"Mixed Content: The page at 'https:/myinstitution.edu/webwork2/MA200F24Ginsberg/instructor/sets/polynomials?effectiveUser=admin' was loaded over HTTPS, but requested an insecure stylesheet 'http://xxx.xxx.xxx.xxx/pg_files/js/Knowls/knowl.778c6dfe.min.css'. This request has been blocked; the content must be served over HTTPS." 


I also see this warning "iframeResizer.min.js?version=%5E4.3.2:8 [iFrameSizer][Host page: psr_render_area_11_iframe] IFrame has not responded within 20 seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."

- but I believe this is a warning that is a value in a setting in one of my config files that I can look at later.


from that first error it seems its an issue regarding https, any idea what I can do next?

In reply to Hy Ginsberg

Re: MathJax not rendering in WW 2.18

by Hy Ginsberg -
After Investigating the error that was thrown In the javascript console I got the article

- https://stackoverflow.com/questions/67765238/mixed-content-the-page-at-was-loaded-over-https-but-requested-an-insecure-resour

From there I did add the http and https url and Ips in the following setting in my chrome "chrome://flags/#unsafely-treat-insecure-origin-as-secure"

which resolved the error of ""Mixed Content:" however I then received a time out error

"xxx.xxx.xxx.xxx/webwork2_files/themes/math4/bootstrap.9efba867.min.css net::ERR_CONNECTION_TIMED_OUT"

I dont know if im going down a rabbit hole or if there is a setting on the server in which I can modify/ add the ssl to be used for the Js?
In reply to Hy Ginsberg

Re: MathJax not rendering in WW 2.18

by Arnold Pizer -

Double check that $server_root_url is set correctly in site.conf. You need https, not http.  See https://webwork.maa.org/wiki/Installation_Manual_for_2.18_on_Ubuntu#Check_site.conf

In reply to Arnold Pizer

Re: MathJax not rendering in WW 2.18

by Hy Ginsberg -

Hello Arnold,

Thank you that resolved the Mixed content error, in my site.conf i had HTTPS://myinstution.edu/webwork2 while having HTTP://"public IP here"/webwork2

which gave me the mixed content error.


As soon as i changed the public ip from http to https: there is no longer the error regarding mixed content in the JavaScript console but now I am still getting a time out error

"Uncaught (in promise) Error: A listener indicated an asynchronous response by returning true, but the message channel closed before a response was received"

"Failed to load resource: net::ERR_CONNECTION_TIMED_OUT"

"GET https://xxx.xxx.xxx.xxx/webwork2_files/themes/math4/math4-overrides.e3b0c442.min.css net::ERR_CONNECTION_TIMED_OUT"

In reply to Hy Ginsberg

Re: MathJax not rendering in WW 2.18

by Hy Ginsberg -
Hey All,
I was able to resolve this issue,

the issue stemed from the following line in the Config file 'site.conf'

in this file file there are these lines for which you have to fill in the field value.

"# The server protocol and domain name, e.g., 'https://webwork.yourschool.edu' or 'http://localhost'
# Note, if running a secure (ssl) server, you probably need 'https://...'.
# Also note that if you use a non-standard port, then that should also be included,
# e.g., 'http://localhost:8080'.
$server_root_url = xxxx"

In this 'xxxx' location For some reason there was an IP 192. xxx.xxx.xxx which didnt match our public ip for the server, so thats why the system was getting timed out cause the ip didnt lead to anywhere. once I changed that Ip to our public IP i stopped getting the time out error, but instead got a certificate error. in the Javascript Console

"net::ERR_CERT_COMMON_NAME_INVALID"

I realised that the SSL in which we had for the server wasnt assoicated with an ip but rather just a FQDN.

So thats when I changed the xxxx value to the FQDN of the server. I rebooted the server and the "render all' button worked.

Thanks everyone for the troubleshooting advice.