[system] / trunk / webwork2 / conf / webwork.apache-config.dist Repository:
ViewVC logotype

View of /trunk/webwork2/conf/webwork.apache-config.dist

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3973 - (download) (annotate)
Wed Jan 25 23:13:56 2006 UTC (7 years, 4 months ago) by sh002i
File size: 5350 byte(s)
forward-port from rel-2-2-dev: (update copyright date range -- 2000-2006.
this is probably overkill, since there are some files that were created
after 2000 and some files that were last modified before 2006.)

    1 ################################################################################
    2 # WeBWorK Online Homework Delivery System
    3 # Copyright © 2000-2006 The WeBWorK Project, http://openwebwork.sf.net/
    4 # $CVSHeader: webwork2/conf/webwork.apache-config.dist,v 1.10 2005/09/28 23:24:15 gage Exp $
    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/webwork2";
   30 
   31 $ENV{WEBWORK_ROOT} = $webwork_dir; #allows the XMLRPC modules to find
   32                                    # the webwork root directory
   33 
   34 # This code reads global.conf and extracts the remaining configuration
   35 # variables. There is no need to modify it.
   36 eval "use lib '$webwork_dir/lib'"; die $@ if $@;
   37 eval "use WeBWorK::CourseEnvironment"; die $@ if $@;
   38 my $ce = new WeBWorK::CourseEnvironment({ webwork_dir => $webwork_dir });
   39 my $webwork_url = $ce->{webwork_url};
   40 my $pg_dir = $ce->{pg_dir};
   41 my $webwork_htdocs_url = $ce->{webwork_htdocs_url};
   42 my $webwork_htdocs_dir = $ce->{webwork_htdocs_dir};
   43 my $webwork_courses_url = $ce->{webwork_courses_url};
   44 my $webwork_courses_dir = $ce->{webwork_courses_dir};
   45 eval "use lib '$pg_dir/lib'"; die $@ if $@;
   46 
   47 ##########################################
   48 # allows Webservice access to WeBWorK
   49 ##########################################
   50 
   51 # eval "use WebworkWebservice";die $@ if $@;        #FIXME, is there another way to initialize this?
   52 # eval "use RQP"; die $@ if $@;
   53 
   54 ##########################################
   55 
   56 $WeBWorK::SeedCE{webwork_dir} = $webwork_dir;
   57 
   58 # Between the line below and the "EOF" line are the three configuration stanzas
   59 # that are used to link Apache with WeBWorK. The following variables may be
   60 # included in directives below:
   61 #
   62 #     $webwork_url            The base URL handled by Apache::WeBWorK.
   63 #     $webwork_dir            The path to the base webwork2 directory.
   64 #     $pg_dir                 The path to the base pg directory.
   65 #
   66 #     $webwork_htdocs_url     The base URL of the WeBWorK htdocs directory.
   67 #     $webwork_htdocs_dir     The path to the WeBWorK htdocs directory.
   68 #
   69 #     $webwork_courses_url    The base URL of the WeBWorK courses directory.
   70 #     $webwork_courses_dir    The path to the WeBWorK courses directory.
   71 #
   72 # You may add additional Apache configuration directives, but keep in mind that
   73 # variable names are being interpolated (i.e. $foo, @bar).
   74 
   75 $PerlConfig = <<EOF;
   76 
   77 # Define the location that is handled by the Apache::WeBWorK module, and tell
   78 # Perl where to find the libraries Apache::WeBWorK needs to run.
   79 #
   80 
   81 <Location $webwork_url>
   82   SetHandler perl-script
   83   PerlHandler Apache::WeBWorK
   84 </Location>
   85 
   86 # Provide access to system-wide resources.
   87 #
   88 Alias $webwork_htdocs_url $webwork_htdocs_dir
   89 <Directory $webwork_htdocs_dir>
   90     Order Allow,Deny
   91     Allow from All
   92   Options FollowSymLinks
   93   AllowOverride None
   94 </Directory>
   95 
   96 # Provide access to course-specific resources.
   97 #
   98 AliasMatch $webwork_courses_url/([^/]*)/(.*) $webwork_courses_dir/\$1/html/\$2
   99 <Directory $webwork_courses_dir/*/html>
  100     Order Allow,Deny
  101     Allow from All
  102   Options FollowSymLinks
  103   AllowOverride None
  104 </Directory>
  105 
  106 EOF
  107 
  108 # The following stanzas can be uncommented to enable various experimental
  109 # WeBWorK web services. These are still in testing and have not been audited
  110 # for security.
  111 
  112 # load packages necessary for WeBWorK web services
  113 #eval "use WebworkWebservice";die $@ if $@;
  114 #eval "use RQP"; die $@ if $@;
  115 
  116 $PerlConfig .= <<EOF;
  117 
  118 ########## XMLRPC installation ##########
  119 #
  120 #<Location /mod_xmlrpc>
  121 # SetHandler perl-script
  122 # PerlHandler Apache::XMLRPC::Lite
  123 # PerlSetVar dispatch_to "WebworkXMLRPC"
  124 # PerlSetVar options "compress_threshold => 10000"
  125 # Order Allow,Deny
  126 # Allow from All
  127 #</Location>
  128 
  129 ##########  RQP installation ##########
  130 #
  131 ##<Location /rqp>
  132 ##  SetHandler perl-script
  133 ##  PerlHandler Apache::SOAP
  134 ##  PerlSetVar dispatch_to "RQP"
  135 ##  PerlSetVar options "compress_threshold => 10000"
  136 ##  Order Allow,Deny
  137 ##  Allow from All
  138 ##</Location>
  139 #<Location /rqp>
  140 # SetHandler perl-script
  141 # PerlHandler MySOAP
  142 # Order Allow,Deny
  143 # Allow from All
  144 #</Location>
  145 
  146 # SOAP installation
  147 #
  148 #<Location /mod_soap>
  149 # SetHandler perl-script
  150 # PerlHandler Apache::SOAP
  151 # PerlSetVar dispatch_to "WebworkXMLRPC"
  152 # PerlSetVar options "compress_threshold => 10000"
  153 # Order Allow,Deny
  154 # Allow from All
  155 #</Location>
  156 
  157 EOF
  158 
  159 </Perl>

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9