Installation

apache2 claims there is a syntax error in webwork.conf

apache2 claims there is a syntax error in webwork.conf

by Eric Connally -
Number of replies: 10
hi all,

following the terrifically thorough installation instruction, i have made it to this step:

http://webwork.maa.org/wiki/Installation_Manual_for_2.4_on_Ubuntu_8.04#Configuring_Apache

but when i attempt to restart apache2, it spews out the following (below).

i have diff'd my webwork.conf from the distro version---it is the same. i suspect i am being a knucklehead---but i did google around with a variety of search terms, and i poked through these forums. i apologize in advance if this has been discussed elsewhere.

thanks in advance for any help
eric

-----

# apache2ctl graceful
Syntax error on line 45 of /etc/apache2/conf.d/webwork.conf:
syntax error at /opt/webwork/pg/lib/WeBWorK/PG/IO.pm line 6, near "package WeBWorK::PG::IO"\nBEGIN not safe after errors--compilation aborted at /opt/webwork/pg/lib/WeBWorK/PG/IO.pm line 7.\nCompilation failed in require at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/GatewayQuiz.pm line 35.\nBEGIN failed--compilation aborted at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/GatewayQuiz.pm line 35.\nCompilation failed in require at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/LoginProctor.pm line 32.\nBEGIN failed--compilation aborted at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/LoginProctor.pm line 32.\nCompilation failed in require at (eval 818) line 3.\nBEGIN failed--compilation aborted at /opt/webwork/webwork2/lib/WeBWorK.pm line 85.\nCompilation failed in require at /opt/webwork/webwork2/lib/Apache/WeBWorK.pm line 35.\nBEGIN failed--compilation aborted at /opt/webwork/webwork2/lib/Apache/WeBWorK.pm line 35.\n\t(in cleanup) syntax error at /opt/webwork/pg/lib/WeBWorK/PG/IO.pm line 6, near "package WeBWorK::PG::IO"\nBEGIN not safe after errors--compilation aborted at /opt/webwork/pg/lib/WeBWorK/PG/IO.pm line 7.\nCompilation failed in require at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/GatewayQuiz.pm line 35.\nBEGIN failed--compilation aborted at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/GatewayQuiz.pm line 35.\nCompilation failed in require at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/LoginProctor.pm line 32.\nBEGIN failed--compilation aborted at /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/LoginProctor.pm line 32.\nCompilation failed in require at (eval 818) line 3.\nBEGIN failed--compilation aborted at /opt/webwork/webwork2/lib/WeBWorK.pm line 85.\nCompilation failed in require at /opt/webwork/webwork2/lib/Apache/WeBWorK.pm line 35.\nBEGIN failed--compilation aborted at /opt/webwork/webwork2/lib/Apache/WeBWorK.pm line 35.\nCompilation failed in require at /etc/apache2/conf.d/webwork.conf line 62.\n
In reply to Eric Connally

Re: apache2 claims there is a syntax error in webwork.conf

by Arnold Pizer -
Hi Eric,

I'm not sure what this could be but I would check the following:

(1) check that the link in /etc/apache2/conf.d called webwork.conf points to /opt/webwork/webwork2/conf/webwork.apache2-config

and (2) check that
webwork.apache2-config and webwork.apache2-config.dist
in /opt/webwork/webwork2/conf are identical or just delete webwork.apache2-config and recopy it from webwork.apache2-config.dist

Arnie
In reply to Arnold Pizer

Re: apache2 claims there is a syntax error in webwork.conf

by Eric Connally -
hi arnie,

thanks for the suggestions. i confirmed both points---things seem to be OK.

i decided to start with a clean install of ubuntu 8.04, since the one i was using was an upgrade from an older install. i have just completed rebuilding it and i followed the webwork installation instructions as before. i am getting the identical error when trying to start apache.

so i am stuck. i may try deploying it on my laptop (a mac) just to play around with it, but either i am doing something boneheaded twice in a row (not out of the question) or there is something up.

best
eric
In reply to Eric Connally

Re: apache2 claims there is a syntax error in webwork.conf

by Davide Cervone -
The error message is complaining about a syntax error in pg/lib/WeBWorK/PG/IO.pm at line 6. That is the first executable line in the file, so I'd check that to see if there is some garbage has sneaked its way into the beginning of the file. That could cause the message you are seeing.

Actually, I just checked the CVS log for that file, and it looks like my fault. I made what was supposed to be an innocent change to that file, and accidentally inserted an "e" at the beginning of the file. I will fix it in CVS. Meanwhile, you can edit that out and see if that fixes it for you.

My humble apologies for causing you to have to do the entire installation over again! What a pain. I am red faced.

Davide
In reply to Davide Cervone

Re: apache2 claims there is a syntax error in webwork.conf

by Eric Connally -
davide,

it worked! i am so happy, i can't tell you.

and never mind about the clean install. for one thing i had so many problems along the way i should have done it in the first place, and it gave me the chance to toss out a lot of cruft.

but more to the point, if i had followed my nose i would have opened the IO.pm file myself and seen the funny stray 'e' where it shouldn't be. but i was too blinkered by that point to do anything but go and down a beer.

thanks again davide. the beer is on me if i ever get the chance.

-- e
In reply to Davide Cervone

Re: apache2 claims there is a syntax error in webwork.conf

by Hedley Pinsent -

Well, here is another one!

I was just svn-ing around and got into this mess (and more); not sure if I was upgrading from 2.4.9 to 2.4.9+++ or from 2.4.9 to 2.5.0 ?? I guess one should know.

Maybe I need another webwork configuration file for the apache; I don't know how that would happen.


Lucky it is between terms.


hp



wwadmin@hp-ubuntu:~$ sudo apache2ctl restart

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/global.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://localhost/webwork2

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/global.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://localhost/webwork2

Syntax error on line 45 of /etc/apache2/conf.d/webwork.conf:

Can't locate Locale/Maketext/Lexicon.pm in @INC (@INC contains: /opt/webwork/pg/lib /opt/webwork/webwork2/lib /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl . /etc/apache2) at /opt/webwork/webwork2/lib/WeBWorK/Localize.pm line 6.\nBEGIN failed--compilation aborted at /opt/webwork/webwork2/lib/WeBWorK/Localize.pm line 6.\nCompilation failed in require at /opt/webwork/webwork2/lib/WeBWorK.pm line 42.\nBEGIN failed--compilation aborted at /opt/webwork/webwork2/lib/WeBWorK.pm line 42.\nCompilation failed in require at /opt/webwork/webwork2/lib/Apache/WeBWorK.pm line 35.\nBEGIN failed--compilation aborted at /opt/webwork/webwork2/lib/Apache/WeBWorK.pm line 35.\n\t(in cleanup) Can't locate Locale/Maketext/Lexicon.pm in @INC (@INC contains: /opt/webwork/pg/lib /opt/webwork/webwork2/lib /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl . /etc/apache2) at /opt/webwork/webwork2/lib/WeBWorK/Localize.pm line 6.\nBEGIN failed--compilation aborted at /opt/webwork/webwork2/lib/WeBWorK/Localize.pm line 6.\nCompilation failed in require at /opt/webwork/webwork2/lib/WeBWorK.pm line 42.\nBEGIN failed--compilation aborted at /opt/webwork/webwork2/lib/WeBWorK.pm line 42.\nCompilation failed in require at /opt/webwork/webwork2/lib/Apache/WeBWorK.pm line 35.\nBEGIN failed--compilation aborted at /opt/webwork/webwork2/lib/Apache/WeBWorK.pm line 35.\nCompilation failed in require at /etc/apache2/conf.d/webwork.conf line 96.\n

wwadmin@hp-ubuntu:~$

In reply to Hedley Pinsent

Re: apache2 claims there is a syntax error in webwork.conf

by Michael Gage -
This one is straightforward. Your site is missing the the CPAN module Locale::Maketext::Lexicon.

This is needed because the newer WeBWorK will work in many languages. (Creating the dictionaries for various languages is an on going project -- Turkish is now the most developed language besides English, with French and Spanish close behind.)

To see if you are missing other CPAN modules run
webwork2/bin/check_modules.pl  

Depending on your installation something like

cpan Locale::Maketext  

and then 
cpan Locale::Maketext::Lexicon

should install the missing modules above.  

(cpan Locale::Maketext::Lexicon  should actually install everything but last time I tried it the automatic install of dependent modules wasn't working for this particular module.  YMMV.  )

Hope this helps.

-- Mike

In reply to Michael Gage

Re: apache2 claims there is a syntax error in webwork.conf

by Hedley Pinsent -

Thank you.

Everything seems fine now.

There were a couple of things missing.

It was a lot easier than I thought.

hp

In reply to Hedley Pinsent

Re: apache2 claims there is a syntax error in webwork.conf

by Robin Cruz -

I just upgraded to 2.5 with github. It was very smooth. There were a couple of items worth mentioning:

1) I had to install the Lexicon module as mentioned above.

2) I also had to install a module clalled JSON.pm

3) There seems to be a typo in SetMaker.pm at line 429. The "=>" should be ">=" ?? It wouldn't work until I made this change.

Other than that, this has been the easiest update I've done.

Thanks --rac

In reply to Robin Cruz

Re: apache2 claims there is a syntax error in webwork.conf

by Michael Gage -
thanks Robin.  I'll make this change in SetMaker.pm.  

Just to make sure which 2.5 version do you have?

There might be a note with the version number at the bottom of each page.  This starts with version 2.5.1



In reply to Michael Gage

Re: apache2 claims there is a syntax error in webwork.conf

by Robin Cruz -
I have the webwork-dev, Version 2.5.1.  I got it yesterday, Aug 20, in the afternoon. --rac