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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5319 - (download) (annotate)
Mon Aug 13 22:59:59 2007 UTC (5 years, 9 months ago) by sh002i
File size: 4622 byte(s)
updated copyright dates

    1 ################################################################################
    2 # WeBWorK Online Homework Delivery System
    3 # Copyright © 2000-2007 The WeBWorK Project, http://openwebwork.sf.net/
    4 # $CVSHeader: webwork2/conf/webwork.apache2-config.dist,v 1.11 2007/08/10 01:02:17 sh002i 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.apache2-config
   22 #
   23 # Customize the variable $webwork_dir below to match the location of your
   24 # WeBWorK installation.
   25 #
   26 # ATTENTION APACHE 2.2 USERS: There is a bug in mod_perl 2.0.2 that prevents the
   27 #                             FollowSymlinksOption from working when specified
   28 #                             in a <Perl> section. See below for workaround.
   29 
   30 PerlModule mod_perl2
   31 
   32 <Perl>
   33 
   34 # Set this variable to the path to your WeBWorK installation.
   35 my $webwork_dir = "/opt/webwork/webwork2";
   36 
   37 # This code reads global.conf and extracts the remaining configuration
   38 # variables. There is no need to modify it.
   39 eval "use lib '$webwork_dir/lib'"; die $@ if $@;
   40 eval "use WeBWorK::CourseEnvironment"; die $@ if $@;
   41 my $ce = new WeBWorK::CourseEnvironment({ webwork_dir => $webwork_dir });
   42 my $webwork_url = $ce->{webwork_url};
   43 my $pg_dir = $ce->{pg_dir};
   44 my $webwork_htdocs_url = $ce->{webwork_htdocs_url};
   45 my $webwork_htdocs_dir = $ce->{webwork_htdocs_dir};
   46 my $webwork_courses_url = $ce->{webwork_courses_url};
   47 my $webwork_courses_dir = $ce->{webwork_courses_dir};
   48 eval "use lib '$pg_dir/lib'"; die $@ if $@;
   49 
   50 require Apache::WeBWorK; # force compilation of pretty much everything
   51 
   52 $WeBWorK::SeedCE{webwork_dir} = $webwork_dir;
   53 
   54 # At this point, the following configuration variables should be present for use
   55 # in wiring WeBWorK into Apache:
   56 #
   57 #     $webwork_url            The base URL handled by Apache::WeBWorK.
   58 #     $webwork_dir            The path to the base webwork2 directory.
   59 #     $pg_dir                 The path to the base pg directory.
   60 #
   61 #     $webwork_htdocs_url     The base URL of the WeBWorK htdocs directory.
   62 #     $webwork_htdocs_dir     The path to the WeBWorK htdocs directory.
   63 #
   64 #     $webwork_courses_url    The base URL of the WeBWorK courses directory.
   65 #     $webwork_courses_dir    The path to the WeBWorK courses directory.
   66 
   67 # Define the location that is handled by the Apache::WeBWorK module, and tell
   68 # Perl where to find the libraries Apache::WeBWorK needs to run.
   69 #
   70 $Location{$webwork_url} = {
   71   SetHandler => "perl-script",
   72   PerlHandler => "Apache::WeBWorK",
   73 };
   74 
   75 # Provide access to system-wide resources.
   76 #
   77 push @Alias, [ $webwork_htdocs_url => $webwork_htdocs_dir ];
   78 $Directory{$webwork_htdocs_dir} = {
   79   Order => "allow,deny",
   80   Allow => "from all",
   81   # APACHE 2.2 USERS: comment out the following line.
   82   Options => "FollowSymLinks",
   83   AllowOverride => "none",
   84 };
   85 
   86 # Provide access to course-specific resources.
   87 #
   88 push @AliasMatch, [ "$webwork_courses_url/([^/]*)/(.*)", "$webwork_courses_dir/\$1/html/\$2" ];
   89 $Directory{"$webwork_courses_dir/*/html"} = {
   90   Order => "allow,deny",
   91   Allow => "from all",
   92   # APACHE 2.2 USERS: comment out the following line.
   93   Options => "FollowSymLinks",
   94   AllowOverride => "none",
   95 };
   96 
   97 # If WeBWorK is on the root, exempt the static directories from being handled
   98 # by Apache::WeBWorK.
   99 #
  100 if ($webwork_url eq "") {
  101   $Location{$webwork_courses_url} = { SetHandler => "none" };
  102   $Location{$webwork_htdocs_url} = { SetHandler => "none" };
  103 }
  104 
  105 </Perl>
  106 
  107 # APACHE 2.2 USERS: uncomment the following lines and customize the paths.
  108 # The path for this block should be $webwork_htdocs_dir.
  109 #<Directory /opt/webwork/webwork2/htdocs>
  110 #    Options FollowSymLinks
  111 #</Directory>
  112 # The path for this block should be $webwork_courses_dir, followed by "/*/html".
  113 #<Directory /opt/webwork/courses/*/html>
  114 #    Options FollowSymLinks
  115 #</Directory>
  116 

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9