I have been running a webwork server for the math department at my institution for about 9 month now. There hasn't been any problem until yesterday. It would've been a simple and routine update of webwork but it somehow turned out to be hell. After the update apache2 won't start. journalctl -xe shows:
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit apache2.service has begun starting up.
Sep 19 22:15:27 webwork apache2[25588]: * Starting Apache httpd web server apache2
Sep 19 22:15:27 webwork apache2[25588]: *
Sep 19 22:15:27 webwork apache2[25588]: * The apache2 configtest failed.
Sep 19 22:15:27 webwork apache2[25588]: Output of config test was:
Sep 19 22:15:27 webwork apache2[25588]: AH00526: Syntax error on line 40 of /etc/apache2/conf-enabled/webwork.conf:
Sep 19 22:15:27 webwork apache2[25588]: Invalid command 'PerlChildInitHandler', perhaps misspelled or defined by a module not included in the server configuration
Sep 19 22:15:27 webwork apache2[25588]: Action 'configtest' failed.
Sep 19 22:15:27 webwork apache2[25588]: The Apache error log may have more information.
Sep 19 22:15:27 webwork systemd[1]: apache2.service: Control process exited, code=exited status=1
Sep 19 22:15:27 webwork systemd[1]: Failed to start LSB: Apache2 web server.
-- Subject: Unit apache2.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit apache2.service has failed.
--
-- The result is failed.
Sep 19 22:15:27 webwork systemd[1]: apache2.service: Unit entered failed state.
Sep 19 22:15:27 webwork systemd[1]: apache2.service: Failed with result 'exit-code'.
Sep 19 22:15:27 webwork sudo[25576]: pam_unix(sudo:session): session closed for user root
The error here is
"AH00526: Syntax error on line 40 of /etc/apache2/conf-enabled/webwork.conf
Invalid command 'PerlChildInitHandler', perhaps misspelled or defined by a module not included in the server configuration"
Based on my observation apache2 does not appear to be recognizing any Perl modules, not just PerlChildInitHandler. I have been on this many hours since yesterday and now I am just lost and got no clue whatsoever. I have even rebuilt webwork from scratch but the same issue still persists.
I would very much appreciate any help on this issue so our students can get back to their work soon.
Sorry, I forgot to mention that the webwork server is running on Ubuntu 16.04 LTS.
I think the first step is to determine whether apache starts correctly if the
webwork.apache-config file is not included. If so then the problem is probably localized to the webwork.apache-config file otherwise perhaps something else was changed about the apache server besides webwork?
You can move the file or link conf-enabled/webwork.conf out of the directory conf-enabled/ and restart the server to see what happens.
I am sorry. I guess my brain just got numb after struggling for many hours to fix the issue. I should have mentioned that also. Yes I have already checked that apache2 works just fine if I remove the symlink /etc/apache2/conf-enabled/webwork.conf.
Next -- is conf-enabled/webwork.conf a link pointing to
/opt/webwork/webwork2/conf/webwork.apache2.4-config
(or if webwork.conf is a file does it have the contents of webwork.apache2.4-config?) -- also did you compare webwork.apache2.4.config with the new webwork.apache2.4-config.dist ( I don't think there were any changes in that file for this release but it doesn't hurt to check.)
This assumes you are using
apache2.4 as a server (if you are using an older version of the apache server then use webwork.apache2-config.dist instead.
On other thing you can do is to comment out line 40 (PerlChildInithandler).
It is initializing the randomization and is needed to help randomize
repeated copies of problems but it is not essential to the rest of webwork.
Thank you Michael for your quick reply! You are up late.
Yes conf-enabled/webwork.conf is a symlink pointing to /opt/webwork/webwork2/conf/webwork.apache2.4-config
and there is no difference between webwork.apache2.4-config and webwork.apache2.4-config.dist.
I have already tried to comment out PerlChildInitHandler. But then next line which is
PerlModule mod_perl2
would cause an error. I commented it out also. Then
<perl>
would cause an error.
John
Yes conf-enabled/webwork.conf is a symlink pointing to /opt/webwork/webwork2/conf/webwork.apache2.4-config
and there is no difference between webwork.apache2.4-config and webwork.apache2.4-config.dist.
I have already tried to comment out PerlChildInitHandler. But then next line which is
PerlModule mod_perl2
would cause an error. I commented it out also. Then
<perl>
would cause an error.
John
Perhaps mod_perl2 is not loaded or turned on? That would be strange since
this apache server worked with the earlier version of webwork. But if there
were changes to the basic httpd.conf file for apache that is possible.
When desperate you comment out as much of the offending file as you can and slowly add things back in. Leave the <perl> ...</perl> segment out until the rest of the stuff compiles. It's possible that you have a hidden character (one that doesn't print) somewhere in the file near the top.
Hi,
I would definitely check that mod_perl is running.
See http://webwork.maa.org/wiki/Installation_Manual_for_2.13_on_Ubuntu_16.04#Apache_2_and_mod_perl
Further test Apache by connecting to "http://localhost/server-info" using a browser on your machine (or or from a browser on a remote machine in the math.yourschool.edu domain) and you will see a page listing various information about Apache. In particular under Server Settings
you should see
Server Version: Apache/2.4.18 (Ubuntu) mod_apreq2-20090110/2.8.0 mod_perl/2.8.0 Perl/v5.22.1