WeBWorK Problems

Apache2 won't start

Apache2 won't start

by Arnold Pizer -
Number of replies: 9
Hi,

My last post may have killed this thread (at least I can not get it to load) so maybe I pasted in a character that messed things up.

My post was about checking that mod_perl is actually running: Look at
http://webwork.maa.org/wiki/Installation_Manual_for_2.13_on_Ubuntu_16.04#Apache_2_and_mod_perl

specifically:
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

Arnie


In reply to Arnold Pizer

Re: Apache2 won't start

by Sungwook Lee -
It seems like you really killed the thread. But I have read copies of Micheal's and also your replies by e-mail. It makes sense that it may have something to do with mod_perl.

I checked http://localhost/server-info (please see the attached pdf file) and unless I missed something obvious it appears that mod_perl is not loaded for some reason. But apt-cache search mod-perl shows

libapache2-mod-perl2 - Integration of perl with the Apache2 web server
libapache2-mod-perl2-dev - Integration of perl with the Apache2 web server - development files
libapache2-mod-perl2-doc - Integration of perl with the Apache2 web server - documentation
libfile-chmod-perl - chmod() override with symbolic and ls-style modes
libhtml-wikiconverter-usemod-perl - HTML to wiki markup converter - UseMod dialect
liblinux-pid-perl - wrapper around the getpid() and getppid() C functions
liblinux-usermod-perl - module to modify user and group accounts
librefdb-perlmod-perl - RefDB-perlmod module for perl

So perl is installed as far as I can see.

John
In reply to Sungwook Lee

Re: Apache2 won't start

by Sungwook Lee -
I made a progress though it is still not working. First I purged mod_perl2 and reinstalled it. I believe mod_perl2 is loaded now and no longer have any error associated with perl. However there is another error showed up. Still it's got something to do with /etc/apache2/conf-enabled/webwork.conf because without this apache2 works fine.

journalctl -xe shows:

Sep 20 12:19:55 webwork apache2[8345]: webwork.apache2-config: WeBWorK server is starting
Sep 20 12:19:55 webwork apache2[8345]: webwork.apache2-config: WeBWorK root directory set to /opt/webwork/webwork2 in webwork2/conf/webwork.apache2-config
Sep 20 12:19:55 webwork apache2[8345]: webwork.apache2-config: The following locations and urls are set in webwork2/conf/site.conf
Sep 20 12:19:55 webwork apache2[8345]: webwork.apache2-config: PG root directory set to /opt/webwork/pg
Sep 20 12:19:55 webwork apache2[8345]: webwork.apache2-config: WeBWorK server userID is www-data
Sep 20 12:19:55 webwork apache2[8345]: webwork.apache2-config: WeBWorK server groupID is wwdata
Sep 20 12:19:55 webwork apache2[8345]: webwork.apache2-config: The webwork url on this site is http://math.usm.edu/webwork2
Sep 20 12:19:55 webwork apache2[8345]: webwork.apache2-config: The webwork smtp server address is smtp.office365.com
Sep 20 12:19:55 webwork apache2[8345]: webwork.apache2-config: The webwork smtp server port is
Sep 20 12:19:55 webwork apache2[8345]: webwork.apache2-config: The webwork smtp server protocol is 'not ssl'
Sep 20 12:19:55 webwork apache2[8345]: Action 'configtest' failed.
Sep 20 12:19:55 webwork apache2[8345]: The Apache error log may have more information.
Sep 20 12:19:55 webwork systemd[1]: apache2.service: Control process exited, code=exited status=1
Sep 20 12:19:55 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 20 12:19:55 webwork systemd[1]: apache2.service: Unit entered failed state.
Sep 20 12:19:55 webwork systemd[1]: apache2.service: Failed with result 'exit-code'.
Sep 20 12:19:55 webwork sudo[8333]: pam_unix(sudo:session): session closed for user root

However /var/log/apache2/error.log does not show anything inginificant:

Wed Sep 20 10:07:53.226803 2017] [mpm_prefork:notice] [pid 2401] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Wed Sep 20 10:07:53.226849 2017] [core:notice] [pid 2401] AH00094: Command line: '/usr/sbin/apache2'
[Wed Sep 20 11:54:20.583261 2017] [mpm_prefork:notice] [pid 2401] AH00169: caught SIGTERM, shutting down
[Wed Sep 20 11:54:21.699695 2017] [mpm_prefork:notice] [pid 14322] AH00163: Apache/2.4.18 (Ubuntu) mod_perl/2.0.9 Perl/v5.22.1 configured -- resuming normal operations
[Wed Sep 20 11:54:21.699722 2017] [core:notice] [pid 14322] AH00094: Command line: '/usr/sbin/apache2'
[Wed Sep 20 11:54:29.937866 2017] [mpm_prefork:notice] [pid 14322] AH00169: caught SIGTERM, shutting down
[Wed Sep 20 11:55:30.414939 2017] [mpm_prefork:notice] [pid 1715] AH00163: Apache/2.4.18 (Ubuntu) mod_perl/2.0.9 Perl/v5.22.1 configured -- resuming normal operations
[Wed Sep 20 11:55:30.431019 2017] [core:notice] [pid 1715] AH00094: Command line: '/usr/sbin/apache2'
[Wed Sep 20 11:59:29.788663 2017] [mpm_prefork:notice] [pid 1715] AH00169: caught SIGTERM, shutting down
[Wed Sep 20 12:06:39.673703 2017] [mpm_prefork:notice] [pid 4926] AH00163: Apache/2.4.18 (Ubuntu) mod_perl/2.0.9 Perl/v5.22.1 configured -- resuming normal operations
[Wed Sep 20 12:06:39.673735 2017] [core:notice] [pid 4926] AH00094: Command line: '/usr/sbin/apache2'
[Wed Sep 20 12:07:16.800920 2017] [mpm_prefork:notice] [pid 4926] AH00169: caught SIGTERM, shutting down

At this point I have no clue.

John
In reply to Sungwook Lee

Re: Apache2 won't start

by Arnold Pizer -
Hi,

It looks like you have a lot of things missing. Your server-info gives:
Server Version: Apache/2.4.18 (Ubuntu)
It should read:
Server Version: Apache/2.4.18 (Ubuntu) mod_apreq2-20090110/2.8.0 mod_perl/2.0.9 Perl/v5.22.1
I'm not sure how you set up apache. There are detailed instructions at http://webwork.maa.org/wiki/Installation_Manual_for_2.13_on_Ubuntu_16.04

At the bottom of the section http://webwork.maa.org/wiki/Installation_Manual_for_2.13_on_Ubuntu_16.04#Ubuntu_Software_Packages
you could copy and run (as root) the whole apt-get install command and it will install everything that may be missing and leave alone everything that is already installed and up to date.

Arnie
In reply to Arnold Pizer

Re: Apache2 won't start

by Sungwook Lee -
Hi Arnie,

Thank you for you reply. I did install everything as instructed by the manual. My guess is that when I did Ubuntu updates something might have failed. I have been running webwork server for the past 9 months without any issue up until 2 days ago. Anyway I did follow your suggestion and it did install a few things including libapache2-request-perl. My guess is that they were removed when I purged mod_perl2 before reinstalled it.

Now a big progress! apache2 is loading with webwork.conf. However still webwork is not loading :(. It's address is

http://math.usm.edu/webwork2

sudo apache2ctl restart shows:
webwork.apache2-config: webwork_server_admin_email for reporting bugs has been set to sunglee@usm.edu in site.conf
webwork.apache2-config: WeBWorK server is starting
webwork.apache2-config: WeBWorK root directory set to /opt/webwork/webwork2 in webwork2/conf/webwork.apache2-config
webwork.apache2-config: The following locations and urls are set in webwork2/conf/site.conf
webwork.apache2-config: PG root directory set to /opt/webwork/pg
webwork.apache2-config: WeBWorK server userID is www-data
webwork.apache2-config: WeBWorK server groupID is wwdata
webwork.apache2-config: The webwork url on this site is http://math.usm.edu/webwork2
webwork.apache2-config: The webwork smtp server address is smtp.office365.com
webwork.apache2-config: The webwork smtp server port is
webwork.apache2-config: The webwork smtp server protocol is 'not ssl'
WebworkSOAP::WSDL: webwork_directory set to /opt/webwork/webwork2 via $WeBWorK::Constants::WEBWORK_DIRECTORY set in webwork.apache2-config
WebworkSOAP::WSDL: rpc_url set to http://math.usm.edu/webwork2_rpc
WebworkWebservice: webwork_directory set to /opt/webwork/webwork2 via $WeBWorK::Constants::WEBWORK_DIRECTORY set in webwork.apache2-config
webwork.apache2-config: webwork_server_admin_email for reporting bugs has been set to sunglee@usm.edu in site.conf
webwork.apache2-config: WeBWorK server is starting
webwork.apache2-config: WeBWorK root directory set to /opt/webwork/webwork2 in webwork2/conf/webwork.apache2-config
webwork.apache2-config: The following locations and urls are set in webwork2/conf/site.conf
webwork.apache2-config: PG root directory set to /opt/webwork/pg
webwork.apache2-config: WeBWorK server userID is www-data
webwork.apache2-config: WeBWorK server groupID is wwdata
webwork.apache2-config: The webwork url on this site is http://math.usm.edu/webwork2
webwork.apache2-config: The webwork smtp server address is smtp.office365.com
webwork.apache2-config: The webwork smtp server port is
webwork.apache2-config: The webwork smtp server protocol is 'not ssl'
WebworkSOAP::WSDL: webwork_directory set to /opt/webwork/webwork2 via $WeBWorK::Constants::WEBWORK_DIRECTORY set in webwork.apache2-config
WebworkSOAP::WSDL: rpc_url set to http://math.usm.edu/webwork2_rpc
WebworkWebservice: webwork_directory set to /opt/webwork/webwork2 via $WeBWorK::Constants::WEBWORK_DIRECTORY set in webwork.apache2-config
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message

Everything appears to be ok. The last thing about qualified domain name is not important. So I am really baffled. Am I missing something obvious?

John

In reply to Sungwook Lee

Re: Apache2 won't start

by Arnold Pizer -
Hi,

The error from http://math.usm.edu/webwork2 is
math.usm.edu didn’t send any data.
ERR_EMPTY_RESPONSE
I don't know what I would look at first. Does the apache error log give any info?
One thing you might do is to do a diff between the config files in /opt/webwork/webwork2/conf and their .distrib versions and see if there are any typos, etc.

Hopefully someone else may have an idea what may be wrong.

Arnie


In reply to Arnold Pizer

Re: Apache2 won't start

by Sungwook Lee -
Thx a bunch Arnie! Since apache2 is working, I didn't think of checking /var/log/apache2/error.log

The log contains an error "apache2.so: undefined symbol: apreq_handle_apache2" which indicates that module apreq is not enabled. After running

sudo a2enmod apreq2

voila! Webwork came back on-line!

Thank you and Michael for all your help!

John
In reply to Sungwook Lee

Re: Apache2 won't start

by Michael Gage -
Great!!.  Glad to hear things are working now. 

This thread is a reasonable guide for trouble shooting -- things to try, one step at a time
-- when you have a mysterious error in getting apache to run with WeBWorK.

In reply to Michael Gage

Re: Apache2 won't start

by Arnold Pizer -
Mike,

Is it possible to edit the previous (original) thread and maybe delete my last post which seems to have caused that thread not to load? I looked around a bit but didn't see what to do.

Arnie

PS. Also note that looking at server-info again would have shown that apreq was not running but I didn't think of that. But the apache error log is always a good place to look. Glad that got resolved.