| … | |
… | |
| 54 | # $webwork_htdocs_url The base URL of the WeBWorK htdocs directory. |
54 | # $webwork_htdocs_url The base URL of the WeBWorK htdocs directory. |
| 55 | # $webwork_htdocs_dir The path to the WeBWorK htdocs directory. |
55 | # $webwork_htdocs_dir The path to the WeBWorK htdocs directory. |
| 56 | # |
56 | # |
| 57 | # $webwork_courses_url The base URL of the WeBWorK courses directory. |
57 | # $webwork_courses_url The base URL of the WeBWorK courses directory. |
| 58 | # $webwork_courses_dir The path to the WeBWorK courses directory. |
58 | # $webwork_courses_dir The path to the WeBWorK courses directory. |
| 59 | # |
|
|
| 60 | # You may add additional Apache configuration directives, but keep in mind that |
|
|
| 61 | # variable names are being interpolated (i.e. $foo, @bar). |
|
|
| 62 | |
|
|
| 63 | $PerlConfig = <<EOF; |
|
|
| 64 | |
59 | |
| 65 | # Define the location that is handled by the Apache::WeBWorK module, and tell |
60 | # Define the location that is handled by the Apache::WeBWorK module, and tell |
| 66 | # Perl where to find the libraries Apache::WeBWorK needs to run. |
61 | # Perl where to find the libraries Apache::WeBWorK needs to run. |
| 67 | # |
62 | # |
| 68 | <Location $webwork_url> |
63 | $Location{$webwork_url} = { |
| 69 | SetHandler perl-script |
64 | SetHandler => "perl-script", |
| 70 | PerlHandler Apache::WeBWorK |
65 | PerlHandler => "Apache::WeBWorK", |
| 71 | </Location> |
66 | }; |
| 72 | |
67 | |
| 73 | # Provide access to system-wide resources. |
68 | # Provide access to system-wide resources. |
| 74 | # |
69 | # |
| 75 | Alias $webwork_htdocs_url $webwork_htdocs_dir |
70 | push @Alias, [ $webwork_htdocs_url => $webwork_htdocs_dir ]; |
| 76 | <Directory $webwork_htdocs_dir> |
71 | $Directory{$webwork_htdocs_dir} = { |
| 77 | Order Allow,Deny |
72 | Order => "allow,deny", |
| 78 | Allow from All |
73 | Allow => [qw/from all/], |
| 79 | Options FollowSymLinks |
74 | Options => "FollowSymLinks", |
| 80 | AllowOverride None |
75 | AllowOverride => "None", |
| 81 | </Directory> |
76 | }; |
| 82 | |
77 | |
| 83 | # Provide access to course-specific resources. |
78 | # Provide access to course-specific resources. |
| 84 | # |
79 | # |
| 85 | AliasMatch $webwork_courses_url/([^/]*)/(.*) $webwork_courses_dir/\$1/html/\$2 |
80 | push @AliasMatch, [ "$webwork_courses_url/([^/]*)/(.*)", "$webwork_courses_dir/\$1/html/\$2" ]; |
| 86 | <Directory $webwork_courses_dir/*/html> |
81 | $Directory{"$webwork_courses_dir/*/html"} = { |
| 87 | Order Allow,Deny |
82 | Order => "allow,deny", |
| 88 | Allow from All |
83 | Allow => [qw/from all/], |
| 89 | Options FollowSymLinks |
84 | Options => "FollowSymLinks", |
| 90 | AllowOverride None |
85 | AllowOverride => "None", |
| 91 | </Directory> |
86 | }; |
| 92 | |
87 | |
| 93 | EOF |
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 | } |
| 94 | |
95 | |
| 95 | # The following stanzas can be uncommented to enable various experimental |
96 | # The following stanzas can be uncommented to enable various experimental |
| 96 | # WeBWorK web services. These are still in testing and have not been audited |
97 | # WeBWorK web services. These are still in testing and have not been audited |
| 97 | # for security. |
98 | # for security. |
| 98 | |
99 | |