Installation

Starting Apache2 with Webwork

Re: Starting Apache2 with Webwork

by Arnold Pizer -
Number of replies: 0

This is taken from http://devel.webwork.rochester.edu/twiki/bin/view/Webwork/InstallationManualV2pt3forDebian4pt0#Configuring_Apache

If you see the error

Syntax error on line 29 of /opt/webwork/webwork2/conf/webwork.apache2-config:
$parms->add_config() has failed: Option FollowSymLinks not allowed here at /usr/lib/perl5/Apache2/PerlSections.pm line 203.\n
we have to do some more work. If you don't get this error, you can skip this section and go on to Test your configuration. At the time these instructions are being written Debian has packaged mod_perl version 2.0.2 which has a small bug which seems to be fixed in version 2.0.3. However we have a pretty easy work around for version 2.0.2. Edit webwork.apache2-config as follows:

# cd /opt/webwork/webwork2/conf
# gedit webwork.apache2-config

Replace the end of the file (starting with # Provide access to system-wide resources.) with the section below. What we are doing is commenting out the two Directory blocks within the main Perl block, moving them below (i.e. outside) the main Perl block and then replacing perl variables $webwork_htdocs_dir and $webwork_courses_dir with the actual directories.

# Provide access to system-wide resources.
#
push @Alias, [ $webwork_htdocs_url => $webwork_htdocs_dir ];
#$Directory{$webwork_htdocs_dir} = {
# Order => "allow,deny",
# Allow => [qw/from all/],
# Options => "FollowSymLinks",
# AllowOverride => "None",
#};

# Provide access to course-specific resources.
#
push @AliasMatch, [ "$webwork_courses_url/([^/]*)/(.*)", "$webwork_courses_dir/\$1/html/\$2" ];
#$Directory{"$webwork_courses_dir/*/html"} = {
# Order => "allow,deny",
# Allow => [qw/from all/],
# Options => "FollowSymLinks",
# AllowOverride => "None",
#};

# If WeBWorK is on the root, exempt the static directories from being handled
# by Apache::WeBWorK.
#
if ($webwork_url eq "") {
 $Location{$webwork_courses_url} = { SetHandler => "None" };
 $Location{$webwork_htdocs_url} = { SetHandler => "None" };
}

</Perl>

<Directory /opt/webwork/webwork2/htdocs>
 Allow from all
 AllowOverride None
 Options FollowSymLinks
 Order allow,deny
</Directory>

<Directory /opt/webwork/courses/*/html>
 Allow from all
 AllowOverride None
 Options FollowSymLinks
 Order allow,deny
</Directory>

Then save the file and Quit.

Restart Apache

# apache2ctl graceful

and all should be well.