| 1 | ################################################################################ |
1 | ################################################################################ |
| 2 | # WeBWorK Online Homework Delivery System |
2 | # WeBWorK Online Homework Delivery System |
| 3 | # Copyright © 2000-2003 The WeBWorK Project, http://openwebwork.sf.net/ |
3 | # Copyright © 2000-2003 The WeBWorK Project, http://openwebwork.sf.net/ |
| 4 | # $CVSHeader: webwork-modperl/conf/webwork.apache-config.dist,v 1.1 2004/07/12 02:30:21 sh002i Exp $ |
4 | # $CVSHeader: webwork2/conf/webwork.apache-config.dist,v 1.2 2004/07/12 04:16:14 sh002i Exp $ |
| 5 | # |
5 | # |
| 6 | # This program is free software; you can redistribute it and/or modify it under |
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 |
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 |
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. |
9 | # version, or (b) the "Artistic License" which comes with this package. |
| … | |
… | |
| 18 | # support in your Apache configuration, add the following line to the end of |
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): |
19 | # your Apache configuration file (usually apache.conf or httpd.conf): |
| 20 | # |
20 | # |
| 21 | # Include /path/to/webwork.apache-config |
21 | # Include /path/to/webwork.apache-config |
| 22 | # |
22 | # |
| 23 | # Customize the variables $webwork_url, $webwork_dir, $pg_dir, etc. below to |
23 | # Customize the variable $webwork_dir below to match the location of your |
| 24 | # match your installation and preferences. |
24 | # WeBWorK installation. |
| 25 | |
|
|
| 26 | ################################################################################ |
|
|
| 27 | # WeBWorK configuration |
|
|
| 28 | ################################################################################ |
|
|
| 29 | |
25 | |
| 30 | <Perl> |
26 | <Perl> |
| 31 | |
27 | |
| 32 | # The following variables are the main configuration variables for WeBWorK. |
28 | # Set this variable to the path to your WeBWorK installation. |
| 33 | # They are used in the Apache configuration below and to seed the WeBWorK |
29 | my $webwork_dir = "/home/sh002i/work/webwork2"; |
| 34 | # configuration file global.conf. |
|
|
| 35 | |
30 | |
| 36 | my ($webwork_url, $webwork_dir, $pg_dir, $webwork_htdocs_url, |
31 | # This code reads global.conf and extracts the remaining configuration |
| 37 | $webwork_htdocs_dir, $webwork_courses_url, $webwork_courses_dir); |
32 | # variables. There is no need to modify it. |
| 38 | |
33 | eval "use lib '$webwork_dir/lib'"; die $@ if $@; |
| 39 | BEGIN { |
34 | eval "use WeBWorK::CourseEnvironment"; die $@ if $@; |
| 40 | # Root directories of WeBWorK and PG. |
35 | my $ce = new WeBWorK::CourseEnvironment({ webwork_dir => $webwork_dir }); |
| 41 | $webwork_url = "/webwork2"; |
36 | my $webwork_url = $ce->{webwork_url}; |
| 42 | $webwork_dir = "/opt/webwork2"; |
37 | my $pg_dir = $ce->{pg_dir}; |
| 43 | $pg_dir = "/opt/pg"; |
38 | my $webwork_htdocs_url = $ce->{webwork_htdocs_url}; |
| 44 | |
|
|
| 45 | # URL and path to htdocs directory. |
|
|
| 46 | $webwork_htdocs_url = "/webwork2_files"; |
|
|
| 47 | $webwork_htdocs_dir = "$webwork_dir/htdocs"; |
39 | my $webwork_htdocs_dir = $ce->{webwork_htdocs_dir}; |
| 48 | |
|
|
| 49 | # URL and path to courses directory. |
|
|
| 50 | $webwork_courses_url = "/webwork2_course_files"; |
40 | my $webwork_courses_url = $ce->{webwork_courses_url}; |
| 51 | $webwork_courses_dir = "$webwork_dir/courses"; |
41 | my $webwork_courses_dir = $ce->{webwork_courses_dir}; |
| 52 | } |
42 | eval "use lib '$pg_dir/lib'"; die $@ if $@; |
|
|
43 | $WeBWorK::SeedCE{webwork_dir} = $webwork_dir; |
| 53 | |
44 | |
| 54 | # Between the line below and the "EOF" line are the three configuration stanzas |
45 | # Between the line below and the "EOF" line are the three configuration stanzas |
| 55 | # that are used to link Apache with WeBWorK. You may add additional Apache |
46 | # that are used to link Apache with WeBWorK. The following variables may be |
| 56 | # configuration directives there, but keep in mind that variable names are being |
47 | # included in directives below: |
| 57 | # interpolated (i.e. $foo, @bar). |
48 | # |
|
|
49 | # $webwork_url The base URL handled by Apache::WeBWorK. |
|
|
50 | # $webwork_dir The path to the base webwork2 directory. |
|
|
51 | # $pg_dir The path to the base pg directory. |
|
|
52 | # |
|
|
53 | # $webwork_htdocs_url The base URL of the WeBWorK htdocs directory. |
|
|
54 | # $webwork_htdocs_dir The path to the WeBWorK htdocs directory. |
|
|
55 | # |
|
|
56 | # $webwork_courses_url The base URL of the WeBWorK courses directory. |
|
|
57 | # $webwork_courses_dir The path to the WeBWorK courses directory. |
|
|
58 | # |
|
|
59 | # You may add additional Apache configuration directives, but keep in mind that |
|
|
60 | # variable names are being interpolated (i.e. $foo, @bar). |
| 58 | |
61 | |
| 59 | $PerlConfig = <<EOF; |
62 | $PerlConfig = <<EOF; |
| 60 | |
63 | |
| 61 | # Define the location that is handled by the Apache::WeBWorK module, and tell |
64 | # Define the location that is handled by the Apache::WeBWorK module, and tell |
| 62 | # Perl where to find the libraries Apache::WeBWorK needs to run. |
65 | # Perl where to find the libraries Apache::WeBWorK needs to run. |
| … | |
… | |
| 82 | AllowOverride None |
85 | AllowOverride None |
| 83 | </Directory> |
86 | </Directory> |
| 84 | |
87 | |
| 85 | EOF |
88 | EOF |
| 86 | |
89 | |
| 87 | # No user-serviceable parts below. ;-) |
|
|
| 88 | |
|
|
| 89 | # Add library directories to include path. |
|
|
| 90 | use lib "$webwork_dir/lib"; |
|
|
| 91 | use lib "$pg_dir/lib"; |
|
|
| 92 | |
|
|
| 93 | # Share configuration variables with WeBWorK. |
|
|
| 94 | %WeBWorK::SeedCE = ( |
|
|
| 95 | webwork_url => $webwork_url, |
|
|
| 96 | webwork_dir => $webwork_dir, |
|
|
| 97 | pg_dir => $pg_dir, |
|
|
| 98 | webwork_htdocs_url => $webwork_htdocs_url, |
|
|
| 99 | webwork_htdocs_dir => $webwork_htdocs_dir, |
|
|
| 100 | webwork_courses_url => $webwork_courses_url, |
|
|
| 101 | webwork_courses_dir => $webwork_courses_dir, |
|
|
| 102 | ); |
|
|
| 103 | |
|
|
| 104 | </Perl> |
90 | </Perl> |