Parent Directory
|
Revision Log
updates merged from Trunk
1 ################################################################################ 2 # WeBWorK Online Homework Delivery System 3 # Copyright © 2000-2010 The WeBWorK Project, http://openwebwork.sf.net/ 4 # 5 # This program is free software; you can redistribute it and/or modify it under 6 # the terms of either: (a) the GNU General Public License as published by the 7 # Free Software Foundation; either version 2, or (at your option) any later 8 # version, or (b) the "Artistic License" which comes with this package. 9 # 10 # This program is distributed in the hope that it will be useful, but WITHOUT 11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 12 # FOR A PARTICULAR PURPOSE. See either the GNU General Public License or the 13 # Artistic License for more details. 14 ################################################################################ 15 16 # This file configures Apache to handle requests for WeBWorK. To install WeBWorK 17 # support in your Apache configuration, add the following line to the end of 18 # your Apache configuration file (usually apache.conf or httpd.conf): 19 # 20 # Include /path/to/webwork.apache2-config 21 # 22 # Customize the variable $webwork_dir below to match the location of your 23 # WeBWorK installation. 24 # 25 # ATTENTION APACHE 2.2 USERS: There is a bug in mod_perl 2.0.2 that prevents the 26 # FollowSymlinksOption from working when specified 27 # in a <Perl> section. See below for workaround. 28 29 30 # Uncomment the ScriptAliasMatch to allow access to show-source.cgi 31 # This allows the "show source" button to work for demonstration "courses" 32 # See for example Davide Cervone's Knoxville lectures on math objects 33 # It requires that a show-source.cgi script be customized and placed in 34 # the myCourse/html directory of the course 35 # The "show source" button is most useful for webwork "courses" used to train new authors 36 # It is not desirable to expose the code of regular homework questions to students 37 38 ScriptAliasMatch /webwork2_course_files/([^/]*)/show-source.cgi/(.*) /opt/webwork/courses/$1/html/show-source.cgi/$2 39 40 41 42 PerlModule mod_perl2 43 44 <Perl> 45 46 ################################################################# 47 # Set this variable to the path to your WeBWorK installation. 48 ################################################################# 49 50 my $webwork_dir = "/opt/webwork/webwork2"; 51 # Cache this value for use by other scripts not necessarily in the Apache2 hierarchy 52 # Different scripts use different locations :-) 53 54 $ENV{WEBWORK_ROOT} = $webwork_dir; 55 $WeBWorK::SeedCE{webwork_dir} = $webwork_dir; 56 $WeBWorK::Constants::WEBWORK_DIRECTORY = $webwork_dir; 57 58 59 ################################################################# 60 # The following code reads global.conf and extracts the remaining configuration 61 # variables. There is no need to modify it. 62 ################################################################# 63 64 # link to WeBWorK code libraries 65 eval "use lib '$webwork_dir/lib'"; die $@ if $@; 66 eval "use WeBWorK::CourseEnvironment"; die $@ if $@; 67 68 # grab course environment (by reading webwork2/conf/global.conf) 69 my $ce = new WeBWorK::CourseEnvironment({ webwork_dir => $webwork_dir }); 70 71 # set important configuration variables (from global.conf) 72 73 my $webwork_url = $ce->{webwork_url}; # e.g. /webwork2 74 my $pg_dir = $ce->{pg_dir}; # e.g. /opt/webwork/pg 75 my $webwork_htdocs_url = $ce->{webwork_htdocs_url}; # e.g. /webwork2_files 76 my $webwork_htdocs_dir = $ce->{webwork_htdocs_dir}; # e.g. /opt/webwork/webwork2/htdocs 77 my $webwork_courses_url = $ce->{webwork_courses_url}; # e.g. /webwork2_course_files 78 my $webwork_courses_dir = $ce->{webwork_courses_dir}; # e.g. /opt/webwork/courses 79 80 81 ################################################################# 82 # report server setup when child process starts up -- for example when restarting the server 83 ################################################################# 84 print "webwork.apache2-config: WeBWorK server is starting\n"; 85 print "webwork.apache2-config: WeBWorK root directory set to $webwork_dir in webwork2/conf/webwork.apache2-config\n"; 86 print "webwork.apache2-config: The following locations and urls are set in webwork2/conf/global.conf\n"; 87 print "webwork.apache2-config: PG root directory set to $pg_dir\n"; 88 print "webwork.apache2-config: WeBWorK server userID is ", $ce->{server_userID}, "\n"; 89 print "webwork.apache2-config: WeBWorK server groupID is ", $ce->{server_groupID}, "\n"; 90 print "webwork.apache2-config: The webwork url on this site is ", $ce->{server_root_url},"$webwork_url\n"; 91 92 93 # link to PG code libraries 94 eval "use lib '$pg_dir/lib'"; die $@ if $@; 95 96 require Apache::WeBWorK; # force compilation of pretty much everything 97 98 99 # At this point, the following configuration variables should be present for use 100 # in wiring WeBWorK into Apache: 101 # 102 # $webwork_url The base URL handled by Apache::WeBWorK. 103 # $webwork_dir The path to the base webwork2 directory. 104 # $pg_dir The path to the base pg directory. 105 # 106 # $webwork_htdocs_url The base URL of the WeBWorK htdocs directory. 107 # $webwork_htdocs_dir The path to the WeBWorK htdocs directory. 108 # 109 # $webwork_courses_url The base URL of the WeBWorK courses directory. 110 # $webwork_courses_dir The path to the WeBWorK courses directory. 111 112 # Define the location that is handled by the Apache::WeBWorK module, and tell 113 # Perl where to find the libraries Apache::WeBWorK needs to run. 114 # 115 $Location{$webwork_url} = { 116 SetHandler => "perl-script", 117 PerlHandler => "Apache::WeBWorK", 118 }; 119 120 # Provide access to system-wide resources. 121 # 122 push @Alias, [ $webwork_htdocs_url => $webwork_htdocs_dir ]; 123 $Directory{$webwork_htdocs_dir} = { 124 Order => "allow,deny", 125 Allow => "from all", 126 # APACHE 2.2 USERS: comment out the following line. 127 Options => "FollowSymLinks", 128 AllowOverride => "none", 129 }; 130 131 # Provide access to course-specific resources. 132 # 133 push @AliasMatch, [ "$webwork_courses_url/([^/]*)/(.*)", "$webwork_courses_dir/\$1/html/\$2" ]; 134 $Directory{"$webwork_courses_dir/*/html"} = { 135 Order => "allow,deny", 136 Allow => "from all", 137 # APACHE 2.2 USERS: comment out the following line. 138 Options => "FollowSymLinks", 139 AllowOverride => "none", 140 }; 141 142 # If WeBWorK is on the root, exempt the static directories from being handled 143 # by Apache::WeBWorK. 144 # 145 if ($webwork_url eq "") { 146 $Location{$webwork_courses_url} = { SetHandler => "none" }; 147 $Location{$webwork_htdocs_url} = { SetHandler => "none" }; 148 } 149 150 </Perl> 151 152 #################################################################### 153 # WebworkSOAP handlers (for integration with moodle) 154 #################################################################### 155 PerlModule WebworkSOAP 156 157 # WEBWORK SOAP CONFIGURATION 158 <Location /webwork2_rpc> 159 PerlHandler Apache2::SOAP 160 SetHandler perl-script 161 PerlSetVar dispatch_to "WebworkSOAP" 162 PerlSetVar options "compress_threshold => 10000" 163 Order Allow,Deny 164 Allow from All 165 </Location> 166 167 #################################################################### 168 # WebworkSOAP WSDL HANDLER :: TO BE REPLACED WITH A FILE FOR PRODUCTION SERVERS 169 #################################################################### 170 <Location /webwork2_wsdl> 171 PerlSetVar dispatch_to "WebworkSOAP::WSDL" 172 PerlSetVar options "compress_threshold => 10000" 173 PerlHandler WebworkSOAP::WSDL 174 SetHandler perl-script 175 Order Allow,Deny 176 Allow from All 177 </Location> 178 179 180 #################################################################### 181 # WebworkWebservice handlers -- for integration with external editor 182 #################################################################### 183 184 185 ########### WebworkWebservice XMLRPC handler ########## 186 187 PerlModule WebworkWebservice 188 189 <Location /mod_xmlrpc> 190 SetHandler perl-script 191 PerlHandler Apache::XMLRPC::Lite 192 PerlSetVar dispatch_to "WebworkXMLRPC" 193 PerlSetVar options "compress_threshold => 10000" 194 Order Allow,Deny 195 Allow from All 196 </Location> 197 198 199 200 ########## WebworkWebservice SOAP handler ########## 201 202 #PerlModule WebworkWebservice 203 # 204 #<Location /mod_soap> 205 # SetHandler perl-script 206 # PerlHandler Apache::SOAP 207 # PerlSetVar dispatch_to "WebworkXMLRPC" 208 # PerlSetVar options "compress_threshold => 10000" 209 # Order Allow,Deny 210 # Allow from All 211 #</Location> 212 213 #################################################################### 214 # WebworkSOAP "bridge2" handler 215 #################################################################### 216 217 # Include /opt/webwork/wwqs/conf/problemserver.apache-config
| aubreyja at gmail dot com | ViewVC Help |
| Powered by ViewVC 1.0.9 |