From: Jeff H. <jj...@vi...> - 2007-07-24 11:25:04
|
Please ignore my last post. The cvs up happened to coincide with something dumb that I did that was actually causing the problem I was observing. Best regards, Jeff Jeff Holt wrote: > Hi Sam, > > Regarding this note, can you be a bit more explicit about what changes > need to be made to > > webwork.apache2-config and global.conf > > I cvs up'ed and can no longer see the local problem sets. > > Sorry for the low-level question. > > Thanks > > --Jeff > > Sam Hathaway via activitymail wrote: > >> Log Message: >> ----------- >> PLEASE READ -- APACHE CONFIG CHANGES! >> >> This patch makes webwork.apache2-config static (no <Perl> sections) and >> passes changes into WeBWorK via PerlSetVar directives. The course >> environment (global.conf) is seeded from these variables. Also changes >> pg_dir to webwork_pg_dir, so all seed variables start with "webwork_". >> >> So update your webwork.apache2-config and global.conf files! :) >> >> Modified Files: >> -------------- >> webwork2/conf: >> global.conf.dist >> webwork.apache2-config.dist >> webwork2/lib: >> WeBWorK.pm >> webwork2/lib/WeBWorK: >> CourseEnvironment.pm >> Request.pm >> >> Revision Data >> ------------- >> Index: webwork.apache2-config.dist >> =================================================================== >> RCS file: /webwork/cvs/system/webwork2/conf/webwork.apache2-config.dist,v >> retrieving revision 1.8 >> retrieving revision 1.9 >> diff -Lconf/webwork.apache2-config.dist -Lconf/webwork.apache2-config.dist -u -r1.8 -r1.9 >> --- conf/webwork.apache2-config.dist >> +++ conf/webwork.apache2-config.dist >> @@ -18,89 +18,68 @@ >> # support in your Apache configuration, add the following line to the end of >> # your Apache configuration file (usually apache.conf or httpd.conf): >> # >> -# Include /path/to/webwork.apache-config >> +# Include /path/to/webwork.apache2-config >> # >> -# Customize the variable $webwork_dir below to match the location of your >> -# WeBWorK installation. >> +# Please read throught this file if you are not using the default paths or want >> +# to use non-standard URLs. >> >> -PerlModule mod_perl2 >> - >> -<Perl> >> - >> -my $webwork_dir = "/opt/webwork/webwork2"; >> - >> -eval "use lib '$webwork_dir/lib'"; die $@ if $@; >> -eval "use WeBWorK::CourseEnvironment"; die $@ if $@; >> - >> -my $ce = new WeBWorK::CourseEnvironment({ webwork_dir => $webwork_dir }); >> -my $webwork_url = $ce->{webwork_url}; >> -my $pg_dir = $ce->{pg_dir}; >> -my $webwork_htdocs_url = $ce->{webwork_htdocs_url}; >> -my $webwork_htdocs_dir = $ce->{webwork_htdocs_dir}; >> -my $webwork_courses_url = $ce->{webwork_courses_url}; >> -my $webwork_courses_dir = $ce->{webwork_courses_dir}; >> -eval "use lib '$pg_dir/lib'"; die $@ if $@; >> - >> -eval "use WeBWorK::PG::ImageGenerator"; die $@ if $@; >> -$WeBWorK::SeedCE{webwork_dir} = $webwork_dir; >> -$ENV{WEBWORK_ROOT} = $webwork_dir; >> +# Define the location that is handled by the Apache::WeBWorK module. >> +# >> +PerlSetVar webwork_dir /opt/webwork/webwork2 >> +PerlSetVar webwork_url /webwork2 >> +<Location /webwork2> >> + PerlHandler Apache::WeBWorK >> + SetHandler perl-script >> + Options FollowSymLinks >> + AllowOverride None >> + Order Allow,Deny >> + Allow from all >> +</Location> >> >> -</Perl> >> +# Provide access to system-wide resources. >> +# >> +PerlSetVar webwork_htdocs_dir /opt/webwork/webwork2/htdocs >> +PerlSetVar webwork_htdocs_url /webwork2_files >> +Alias /webwork2_files /opt/webwork/webwork2/htdocs >> +<Location /webwork2_files> >> + SetHandler None >> +</Location> >> +<Directory /opt/webwork/webwork2/htdocs> >> + Options FollowSymLinks >> + AllowOverride None >> + Order Allow,Deny >> + Allow from all >> +</Directory> >> >> +# Provide access to course-specific resources >> +# >> +PerlSetVar webwork_courses_dir /opt/webwork/courses >> +PerlSetVar webwork_courses_url /webwork2_course_files >> AliasMatch /webwork2_course_files/([^/]*)/(.*) /opt/webwork/courses/$1/html/$2 >> -Alias /webwork2_files /opt/webwork/webwork2/htdocs >> +<Location /webwork2_course_files> >> + SetHandler None >> +</Location> >> <Directory /opt/webwork/courses/*/html> >> - Allow from all >> - AllowOverride None >> + SetHandler None >> Options FollowSymLinks >> - Order allow,deny >> -</Directory> >> -<Directory /opt/webwork/webwork2/htdocs> >> - Allow from all >> AllowOverride None >> - Options FollowSymLinks >> - Order allow,deny >> + Order Allow,Deny >> + Allow from all >> </Directory> >> -<Location /webwork2> >> - PerlInitHandler Apache2::Reload >> - PerlSetVar ReloadAll Off >> - PerlSetVar ReloadModules "Apache::WeBWorK WeBWorK::*" >> - PerlHandler Apache::WeBWorK >> - SetHandler perl-script >> - #PerlFixuphandler Apache::DB >> -</Location> >> -#WEBWORK SOAP TEST CONFIGURATION >> -<Files soap.php> >> - PerlInitHandler Apache2::Reload >> - PerlSetVar ReloadAll On >> - PerlSetVar ReloadModules "WebworkSOAP WeBWorK::* WebworkSOAP::* WebworkSOAP::Classes::*" >> -</Files> >> - >> -PerlModule Apache2::Reload >> -PerlModule WebworkSOAP >> -#WEBWORK SOAP CONFIGURATION >> -<Location /webwork2_rpc> >> - PerlInitHandler Apache2::Reload >> - PerlHandler Apache::SOAP >> - SetHandler perl-script >> - PerlSetVar ReloadAll Off >> - PerlSetVar ReloadModules "WeBWorK::* WebworkSOAP WebworkSOAP::*" >> - PerlSetVar dispatch_to "WebworkSOAP" >> - PerlSetVar options "compress_threshold => 10000" >> - Order Allow,Deny >> - Allow from All >> -</Location> >> -#WEBWORK SOAP WSDL HANDLER :: TO BE REPLACED WITH A FILE FOR PRODUCTION SERVERS >> -<Location /webwork2_wsdl> >> - PerlInitHandler Apache2::Reload >> - PerlSetVar ReloadAll Off >> - PerlSetVar ReloadModules "WeBWorK::* WebworkSOAP::* WebworkSOAP" >> - PerlSetVar dispatch_to "WebworkSOAP::WSDL" >> - PerlSetVar options "compress_threshold => 10000" >> - PerlHandler WebworkSOAP::WSDL >> - SetHandler perl-script >> - Order Allow,Deny >> - Allow from All >> -</Location> >> >> +# Make additional settings available to WeBWorK. >> +# >> +PerlSetVar webwork_pg_dir /opt/webwork/pg >> + >> +# Include WeBWorK and PG lib directories. (We prefer PerlSwitches to "use lib" >> +# in a startup.pl because it prevents us from having to specify paths in two >> +# separate files.) >> +# >> +PerlSwitches -I/opt/webwork/webwork2/lib >> +PerlSwitches -I/opt/webwork/pg/lib >> + >> +# Pre-load modules. >> +# >> +PerlModule mod_perl2 >> +PerlModule Apache::WeBWorK >> >> Index: global.conf.dist >> =================================================================== >> RCS file: /webwork/cvs/system/webwork2/conf/global.conf.dist,v >> retrieving revision 1.193 >> retrieving revision 1.194 >> diff -Lconf/global.conf.dist -Lconf/global.conf.dist -u -r1.193 -r1.194 >> --- conf/global.conf.dist >> +++ conf/global.conf.dist >> @@ -34,7 +34,7 @@ >> $webwork_url = "/webwork2"; >> >> # Root directory of PG. >> -$pg_dir = "/opt/webwork/pg"; >> +$webwork_pg_dir = "/opt/webwork/pg"; >> >> # URL and path to htdocs directory. >> $webwork_htdocs_url = "/webwork2_files"; >> @@ -803,8 +803,8 @@ >> >> ##### Directories used by PG >> >> -# The root of the PG directory tree (from pg_root in Apache config). >> -$pg{directories}{root} = "$pg_dir"; >> +# The root of the PG directory tree (from webwork_pg_dir in Apache config). >> +$pg{directories}{root} = "$webwork_pg_dir"; >> $pg{directories}{lib} = "$pg{directories}{root}/lib"; >> $pg{directories}{macros} = "$pg{directories}{root}/macros"; >> >> @@ -928,3 +928,5 @@ >> $webworkRoot = $webworkDirs{root}; >> $webworkURLRoot = $webworkURLs{root}; >> $pgRoot = $pg{directories}{root}; >> +$pg_dir = $pg{directories}{root}; >> + >> Index: WeBWorK.pm >> =================================================================== >> RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK.pm,v >> retrieving revision 1.97 >> retrieving revision 1.98 >> diff -Llib/WeBWorK.pm -Llib/WeBWorK.pm -u -r1.97 -r1.98 >> --- lib/WeBWorK.pm >> +++ lib/WeBWorK.pm >> @@ -81,8 +81,9 @@ >> my $uri = $r->uri; >> my $path_info = $r->path_info | ""; >> my $args = $r->args || ""; >> - #my $webwork_root = $r->dir_config("webwork_root"); >> - #my $pg_root = $r->dir_config("pg_root"); >> + my $dir_config = $r->dir_config; >> + my %conf_vars = map { $_ => $dir_config->{$_} } grep { /^webwork_/ } keys %$dir_config; >> + @SeedCE{keys %conf_vars} = values %conf_vars; >> >> debug("\n\n===> Begin " . __PACKAGE__ . "::dispatch() <===\n\n"); >> debug("Hi, I'm the new dispatcher!\n"); >> @@ -178,7 +179,7 @@ >> my $apache_port = $r->get_server_port; >> my $apache_is_ssl = ($r->subprocess_env('https') ? 1 : ""); >> my $apache_root_url; >> - if ($r->subprocess_env('https')) { >> + if ($apache_is_ssl) { >> $apache_root_url = "https://$apache_hostname"; >> $apache_root_url .= ":$apache_port" if $apache_port != 443; >> } else { >> Index: CourseEnvironment.pm >> =================================================================== >> RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/CourseEnvironment.pm,v >> retrieving revision 1.35 >> retrieving revision 1.36 >> diff -Llib/WeBWorK/CourseEnvironment.pm -Llib/WeBWorK/CourseEnvironment.pm -u -r1.35 -r1.36 >> --- lib/WeBWorK/CourseEnvironment.pm >> +++ lib/WeBWorK/CourseEnvironment.pm >> @@ -27,7 +27,7 @@ >> $ce = WeBWorK::CourseEnvironment->new({ >> webwork_url => "/webwork2", >> webwork_dir => "/opt/webwork2", >> - pg_dir => "/opt/pg", >> + webwork_pg_dir => "/opt/pg", >> webwork_htdocs_url => "/webwork2_files", >> webwork_htdocs_dir => "/opt/webwork2/htdocs", >> webwork_courses_url => "/webwork2_course_files", >> @@ -76,7 +76,8 @@ >> =item new(ROOT URLROOT PGROOT COURSENAME) >> >> A deprecated form of the constructor in which four seed variables are given >> -explicitly: C<webwork_dir>, C<webwork_url>, C<pg_dir>, and C<courseName>. >> +explicitly: C<webwork_dir>, C<webwork_url>, C<webwork_pg_dir>, and >> +C<courseName>. >> >> =cut >> >> @@ -107,12 +108,9 @@ >> %seedVars = %{$rest[0]}; >> } else { >> debug __PACKAGE__, ": deprecated four-argument form of new() used.\n"; >> - #$seedVars{webworkRoot} = $rest[0]; >> - #$seedVars{webworkURLRoot} = $rest[1]; >> - #$seedVars{pgRoot} = $rest[2]; >> $seedVars{webwork_dir} = $rest[0]; >> $seedVars{webwork_url} = $rest[1]; >> - $seedVars{pg_dir} = $rest[2]; >> + $seedVars{webwork_pg_dir} = $rest[2]; >> $seedVars{courseName} = $rest[3]; >> } >> >> Index: Request.pm >> =================================================================== >> RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/Request.pm,v >> retrieving revision 1.9 >> retrieving revision 1.10 >> diff -Llib/WeBWorK/Request.pm -Llib/WeBWorK/Request.pm -u -r1.9 -r1.10 >> --- lib/WeBWorK/Request.pm >> +++ lib/WeBWorK/Request.pm >> @@ -176,8 +176,22 @@ >> return $self->{urlpath}; >> } >> >> +=item location() >> + >> +Overrides the location() method in Apache::Request (or Apache2::Request) so that >> +if the location is "/", the empty string is returned. >> + >> +=cut >> + >> +sub location { >> + my $self = shift; >> + my $location = $self->SUPER::location; >> + return $location eq "/" ? "" : $location; >> +} >> + >> =back >> >> =cut >> >> 1; >> + >> >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by: Splunk Inc. >> Still grepping through log files to find problems? Stop. >> Now Search log events and configuration files using AJAX and a browser. >> Download your FREE copy of Splunk now >> http://get.splunk.com/ >> _______________________________________________ >> OpenWeBWorK-CVS mailing list >> Ope...@li... >> https://lists.sf.net/lists/listinfo/openwebwork-cvs >> >> > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > OpenWeBWorK-Devel mailing list > Ope...@li... > https://lists.sf.net/lists/listinfo/openwebwork-devel > |