Installation

Problem with Location directive

Problem with Location directive

by Chris Godbout -
Number of replies: 4
Hi, I'm trying to get WebWork up and running for my students. I have a VPS running Ubuntu 12.04 and I've followed the instructions here. I'm at the point where everything is in its place and I thought that everything was configured, but running

# apache2ctl configtest

gives the following

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 www-data
webwork.apache2-config: The webwork url on this site is https://webwork.mathologist.net
Localize.pm: Full path for the localization directory set to |/opt/webwork/webwork2/lib/WeBWorK/Localize|
Syntax error on line 45 of /etc/apache2/conf.d/webwork.conf:
$parms->add_config() has failed: <Location> directive requires additional arguments at /usr/lib/perl5/Apache2/PerlSections.pm line 215.\n
Action 'configtest' failed.
The Apache error log may have more information.

I've checked the error log and there's nothing related to this. I'm experienced with Linux, but not apacher or perl. Anyone have any suggestions?

In reply to Chris Godbout

Re: Problem with Location directive

by Gavin LaRose -
Hi Chris,

Is it possible that one of the entries in the @Alias array that is created in webwork.conf (webwork.apache2-config) is an empty string, or that one of the <Location> stanzas toward the bottom of that file has an empty location?

Gavin

In reply to Gavin LaRose

Re: Problem with Location directive

by Chris Godbout -
Thanks for responding so quickly!

How would I check if one of the entries in @Alias is empty? I added a "print @Alias" line and it printed out "ARRAY(0x7f92e20f00f8)"

As for the location stanzas at the bottom, I commented them all out and still got the same error. I also didn't change them from the default at all.
In reply to Chris Godbout

Re: Problem with Location directive

by Gavin LaRose -
Hi Chris,

That argues that the @Alias array isn't empty; it's built of references to arrays, so that's what your print station is telling us. We can see what's there by dereferencing the array; something like foreach @Alias { print join(', ', @$_),"\n"; }

That said, I don't think that should come in with an empty value unless $webwork_htdocs_dir isn't properly set elsewhere. It should be set by default, and I have it in my localOverrides.conf or site.conf file.

It might be worth posting your webwork.apache2-config file, too, in case there's something obvious there.

Gavin

In reply to Gavin LaRose

Re: Problem with Location directive

by Chris Godbout -
Thanks for your help. I figured it out and it was something else. In site.conf I had changed the line

$webwork_url = '/webwork2'

to

$webwork_url = ""

And then forgot that I had changed it. I started installation pretty much from scratch and left it like that and everything worked fine. Oops.

Thanks for helping, though.