[system] / branches / rel-2-3-dev / webwork-modperl / conf / webwork.apache-config.dist Repository:
ViewVC logotype

View of /branches/rel-2-3-dev/webwork-modperl/conf/webwork.apache-config.dist

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4939 - (download) (annotate)
Wed Apr 25 16:40:02 2007 UTC (6 years ago) by sh002i
File size: 5326 byte(s)
backport (sh002i): support for Apache::WeBWorK on the server root --
resolves bug #1150.

    1 ################################################################################
    2 # WeBWorK Online Homework Delivery System
    3 # Copyright © 2000-2006 The WeBWorK Project, http://openwebwork.sf.net/
    4 # $CVSHeader$
    5 #
    6 # This program is free software; you can redistribute it and/or modify it under
    7 # the terms of either: (a) the GNU General Public License as published by the
    8 # Free Software Foundation; either version 2, or (at your option) any later
    9 # version, or (b) the "Artistic License" which comes with this package.
   10 #
   11 # This program is distributed in the hope that it will be useful, but WITHOUT
   12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
   13 # FOR A PARTICULAR PURPOSE.  See either the GNU General Public License or the
   14 # Artistic License for more details.
   15 ################################################################################
   16 
   17 # This file configures Apache to handle requests for WeBWorK. To install WeBWorK
   18 # support in your Apache configuration, add the following line to the end of
   19 # your Apache configuration file (usually apache.conf or httpd.conf):
   20 #
   21 #     Include /path/to/webwork.apache-config
   22 #
   23 # Customize the variable $webwork_dir below to match the location of your
   24 # WeBWorK installation.
   25 
   26 <Perl>
   27 
   28 # Set this variable to the path to your WeBWorK installation.
   29 my $webwork_dir = "/opt/webwork/webwork2";
   30 
   31 # This code reads global.conf and extracts the remaining configuration
   32 # variables. There is no need to modify it.
   33 eval "use lib '$webwork_dir/lib'"; die $@ if $@;
   34 eval "use WeBWorK::CourseEnvironment"; die $@ if $@;
   35 my $ce = new WeBWorK::CourseEnvironment({ webwork_dir => $webwork_dir });
   36 my $webwork_url = $ce->{webwork_url};
   37 my $pg_dir = $ce->{pg_dir};
   38 my $webwork_htdocs_url = $ce->{webwork_htdocs_url};
   39 my $webwork_htdocs_dir = $ce->{webwork_htdocs_dir};
   40 my $webwork_courses_url = $ce->{webwork_courses_url};
   41 my $webwork_courses_dir = $ce->{webwork_courses_dir};
   42 eval "use lib '$pg_dir/lib'"; die $@ if $@;
   43 
   44 $WeBWorK::SeedCE{webwork_dir} = $webwork_dir;
   45 
   46 # Between the line below and the "EOF" line are the three configuration stanzas
   47 # that are used to link Apache with WeBWorK. The following variables may be
   48 # included in directives below:
   49 #
   50 #     $webwork_url            The base URL handled by Apache::WeBWorK.
   51 #     $webwork_dir            The path to the base webwork2 directory.
   52 #     $pg_dir                 The path to the base pg directory.
   53 #
   54 #     $webwork_htdocs_url     The base URL of the WeBWorK htdocs directory.
   55 #     $webwork_htdocs_dir     The path to the WeBWorK htdocs directory.
   56 #
   57 #     $webwork_courses_url    The base URL of the WeBWorK courses directory.
   58 #     $webwork_courses_dir    The path to the WeBWorK courses directory.
   59 
   60 # Define the location that is handled by the Apache::WeBWorK module, and tell
   61 # Perl where to find the libraries Apache::WeBWorK needs to run.
   62 #
   63 $Location{$webwork_url} = {
   64   SetHandler => "perl-script",
   65   PerlHandler => "Apache::WeBWorK",
   66 };
   67 
   68 # Provide access to system-wide resources.
   69 #
   70 push @Alias, [ $webwork_htdocs_url => $webwork_htdocs_dir ];
   71 $Directory{$webwork_htdocs_dir} = {
   72   Order => "allow,deny",
   73   Allow => [qw/from all/],
   74   Options => "FollowSymLinks",
   75   AllowOverride => "None",
   76 };
   77 
   78 # Provide access to course-specific resources.
   79 #
   80 push @AliasMatch, [ "$webwork_courses_url/([^/]*)/(.*)", "$webwork_courses_dir/\$1/html/\$2" ];
   81 $Directory{"$webwork_courses_dir/*/html"} = {
   82   Order => "allow,deny",
   83   Allow => [qw/from all/],
   84   Options => "FollowSymLinks",
   85   AllowOverride => "None",
   86 };
   87 
   88 # If WeBWorK is on the root, exempt the static directories from being handled
   89 # by Apache::WeBWorK.
   90 #
   91 if ($webwork_url eq "") {
   92   $Location{$webwork_courses_url} = { SetHandler => "None" };
   93   $Location{$webwork_htdocs_url} = { SetHandler => "None" };
   94 }
   95 
   96 # The following stanzas can be uncommented to enable various experimental
   97 # WeBWorK web services. These are still in testing and have not been audited
   98 # for security.
   99 
  100 # uncomment if you use the XMLRPC, RQP, or SOAP installations below
  101 #$ENV{WEBWORK_ROOT} = $webwork_dir;
  102 
  103 $PerlConfig .= <<EOF;
  104 
  105 ##### Sam's WeBWorK::Request-based XML-RPC testbed #####
  106 #
  107 #PerlModule WeBWorK::RPC
  108 #<Location /webwork2_rpc>
  109 # SetHandler perl-script
  110 # PerlHandler Apache::XMLRPC::Lite
  111 # PerlSetVar dispatch_to "WeBWorK::RPC WeBWorK::RPC::CourseManagement"
  112 #</Location>
  113 
  114 ########## XMLRPC installation ##########
  115 #
  116 #PerlModule WebworkWebservice
  117 #<Location /mod_xmlrpc>
  118 # SetHandler perl-script
  119 # PerlHandler Apache::XMLRPC::Lite
  120 # PerlSetVar dispatch_to "WebworkXMLRPC"
  121 # PerlSetVar options "compress_threshold => 10000"
  122 # Order Allow,Deny
  123 # Allow from All
  124 #</Location>
  125 
  126 ##########  RQP installation ##########
  127 #
  128 #PerlModule RQP
  129 ##<Location /rqp>
  130 ##  SetHandler perl-script
  131 ##  PerlHandler Apache::SOAP
  132 ##  PerlSetVar dispatch_to "RQP"
  133 ##  PerlSetVar options "compress_threshold => 10000"
  134 ##  Order Allow,Deny
  135 ##  Allow from All
  136 ##</Location>
  137 #<Location /rqp>
  138 # SetHandler perl-script
  139 # PerlHandler MySOAP
  140 # Order Allow,Deny
  141 # Allow from All
  142 #</Location>
  143 
  144 ########## SOAP installation ##########
  145 #
  146 #PerlModule WebworkWebservice
  147 #<Location /mod_soap>
  148 # SetHandler perl-script
  149 # PerlHandler Apache::SOAP
  150 # PerlSetVar dispatch_to "WebworkXMLRPC"
  151 # PerlSetVar options "compress_threshold => 10000"
  152 # Order Allow,Deny
  153 # Allow from All
  154 #</Location>
  155 
  156 EOF
  157 
  158 </Perl>

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9