Forum archive 2000-2006

Arnold K. Pizer - Overview of WeBWorK system setup

Arnold K. Pizer - Overview of WeBWorK system setup

by Arnold Pizer -
Number of replies: 0
inactiveTopicOverview of WeBWorK system setup topic started 7/24/2003; 3:37:05 PM
last post 7/24/2003; 3:37:05 PM
userArnold K. Pizer - Overview of WeBWorK system setup  blueArrow
7/24/2003; 3:37:05 PM (reads: 453, responses: 0)

Overview of WeBWorK system setup

 

Where to put the WeBWorK files

The WeBWorK files can be placed almost anywhere but a reasonable location is under /usr/local/. The setup directions contained in linux.html assume this location. Despite the name, linux.html gives detailed instructions for setting up WeBWorK on any unix system. Another reasonable location is as follows. Your webserver uses two directories (often called htdocs or html and cgi-bin) under which it expects to find html documents and cgi scripts respectively. These two directories are often subdirectories of a directory called e.g. httpd. The webwork directory could be set up as a subdirectory of the httpd directory. Placing the webwork directory under /usr/local/ results in a directory structure which looks like:

 

	usr
local
webwork
system
courses
system_html
pg

 

The system, courses, system_html and pg subdirectories each contain their own files and subdirectories. The system directory contains almost all the files needed by the WeBWorK system. The courses directory contains files related to the individual WeBWorK courses. The system_html directory contains auxiliary applications, graphics, and documentation. The pg directory contains files which are shared by both WeBWorK 1.9 and the new mod_perl based WeBWorK 2.

 

The webwork directory should not be a subdirectory of the htdocs directory as you do not want anyone using the web to have direct access to any files under the webwork directory.

 

How much disk space you need depends on how large your courses are, how much temporary data you keep, whether or not you do any "housekeeping", whether for example you have WeBWorK keep an access_log which can become huge, etc. It is difficult to give general guidelines. The actual system files take up less than 5 MB. The system log files can be many many times that size. A 100 student course might have 25 MB of actual permanent data and 250 MB of temporary data. If you are setting up a system which will have a substantial number of users, we recommend you set up tmp directories for courses under a separate file system (see linux.html). Disk space is very cheap --- it is a lot better to have too much than too little.

 

How does WeBWorK interact with the webserver?

No WeBWorK files are directly accessible from the web. Rather all access is through two types of methods, one for cgi scripts and one for html files. The WeBWorK cgi directory can be accessed through either of two methods.

The first method of accessing the WeBWorK cgi directory is through a link. One cgi link gives access to all of WeBWorK's cgi scripts. Note that this requires your webserver to be set up to follow symbolic links under the cgi-bin directory. If for some reason you do not want to set up your webserver this way, we suggest you first do so on a temporary basis and get WeBWorK running. Then you can move WeBWorK's cgi directory (www/webwork/system/cgi) so that it lies under the webserver's cgi-bin directory at which point a cgi link will not be needed. Or you can use the second method which is our recommended method.

The second (and recommended) method of accessing the WeBWorK cgi directory is through (at least with Apache) a ScriptAlias directive in Apache's httpd.conf file. With this method it is not required that your webserver to be set up to follow symbolic links for cgi scripts. Note that the Apache performance tuning document mentions there is a performanace hit (probably slight) if your webserver is not configured to follow symbolic links.

There is one html link that gives access to the html files used by the WeBWorK system. In addition there is one html link for every course that gives access to the html files used by each individual WeBWorK course (this link is set up when setting up a course). Note that this requires your webserver to be set up to follow symbolic links under the htdocs directory, i.e. the html document root

Directions for configuring apache and setting up these links are given in the linux.html document.

 

What does the system setup script do?

This script is run only when you initially set up the WeBWorK system.

It modifies all the scripts entering the correct path to perl on your system.

It writes a webworkConfig.pm file and webworkInit.pm files contain the correct path to WeBWorK on your system and other configuration data. The webworkConfig.pm file is located in the .../webwork/system/lib directory and the webworkInit.pm files are located in the cgi, cgi/cgi-scripts, scripts and courseScripts directories. Each of these four directories is a subdirectory of .../webwork/system.

It sets the correct permissions and groups for all the files and directories. This is extremely tricky to get correct by hand if you want to have a functioning and secure system.

It modifies the Global.pm file entering the cgi and html WeBWorK URL's for your system. The variables defined in the Global.pm file set defaults and parameters for the whole WeBWorK system. Defaults can be over ridden for individual courses by redefining variables in the individual course webworkCourse.ph files. The Global.pm file is located in the .../webwork/system/lib directory.

 

What does the course setup script do?

This script is run every time a WeBWorK course is set up.

It sets the correct permissions and groups for all the course files and directories. Any missing files or directories are created.

It creates the webworkCourse.ph file. The variables defined in this file set defaults and parameters for the individual course. System defaults set in Global.pm can be over ridden for the individual course by redefining variables in the webworkCourse.ph file. The webworkCourse.ph file for the course mth161 is located in the .../webwork/courses/mth161 directory.

It creates a generic but functional index.html, i.e. a front page, for the course. Almost certainly, professors will want to customize this page. The index.html file for the course mth161 is located in the .../webwork/courses/mth161/html directory.

<| Post or View Comments |>