Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/mgage/webwork2
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Aubrey committed Feb 28, 2012
2 parents c4fdd04 + 7fed2ad commit 911bd2c
Show file tree
Hide file tree
Showing 19 changed files with 1,377 additions and 117 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.svn
.DS_Store
.*
*.save
htdocs/tmp/*
tmp/*
logs/*
Expand Down
34 changes: 34 additions & 0 deletions conf/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Use the prelocal.conf and postlocal.conf files to make modifications.

The prelocal.conf file is read before the global.conf.dist file is processed. Non-local variables in this file
are then available for use in global.conf.dist.

The postlocal.conf file is read after the global.conf.dist file is processed and will overright configurations in global.conf.dist

This new configuration system should greatly simplify the process of
updating webwork2 since it is less likely
that one will need to modify the config files when upgrading. Default configurations or permissions for
new features will be defined in global.conf.dist and will allow automatic upgrades.

Overrides for these new features can be added later to postlocal.conf

FIRST TIME RECONFIGURATION

COPY prelocal.conf.dist to prelocal.conf.
COPY postlocal.conf.dist to postlocal.conf.

MODIFY prelocal.conf using the data from your global.conf file.
In particular you will need to fill in the server name, the
password for the database and any modifications you have made as to the
location of the temporary files directory. Notice that the location of the temporary files directory
is used to define several other related subdirectories, so this modification needs to be made
in prelocal.conf BEFORE the standard global.conf.dist file is read.

RENAME global.conf to global.save in order to make sure that the global.conf.dist is read.
Otherwise the global.conf file will be read instead of global.conf.dist and the behavior will be
as with the old system.

INSPECT and possibly modify postlocal.conf to add any further local modifications that you had
made to your global.conf file.


144 changes: 59 additions & 85 deletions conf/global.conf.dist
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,13 @@
# addition, the $courseName variable holds the name of the current course.

################################################################################
# Seed variables
################################################################################

# Set these variables to correspond to your configuration and preferences. You
# will need to restart the webserver to reset the variables in this section.

# URL of WeBWorK handler. If WeBWorK is to be on the web server root, use "". Note
# that using "" may not work so we suggest sticking with "/webwork2".
$webwork_url = "/webwork2";


$server_root_url = ""; # e.g. http://webwork.yourschool.edu
$server_userID = ""; # e.g. www-data
$server_groupID = ""; # e.g. wwdata


# In the apache configuration file (often called httpd.conf) you will find
# User wwadmin --- this is the $server_userID -- of course it may be wwhttpd or some other name
# Group wwdata --- this is the $server_groupID -- this will have different names also
include("conf/prelocal.conf");

################################################################################
# prelocal.conf should contain basic information about
# certain directories on your server
################################################################################
# Root directory of PG.
$pg_dir = "/opt/webwork/pg";

Expand All @@ -56,47 +43,6 @@ $webwork_htdocs_dir = "$webwork_dir/htdocs";
$webwork_courses_url = "/webwork2_course_files";
$webwork_courses_dir = "/opt/webwork/courses"; #(a typical place to put the course directory

################################################################################
# Paths to external programs
################################################################################

# system utilities
$externalPrograms{mv} = "/bin/mv";
$externalPrograms{cp} = "/bin/cp";
$externalPrograms{rm} = "/bin/rm";
$externalPrograms{mkdir} = "/bin/mkdir";
$externalPrograms{tar} = "/bin/tar";
$externalPrograms{gzip} = "/bin/gzip";

# equation rendering/hardcopy utiltiies
$externalPrograms{latex} = "/usr/bin/latex";
$externalPrograms{pdflatex} = "/usr/bin/pdflatex --shell-escape";
$externalPrograms{dvipng} = "/usr/bin/dvipng";
$externalPrograms{tth} = "/usr/bin/tth";

####################################################
# NetPBM - basic image manipulation utilities
# Most sites only need to configure $netpbm_prefix.
####################################################
my $netpbm_prefix = "/usr/bin";
$externalPrograms{giftopnm} = "$netpbm_prefix/giftopnm";
$externalPrograms{ppmtopgm} = "$netpbm_prefix/ppmtopgm";
$externalPrograms{pnmtops} = "$netpbm_prefix/pnmtops";
$externalPrograms{pnmtopng} = "$netpbm_prefix/pnmtopng";
$externalPrograms{pngtopnm} = "$netpbm_prefix/pngtopnm";

# url checker
$externalPrograms{checkurl} = "/usr/bin/lwp-request -d -mHEAD "; # or "/usr/local/bin/w3c -head "

# image conversions utiltiies
# the source file is given on stdin, and the output expected on stdout.
$externalPrograms{gif2eps} = "$externalPrograms{giftopnm} | $externalPrograms{ppmtopgm} | $externalPrograms{pnmtops} -noturn 2>/dev/null";
$externalPrograms{png2eps} = "$externalPrograms{pngtopnm} | $externalPrograms{ppmtopgm} | $externalPrograms{pnmtops} -noturn 2>/dev/null";
$externalPrograms{gif2png} = "$externalPrograms{giftopnm} | $externalPrograms{pnmtopng}";

# mysql clients
$externalPrograms{mysql} = "/usr/bin/mysql";
$externalPrograms{mysqldump} = "/usr/bin/mysqldump";

################################################################################
# Mail settings
Expand Down Expand Up @@ -178,6 +124,11 @@ $mail{editor_window_columns} = 100;
# Customizing the action of the "Email your instructor" button
###################################################

# This is best done by copying the lines below, entering them
# in the postlocal.conf file and making the desired modifications.
# Then you will not need to update these modifications
# when you download a new version of WeBWorK.

# Use this to customize the text of the feedback button.
$feedback_button_name = "Email instructor";

Expand Down Expand Up @@ -263,8 +214,11 @@ $webworkDirs{htdocs} = "$webwork_htdocs_dir" || "$webworkDirs{root}/htdoc
$webworkURLs{htdocs} = "$webwork_htdocs_url";

# Location of web-accessible temporary files, such as equation images.
$webworkDirs{htdocs_temp} = "$webworkDirs{htdocs}/tmp";
$webworkURLs{htdocs_temp} = "$webworkURLs{htdocs}/tmp";
# These two should be set in prelocal.conf -- not here since this can be overwritten by new versions.
$webworkDirs{htdocs_temp} = (defined $webworkDirs{htdocs_temp} ) ? $webworkDirs{htdocs_temp} :"$webworkDirs{htdocs}/tmp";
$webworkURLs{htdocs_temp} = (defined $webworkURLs{htdocs_temp} ) ? $webworkURLs{htdocs_temp} :"$webworkURLs{htdocs}/tmp";

#$webworkURLs{htdocs_temp} = "$webworkURLs{htdocs}/tmp";

# Location of cached equation images.
$webworkDirs{equationCache} = "$webworkDirs{htdocs_temp}/equations";
Expand Down Expand Up @@ -498,20 +452,18 @@ $default_status = "Enrolled";
# GRANT SELECT ON webwork.* TO webworkRead@localhost IDENTIFIED BY 'passwordRO';
# GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, INDEX, LOCK TABLES ON webwork.* TO webworkWrite@localhost IDENTIFIED BY 'passwordRW';

$database_dsn = "dbi:mysql:webwork";
$database_username = "webworkWrite";
$database_password = "";
$database_debug = 0;
################################################################################
# set these variables in prelocal.conf
#
# $database_dsn = "dbi:mysql:webwork";
# $database_username = "webworkWrite";
# #$database_password = ""; #set this in prelocal.conf
################################################################################

# Variables for sql_moodle database layout.
$moodle_dsn = "dbi:mysql:moodle";
$moodle_username = $database_username;
$moodle_password = $database_password;
$moodle_table_prefix = "mdl_";
$moodle17 = 0;
# $database_debug = 0;

# Several database are defined in the file conf/database.conf and stored in the
# hash %dbLayouts.
# Database schemas are defined in the file conf/database.conf and stored in the
# hash %dbLayouts. The standard schema is called "sql_single";
include "conf/database.conf";

# Select the default database layout. This can be overridden in the course.conf
Expand Down Expand Up @@ -547,8 +499,6 @@ $problemLibrary_db = {
# Logs
################################################################################

# FIXME: take logs out of %webworkFiles/%courseFiles and give them their own
# top-level hash.

# Logs data about how long it takes to process problems. (Do not confuse this
# with the /other/ timing log which can be set by WeBWorK::Timing and is used
Expand Down Expand Up @@ -576,7 +526,7 @@ $courseFiles{logs}{login_log} = "$courseDirs{logs}/login.log";
$courseFiles{logs}{activity_log} = '';

################################################################################
# Site defaults (FIXME: what other things could be "site defaults"?)
# Site defaults (Usually overridden in postlocal.conf)
################################################################################

# Set the default timezone of courses on this server. To get a list of valid
Expand Down Expand Up @@ -616,7 +566,7 @@ $siteDefaults{default_templates_course} ="modelCourse";
# current database layout is found.
#
$authen{user_module} = {
sql_moodle => "WeBWorK::Authen::Moodle",
# sql_moodle => "WeBWorK::Authen::Moodle",
# sql_ldap => "WeBWorK::Authen::LDAP",
"*" => "WeBWorK::Authen",
};
Expand All @@ -627,15 +577,12 @@ $authen{user_module} = {
#
$authen{proctor_module} = "WeBWorK::Authen::Proctor";

################################################################################
# Options for particular authentication modules
################################################################################

# $authen{moodle_options} = {
# dsn => $moodle_dsn,
# username => $moodle_username,
# password => $moodle_password,
# table_prefix => $moodle_table_prefix,
# moodle17 => $moodle17,
# };
# If you are using ldap this next snippet should be copied and entered into postlocal.conf.
# Make modifications there so that it works with your local LDAP protocol

$authen{ldap_options} = {
# hosts to attempt to connect to, in order. For example:
Expand Down Expand Up @@ -686,7 +633,7 @@ $authen{ldap_options} = {
};

################################################################################
# Authorization system
# Authorization system (Make local overrides in postlocal.conf )
################################################################################

# this section lets you define which groups of users can perform which actions.
Expand All @@ -703,6 +650,7 @@ $authen{ldap_options} = {
grade_proctor => 3,
ta => 5,
professor => 10,
admin => 20,
);

# this hash maps operations to the roles that are allowed to perform those
Expand Down Expand Up @@ -1082,3 +1030,29 @@ $webworkRoot = $webworkDirs{root};
$webworkURLRoot = $webworkURLs{root};
$pgRoot = $pg{directories}{root};

################################################################################
# Temporary hack for displaying the different versions of the editors
################################################################################
# These behaviors can be overridden in postlocal.conf
# These configurations can be placed in CourseConfig to tune the behavior for individual courses
%showeditors = (
classlisteditor1 => 1,
classlisteditor2 => 0,

homeworkseteditor1 => 1,
homeworkseteditor2 => 0,

librarybrowser1 => 1,
librarybrowser2 => 0,
librarybrowser3 => 1,

pgproblemeditor1 => 1,
pgproblemeditor2 => 0,
);
################################################################################
# Site wide overrides are entered into the file postlocal.conf
################################################################################

include("conf/postlocal.conf");

1; #final line of the file to reassure perl that it was read properly.
Loading

0 comments on commit 911bd2c

Please sign in to comment.