Installation Manual for 2.3 on SuSE 10.2
This feature was deprecated in version 2.6. For up-to-date information view Github. 9
See also: History of WeBWorK version control
These instructions cover the installation of the SUSE Linux 10.2 operating system and WeBWorK 2.3 from scratch.
They are more detailed (and offer fewer choices) than the general InstallationManualV2pt3 and are aimed at non unix experts. Readers may want to quickly scan InstallationManualV2pt3 to get an overview of the installation process and then carefully read and follow these instructions.
Contents
- 1 Notation
- 2 Installing the SUSE 10.2 Linux Operating System
- 3 Terminal Window Notation and Use
- 4 Installing Additional Software
- 5 Configuring MySQL
- 6 Reboot and Test
- 7 MySQL Security Issuses
- 8 Downloading the WeBWorK System Software and Problem Libraries
- 9 Installing WeBWorK
- 10 Configuring the Shell
- 11 Checking Module Dependancies
- 12 Configuring WeBWorK
- 13 Configuring Apache
- 14 If Something is Wrong
- 15 Create the admin Course
- 16 Starting and Stoping Apache, MySQL and the KDE desktop GUI
- 17 Install the WeBWorK Problem Libraries
- 18 Create Your First Actual Course
- 19 Where to go From Here
Notation
First some short comments on notation we will be using.
We will use <key>
to indicate that you should press a specific key (e.g.
<Enter>
, <Tab>
, <F6>
, etc.). Sometimes we will also use e.g.
<root password>
to indicate you have to enter the root password.
^
will indicate the <Ctrl>
key so e.g. ^X
is really shorthand for
<Ctrl> <X>
, i.e. press the Ctrl key and hit the X key.
We will give references to specific versions of software, e.g. httpd-2.2.4.tar.gz rather than the more general httpd-2.x.x.tar.gz. In most cases you should be able to use the latest stable version but we have only tested the versions listed.
Installing the SUSE 10.2 Linux Operating System
Installation DVD
Obtain the installation DVD/CD set. Connect to [[1]]
for information. For example you can use wxDownload Fast or BitTorrent to download an ISO image of the installation DVD and then burn your own installation DVD. If you download ISO images, make sure that you verify the integrity of the downloaded files by comparing the MD5 checksums of the downloaded files with the MD5 checksums listed at [[2]]
. wxDownload Fast automatically calculates the MD5 checksums which is convenient. These instructions will assume you have such a DVD but installing from a commercial Novell DVD/CD set or a downloaded CD set should be essentially identical.
Place the installation DVD in your DVD drive and boot your computer from the DVD drive. You may have to press <F12> during the boot process to bring up a boot menu which will allow you to select booting from the DVD. Or you may have to edit the BIOS to select the DVD as the first boot device.
You will see a list of options.
- Select
Installation
- After awhile you will see the
Language
page. SelectEnglish(US)
and clickNext
- A succession of pages follow, for each select the obvious option and click
Next
. For example my obvious options areAccept the license
,New Installation
,USA
andEastern
time zone - When you get to the
Desktop Selection
selectKDE
(not because it's better thanGNOME
but because I have to make a choice) - On the
Installation Settings
page you should be able to accept the defaults (unless you are dual booting operating systems, etc. but then you are not a novice user and you are on your own for that part) - Then click
Accept
, agree to the required licenses and then clickInstall
- Now sit back and relax while the installation takes place --- this may take around a half hour
Continue Installation
After this finishes the system will reboot (if it boots from the DVD select Boot from hard disk
). After awhile, you will get back the the installation screen.
Enter the password for the root user; as the screen says "Do not forget what you enter here". Next enter the hostname and domain name.
Next we come to Network Configuration.
- Under
Firewall
click onSSH port is blocked
and it should change toSHH port is open
- Next click on
Firewall
and thenAllowed Services
- Under
Services to Allow
selectHTTP Server
and clickAdd
- Next select
HTTPS Server
and clickAdd
- Under
Allowed Service
you should seeHTTP Server
,HTTPS Server
andSSH
- Now click
Accept
Now we configure the network. Your network interface may be set up automatically via DHCP. If this is true, you can skip the rest of this paragraph. Otherwise you will have to enter your machine's static ip address, etc. To do this
- Click on
Network Interfaces
- Then
Edit
- Check
Static Address Setup
and enter the IP Address - The
Subnet Mask
is probably OK as it but another possibility may be 255.255.0.0 - Next click on
Hostname and Name Server
and enter the required information (at a minimum you have to enter the ip address of Name Server 1) - Click
OK
and then click onRouting
and enter the ip address of your Default Gateway - Click
OK
and thenNext
andNext
again - This completes the static ip address setup
Now click on Next
to exit the Network Configuration
page. The next step tests your network setup. Just click Next
and hopefully after a short wait you will see Test Result --- Success
. If you don't see this click on View Logs
which may give you some hint as to what may be the problem.
Click Next
to move to the next page and Next
again to configure the online update server. I would suggest accepting the patches and updates. Follow the instructions. Depending on what gets updated you will have to hit Accept
and Next
several times. If this doesn't work for you Abort
, select Configure Later
and hit Next
. Note that once when I accepted the patches CPAN failed to work at all. I reinstalled SUSE and didn't accept the patches and CPAN worked. This may have been coincidental but if you have difficulties, you may want to try reinstalling SUSE without patches.
On the User Authentication Method
accept the default (Local (/etc/passwd)
) and hit Next
.
Add yourself as a user and (if you want) select Receive System Mail
and/or Automatic Login
. If you want to add additional users at this point, click on User Management
but you can always do this later. Hit Next
.
Skim the Release Notes and hit Next
. Almost certainly you will want to accept the Hardware Configuration
SUSE detects by just hitting Next
.
That's it. The initial part of the installation is finished. Click on Finish
. Assuming you selected
Automatic Login
above you will see your desktop (otherwise log into your own account).
SUSE Software Packages
Our next task is to install a number of SUSE software packages.
- Start up YaST
- Do this by clicking the SUSE toolbar's
Start
button (the green button in the lower left hand corner) - Then
Computer
andYaST (Administer Settings)
- Enter the
<root password>
- In the YaST window that opens click
Software
in the left pane and Software Managment
to the right- YaST takes a moment to inventory what you already have installed and what you can install. Then it opens a window with a search dialog selected
Now we will select the packages we need and install them.
- Next to
Filter
on the pull down menu selectSearch
(actually it should be the default selection). Entergcc
in the search box and hitSearch
- In the right panel, check
gcc
. This should give you a black check mark which means it is selected for installation. The blue check marks indicate things already installed; leave them checked. - Next enter
TeX
in the search box and hitSearch
- On the right check
te_latex
andtetex
- Enter
mysql
in the search box and hitSearch
- On the right check
mysql
andmysql-client
- Enter
cvs
in the search box and hitSearch
- On the right check
cvs
- Finally enter
perl
in the search box and hitSearch
- On the right check
perl-DBD-mysql
,perl-GD
andperl-MailTools
- Now click on
Accept
in the lower right hand corner and thenContinue
to accept Automatic Changes - Again you can relax as the packages get installed
- When you see
Install or remove more packages
clickNo
and then close the YaST window
Test Browser and Keyboard
After your desktop reappears, click on Firefox and you should be connected to the world (more precisely to [[3]]). Goto [[4]] where you can view this document and, if you want, copy commands that you need (see below).
Here's an aside on keystroke delay and repetition rate. If you are like me and find the keystroke delay too short (so that you often type "geeet" when you want to type "get"), do the following. Click the SUSE toolbar's Start
button then Favorites
, Configure Desktop (Personal Settings)
, Peripherals
, Keyboard
. Now increase the delay time interval and hit Apply
. Then close the Keyboard - Personal Settings
box.
Terminal Window Notation and Use
Before installing and configuring additional software, we need to talk about terminal windows.
To open a terminal window click the SUSE toolbar's Start
button then Favorites
and Terminal Program
In a terminal window some commands will have to be run as root whereas others should be run as a regular user. We will use # to indicate that the command is to be run as root e.g.
# perl -MCPAN -e shell
and > to indicate that the command is to be run as a normal user e.g.
> cp .bashrc .bashrc.bak1
To execute the above commands you have to hit <Enter>
. We'll just assume this.
After executing a command, often the system will respond with text (sometimes a lot of text!) which we will usually not repeat below. We only give the commands that you should execute.
The bash shell which you will be using has a number of very convenient features.
One is command and file name completion. If you are typing (e.g.
ch
) and hit <tab>
bash will complete the command or filename if it is
unambiguous (or more precisely it will complete as much as possible).
If there are multiple possibilities (as in the case of ch
) nothing will
happen and you can type more letter(s) and hit <tab>
again. Or you can
hit <tab>
a second time and you will see a list of all possible
completions. E.g. entering ch<tab><tab>
gives a list of possible
completions and ch<tab>g<tab>
(or chg<tab>
) gives chgrp
, the change group command. This
is very fast and convenient and it also leads to fewer typing errors.
Another useful shortcut is the command history. Using the up and down arrow keys will bring up previous commands which can be edited and then executed. If you are repeating a command or entering a command which is similar to a previous one, this is very useful.
You can copy commands from these instructions (with copy
from the Edit dropdown list or ^C
) and paste them into a terminal window
(with paste
from the Edit dropdown list or <Shift><Insert>
). However typing yourself using command completion is probably just as fast except if a command has a long list of options.
Finally perhaps a safer way to run commands as root
is to use the sudo
command
> sudo <command> root's password: <root password>
After you enter the password the command is executed. For a certain period (maybe 5 minutes) you can execute additional sudo
commands without reentering the <root password>
. A log of all sudo
commands is kept (I don't know where). In these instructions for the most part we will not use sudo
, but keep it in mind for other times that you have to become root
in order to execute a few commands (e.g. restarting apache
).
- As our first terminal window task open a terminal window and create a
downloads
directory where we will keep copies of downloaded software.
> mkdir downloads
Installing Additional Software
Now we have to install additional software which is unfortunately not available from the SUSE package system.
Testing Perl Modules
To test if a Perl module is installed and working on your system, issue the following command, replacing Module
with the name of the module:
> perl -MModule -e 'print "installed!\n"'
If the module is installed you will see installed!
. If not you will see at lot of gibberish. E.g. at this stage in our installation process CPAN
is installed and Module::Build
is not so
> perl -MCPAN -e 'print "installed!\n"'
yields
installed!
and
> perl -MModule::Build -e 'print "installed!\n"'
yields
Can't locate Module/Build.pm in @INC (@INC contains: /usr/lib/perl5/5.8.8/i586-linux-thread-multi /usr/lib/perl5/5.8.8 ...
Installing Additional Perl Modules from CPAN
We need to install a number of additional perl modules from CPAN.
Before we begin, as root run
> su <root password> # unset LANG # exit >
since otherwise the installation of Module::Build may fail.
First we will set up CPAN. For this you have to be root.
> su <root password> # perl -MCPAN -e shell
Since this is the first time you are using CPAN it will ask you Are you ready for manual configuration?
Respond no
and that should be it.
Next we add at least one mirror and reload the index. A list of mirrors can be found at [[5]]. To add the mirror ftp://mirrors.kernel.org/pub/CPAN and reload the index do the following
cpan> o conf urllist push ftp://mirrors.kernel.org/pub/CPAN cpan> reload index
Note that one time this failed when I tried to do it in the evening but when I tried again the next morning it worked fine. Now we update CPAN itself
cpan> install Bundle::CPAN
and always hit <Enter>
to accept the defaults when prompted. This can be a long process with many long pauses. Please be patient.
When you again see the
cpan>
prompt enter
cpan> reload cpan cpan> o conf commit
and finally
cpan> install Email::Address Mail::Sender Data::UUID String::ShellQuote XML::Parser::EasyTree
and accept all defaults by just hitting <Enter>
. Hopefully this last command will be processed very quickly as it was for me.
Next
cpan> install Bundle::Apache2 ExtUtils::XSBuilder Net::LDAP
and accept all defaults. Don't worry about problems installing SSLeay. Note that
Bundle::Apache2
and Bundle::CPAN
are not modules (rather they are bundles of modules) so you can't test if they are installed directly.
When you again see the
cpan>
prompt enter
cpan> exit
Installing Additional Perl Modules from Source
We still have one more perl module to install, the DateTime
module. At one point in time (August 2006), the installation of DateTime
using CPAN was broken. Currently (February 2007) DateTime
can be installed using CPAN. However it is useful to show you how to install perl modules from source in case one of the perl modules we installed above gets updated and its installation from CPAN becomes broken. If that happens you can follow the procedures outlined here to install the module from source.
First install DateTime
using CPAN
# perl -MCPAN -e shell cpan> install DateTime
and accept all defaults to install additional required modules. Note that the first time I tried this, the installation failed. I just repeated the command changing nothing and it succeeded --- only God knows why.
Since the DateTime
installation is so complicated you definitely should test it after exiting CPAN and becoming a normal user
cpan> exit # exit > > perl -MDateTime -e 'print "installed!\n"'
If you see
installed!
you can celebrate since all required perl modules are installed.
Now we give the example of installing DateTime
from source. Assuming the installation of DateTime
above was successful, you can skip this part.
Goto [[6]],
search for DateTime
and click on DateTime
. Then near the top right download DateTime-0.36.tar.gz
and save it to disk. Move it to your downloads
directory. Then
> cd > cd downloads > tar -zvxf DateTime-0.36.tar.gz > cd DateTime-0.36/ > perl Makefile.PL > make > make test
If make test
indicates something is missing you will have to install that. In fact in the case of DateTime
, you would see that quite a few things are missing.
DateTime
requires the additional modulesversion
,Module::Build
,Class::Singleton
,DateTime::TimeZone
andDateTime::Locale
. We could install these using CPAN
# perl -MCPAN -e shell cpan> install version Module::Build Class::Singleton DateTime::TimeZone DateTime::Locale cpan> exit # exit >
If you see anything that looks suspicious during this process, you can always test to see if the perl module in question was in fact installed. If it was not installed
try CPAN first and if CPAN fails then install it from source. The great thing about CPAN (if it works) is that it will trace down and automatically install all required components. Note that if you get a message indicating that package/file.pm
was not found, you should serach for and install package::file
since perl modules use a double colon (::
) as a directory separator.
Assuming all is OK
>su <root password> # make install # exit >
Finally you should definitely test that the module (e.g. DateTime
) was installed sucessfully
> perl -MDateTime -e 'print "installed!\n"'
If you see
installed!
you can celebrate.
TTH
WeBWorK gives students a choice of several modes for displaying typeset mathematical expressions on the web. Probably the best are the images
mode (really dvipng
) and the jsMath
mode. The asciiMath
mode (really MathML
) is getting better. An older mode is formattedTexT
(really TTH
)
which typesets TeX as HTML, using tables and other markup as a fall back display method. In order to make this available goto
[[7]], click on TTH distribution
, link to download list
and Linux executable
. Save the file to disk and then move tth_linux.tar.gz
to your downloads
directory (e.g. click on the "house" near the lower left --- this gives your home directory , then on downloads
and drag the files). Then
> cd > cd downloads > tar -zvxf tth_linux.tar.gz > cd tth_linux/ >su <root password> # cp tth /usr/bin/ # exit >
Apache 2 and mod_perl
Unfortunately I was unable to install all necessary Apache2 components when using the SUSE Apache2 and mod_perl packages. Specifically I was unable to install libapreq2
. Therefore we will install
Apache2 and mod_perl from source.
Download Apache 2.2.4 from [[8]]. You want Unix Source: httpd-2.2.4.tar.gz
. First click on the MD5
link and you will get something like
3add41e0b924d4bb53c2dee55a38c09e httpd-2.2.4.tar.gz
Save this somewhere. We will use this to verify the integrity of the downloaded file. Now download httpd-2.2.4.tar.gz
(from some apache mirror) and save it to disk.
Also goto [[9]] and download mod_perl 2.0: Version 2.03 - November 28, 2006
saving it to disk (the file name is mod_perl-2.0-current.tar.gz
).
Move these two files from the desktop to your downloads
directory (e.g. click on the "house" near the lower left --- this gives your home directory , then on downloads
and drag the files).
In the terminal window
> cd downloads
and then run
> md5sum httpd-2.2.4.tar.gz
The result should be identical to the MD5 sum you saved from the official site [[10]]. Don't use the "3add...c09e" above. It's unlikely but possible this could have been altered. If the two MD5 sums are not identical, do not proceed. Download a new copy of httpd-2.2.4.tar.gz
and test it.
Now to install Apache with mod_perl we will follow the directions at
[[11]]. After executing the individual commands below you will see a lot of output. The output will indicate if there are problems; there shouldn't be any that will affect the installation. We just indicate the commands you need to execute. Specifically do the following (make sure the window in which you are reading these instructions is wide enough to see the whole perl Makefile.PL ... prefork"
line below. This is a good line to copy and paste unless you type very carefully).
> tar -zvxf httpd-2.2.4.tar.gz > tar -zvxf mod_perl-2.0-current.tar.gz > cd mod_perl-2.0.3 > perl Makefile.PL MP_USE_STATIC=1 MP_AP_PREFIX=../httpd-2.2.4 MP_AP_CONFIGURE="--with-mpm=prefork" > make && make test > su <root password> # make install
Now you have to edit the apache configuration file httpd.conf
. You can use your favorite editor but we will give instructions assuming you are using Kwrite
. Note that you have to be root to edit httpd.conf
.
# cd /usr/local/apache2/conf
# cp httpd.conf httpd.conf.bak1
# kwrite httpd.conf
In the Kwrite
edit window search for #ServerName
and change
#ServerName www.example.com:80
to
ServerName your_server_address
E.g. I would use www.webwork.math.rochester.edu
but you have to use your own.
Now append the following to the end of the file
<Location /perl-status> SetHandler perl-script PerlHandler Apache2::Status Order deny,allow Deny from all Allow from localhost Allow from .yourschool.edu </Location>
where of course you should edit yourschool
or leave this line out entirely. Then save the file and Quit.
In your terminal window you will probably have to ^C
to get back to the #
prompt
Just to be sure you changed what you wanted do run
# diff httpd.conf httpd.conf.bak1
If all is well (i.e. diff reports the changes you made and only those) start Apache
# /usr/local/apache2/bin/apachectl start # exit >
Now test your server by starting a new Firefox session (note I had to close all Firefox windows and start a new Firefox session for this to work) on your machine and connecting to "http://localhost/" and/or connecting to your server from a browser on a remote machine. You should see the page It works! indicating that apache is running.
Further test Apache by connecting to "http://localhost/perl-status" using a browser on your machine and you will see a page listing various information about mod_perl.
Next we have to download and install libapreq2
. Goto [[12]] and and part way down the page (not on the left) under Downloads, You can download the latest version of libapreq from
click on ASF mirror
.
(installing from CPAN didn't work for me). Download libapreq2-2.08
and make sure to check it's MD5 checksum as above.
Move libapreq2-2.08.tar.gz
to your downloads directory and install it as follows. In a terminal window
> cd > cd downloads > tar -zvxf libapreq2-2.08.tar.gz > cd libapreq2-2.08 > perl Makefile.PL --with-apache2-apxs=/usr/local/apache2/bin/apxs > make && make test > su <root password> # make install
Now we have to edit the Apache config file one more time to enable libapreq2.
# cd /usr/local/apache2/conf # kwrite httpd.conf
Find the lines (e.g. use Find under Edit to search for Example:
)
# Example: # LoadModule foo_module modules/mod_foo.so #
and right after them add the line
LoadModule apreq_module modules/mod_apreq2.so
Then save the file and quit. Gracefully restart Apache
# /usr/local/apache2/bin/apachectl graceful
and check Apache by connecting to "http://localhost/perl-status" using a browser on your machine. The title line should list mod_apreq2 along with mod_perl.
Now set up things so that Apache starts automatically at boot up.
# cd /etc/init.d # cp boot.local boot.local.bak1 # kwrite boot.local
and add the line
/usr/local/apache2/bin/apachectl start
to the end of the file. Then save the file and quit.
Configuring MySQL
First become root and install the MySQL database.
>su <root password> # mysql_install_db --user=mysql # exit >
Start the MySQL service and configure it so that it starts at bootup.
- Open YaST
- Click
System
in the left pane - Click
System Services (Runlevel)
in the right pane - Click the
Expert Mode
radio button at the top of the YaST window - Select
mysql
from the scrolling list - Under the
Set/Reset
dropdown in the lower-right corner, chooseEnable the Service
- This should automatically select the appropriate runlevels to use when starting the service
- Under the
Start/Stop/Refresh
dropdown, selectStart now ...
- The MySQL service should start so just click
OK
to acknowledge the message - Click
Finish
- Click
Yes
to save the changes
You can quickly check that MySQL is running by
> mysql -u root
You should see
Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 to server version: 5.0.26 Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql>
Enter exit
to exit
mysql> exit Bye >
Reboot and Test
Now remove your DVD and reboot the system (SUSE Start Button
, Leave
, Restart Computer
).
Check that Apache is running by connecting to "http://localhost/" using a browser on your machine and/or to your server from a browser on a remote machine. You should see the page It works! indicating that apache is running.
This is also a good time to check that you can login your server from a remote location using SSH (non secure telnet and FTP are not allowed but secure SSH and SFTP are). If you are using "SSH Secure Shell" (now called "SSH Tectia"), a popular SSH client for PC's, you will have to add Keyboard Interactive
to the list of "Authentication methods" under "Authentication" if it's not already there.
Finally test that MySQL is running.
> mysql -u root ... mysql> mysql> exit Bye >
Currently the MySQL password is empty so we didn't need a password. We will take care of that later.
MySQL Security Issuses
As initially set up, MySQL is a very open system. There are anonymous accounts with full privileges for some databases and the root accounts are not password protected. See e.g. [[13]] for information on this. We recommend removing the anonymous accounts and giving passwords to the root accounts. There are two root accounts, one is root@localhost
and the other is root@host_name
where host_name
is the name of your server. To find this name, do the following
> mysql -u root mysql> SELECT Host, User FROM mysql.user;
You will see a table with four entries. For localhost
you will see two Users, root
and one with an empty name (the anonymous user). The other listed Host (with the same two users) is the name of your server which we will denote by host_name
.
First we will remove the anonymous accounts.
mysql> DELETE FROM mysql.user WHERE User = ; mysql> FLUSH PRIVILEGES;
Now using the up arrow key repeat the command
mysql> SELECT Host, User FROM mysql.user;
and you should get a table with only two users (both root
).
mysql> exit Bye >
Now we will assign a password to these root
accounts.
> mysqladmin -u root password "newpwd" > mysqladmin -u root -h host_name password "newpwd"
In the second command, replace host_name
with the name of the server host. The double quotes around the password are not always necessary, but you should use them if the password contains spaces or other characters that are special to your command interpreter. In both commands replace newpwd
with your choosen MySQL root
password. As was said above, "Do not forget what you enter here". Also remember that this is the password for the MySQL root
user, not the SUSE linux system root
user. Below we refer to this as <mysql root password>
Finally we secure the MySQL server by disallowing access via TCP/IP. To do this we have to edit the MySQL configuration file my.cnf
. You can use your favorite editor but we will give instructions assuming you are using Kwrite
>su <root password> # cd /etc # cp my.cnf my.cnf.bak1 # kwrite my.cnf
- Search (using Find under Edit) for
#skip-networking
- Uncomment this line (i.e. remove the
#
) so it becomes
skip-networking
Then save the file and Quit. And exit from the root
account
# exit >
That's it. Now the only access to the MySQL server is via the mysql.sock
file. Test that all is well:
> mysql -u root -p Enter Password: <mysql root password>
You should see
Welcome to the MySQL monitor ... mysql>
Enter mysql> exit Bye > and congratulate yourself. You are now ready for the easy part, installing WeBWorK.
Downloading the WeBWorK System Software and Problem Libraries
We are finally at the point where we can start downloading and installing WeBWorK. We will use CVS to download WeBWorK. This is easy and it will also make it easy to update the system in the future. General instructions can be found in the WeBWorKCVSReadOnly topic but the following will get the job done. The following are rather long commands; I would suggest you copy them and paste them into your terminal window rather than typing them.
> cd > cd downloads > cvs -d :pserver:anoncvs@cvs.webwork.rochester.edu:/webwork/cvs/system checkout -r rel-2-3-dev webwork2 pg > cvs -d :pserver:anoncvs@cvs.webwork.rochester.edu:/webwork/cvs/rochester checkout rochester_problib > cvs -d :pserver:anoncvs@cvs.webwork.rochester.edu:/webwork/cvs/union checkout union_problib > cvs -d :pserver:anoncvs@cvs.webwork.rochester.edu:/webwork/cvs/asu checkout database_problems
The first download gives you the latest released version with patches (don't be misled by the dev
extension --- this is not a development version).
The last download contains the WeBWorK National Problem Library. This now includes the Rochester and Union Libraries along with others but some people still find it convenient to use the Rochester and Union Libraries separately. There is quite a bit of overlap between these libraries but now you system is loaded with many thousands of WeBWorK problems.
Installing WeBWorK
Move the System into the Required Directories
As root
create a webwork
directory under /opt
and move directories there.
> su <root password> # mkdir /opt/webwork # mv webwork2 /opt/webwork/ # mv pg /opt/webwork/
Now create the courses
and libraries
directories under webwork
and copy and move content there.
# mkdir /opt/webwork/courses # mkdir /opt/webwork/libraries # mv database_problems/ /opt/webwork/libraries/ # mv rochester_problib/ /opt/webwork/libraries/ # mv union_problib/ /opt/webwork/libraries/ # cd /opt/webwork/webwork2/courses.dist # cp *.lst /opt/webwork/courses/ # cp -r modelCourse/ /opt/webwork/courses/
Setting Permissions
The PG installation directory and files should be owned by root and not writeable by other users:
# cd /opt/webwork/pg # chown -R root:root . # chmod -R u+rwX,go+rX .
Most WeBWorK directories and files should also be owned by root and not writeable by other users:
# cd /opt/webwork/webwork2 # chown -R root:root . # chmod -R u+rwX,go+rX .
Certain data directories need to be writable by the web server. These are DATA
, courses
, htdocs/tmp
, logs
, and tmp
. It is convenient to give WeBWorK administrators access to these directories as well, so they can perform administrative tasks such as removing temporary files, creating and editing courses from the command line, managing logs, and so on. We will create a new group called wwdata
, containing both the WeBWorK administrators and the web server.
- Start YaST
- Select
Security and Users
- Then
Group Management
- Click
Add
- Under
Group Name
enterwwdata
- Click
accept
- Then
finish
- Now select
User Management
- Select yourself and click
Edit
- Select
Details
and undergroups
- Put a check in the box for
wwdata
- Click
accept
- Click
Set Filter
and selectSystem Users
- Select
daemon
(which is really the apache server) and clickEdit
- Select
Details
and undergroups
- Put a check in the box for
wwdata
- Click
accept
and thenfinish
If there are other users who will also be administering WeBWorK files,
now is a good time to add them. And remember to add them to the wwdata
group as above.
You can check that this suceeded in a terminal window by entering
# exit > id <your userid>
and then you should see wwdata
listed under groups. Also
> id daemon
should show wwdata listed under groups. Now we make the WeBWorK directories that need to be writable by the web server have wwdata
as their group. The following are rather long commands; you might want to copy them and paste them into your terminal window rather than typing them.
> su <root password> # cd /opt/webwork/webwork2/ # chgrp -R wwdata DATA ../courses htdocs/tmp logs tmp # chmod -R g+w DATA ../courses htdocs logs tmp # find DATA/ ../courses/ htdocs/ logs/ tmp/ -type d -a ! -name CVS -exec chmod g+s {} \; # exit >
Configuring the Shell
To make working with WeBWorK easier, there are a couple of changes you can make to your shell environment.
Add the WeBWorK bin
directory to your path. This will allow you to run WeBWorK command-line utilities without typing the full path to the utility. Goto your home directory and backup your .bashrc
file
> cd > cp .bashrc .bashrc.bak1
Now edit .bashrc
> kwrite .bashrc
Just above the last line add the two lines:
export PATH=$PATH:/opt/webwork/webwork2/bin export WEBWORK_ROOT=/opt/webwork/webwork2
Then save the file and Quit.
Close your Terminal Window and open a new one so the above changes take effect. You can check that they have by
> echo $PATH > echo $WEBWORK_ROOT
Checking Module Dependancies
WeBWorK includes a script called check_modules.pl
that verifies that the needed programs and Perl modules are installed on your system. Run this script to make sure you have installed the required programs and Perl modules.
> check_modules.pl apache2
Scroll up and look through the listing. It should find everything except PHP::Serialization
which is only required if you plan to use WeBWorK with Moodle. If something is missing (flagged by **
), look back through these instructions to find where it should have been installed and install it.
Configuring WeBWorK
Making Copies of the Distribution Configuration Files
Before configuring the system, you must make local copies of the global.conf
and database.conf
configuration files, located in /opt/webwork/webwork2/conf/
. Since these are owned by root
> su <root password> # cd /opt/webwork/webwork2/conf # cp global.conf.dist global.conf # cp database.conf.dist database.conf
Global Configuration
Most WeBWorK configuration is done in the file /opt/webwork2/conf/global.conf
. This file provides system-wide configuration settings, and defaults for course settings. Any setting in this file can be overridden in the course.conf
file for a particular course.
There are several options that must be set for WeBWorK to work with your system. The rest of the file consists of customization options. Now edit global.conf
# cd /opt/webwork/webwork2/conf # kwrite global.conf
- Search for
$externalPrograms{tar} = "/usr/bin/tar";
and replace this by
$externalPrograms{tar} = "/bin/tar";
- Now directly below this add the new line
$externalPrograms{gzip} = "/usr/bin/gzip";
WeBWorK uses the DateTime module. DateTime is supposed to be able to determine the local timezone itself without you having to enter it but this often fails so it is best to just set it here. For is a list of timezones recognized by DateTime goto
[[14]] . These timezones are more refined than standard timezone usage in that they include switches to daylight savings time (e.g. some parts of a time zone may make the switch and others may not). For example if your server is in the eastern US, on the list you will see DateTime::TimeZone::America::New_York
and you should replace $siteDefaults{timezone} = "";
by $siteDefaults{timezone} = "America/New_York";
- Search for
$siteDefaults{timezone} = "";
and enter your local timezone.
At this point in time jsMath
is probably the prefered default display mode.
- Search for
$pg{options}{displayMode} = "images";
and replace this by
$pg{options}{displayMode} = "jsMath";
We need to set a password that WeBWorK uses when it communicated with the MySQL database.
- Search for
$database_password = "";
and replace this by
$database_password = "database_password";
where of course you should replace 'database_password' with your own password. Remember this password as we will need it below.
WeBWorK sends mail in three instances. The PG system sends mail to report answers to questionnaires and free-response problems. The mail merge module is used to send mail to course participants, i.e. to report scores. The feedback module allows participants to send mail to course instructors.
To send mail, WeBWorK needs the address of an SMTP server. Normally you will use the address of your school's SMTP server. If the local machine is running an SMTP server, use localhost
. IMPORTANT: Our instructions above did not install an SMTP server so you will have to install and configue one if you do not use your school's SMTP server. When connecting to the SMTP server, it must also send an email address representing the sender of the email (this has nothing to do with the From
address on the mail message).
- Edit the lines
$mail{smtpServer} = 'mail.yourschool.edu';
and - =$mail{smtpSender}
'webwork@yourserver.yourschool.edu';
entering the appropiate information
Then save the file and Quit.
Now become a regular user again
# exit >
WeBWorK uses a single database, called webwork
, for all courses . Create the webwork
database using the your database server's command console. Then grant the user webworkWrite
the following permissions for that database.
username | permissions |
webworkWrite |
SELECT , INSERT , UPDATE , DELETE , CREATE , ALTER , DROP
|
To do this do the following (before you just copy, paste and hit <Enter>
notice that you have to replace database_password
with the password you set when editing global.conf
above):
$ mysql -u root -p mysql Enter password: <mysql root password> mysql> CREATE DATABASE webwork; mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, LOCK TABLES ON webwork.* TO webworkWrite@localhost IDENTIFIED BY 'database_password'; mysql> exit Bye $
where as we said replace database_password
with the password you set when editing global.conf
above.
jsMath Settings
Version 2.0 of jsMath introduced a new fallback method for when the TeX fonts are not available on the student's computer. This uses images of the individual TeX characters in place of the TeX fonts. These are distributed in webwork2/htdocs/jsMath/jsMath-fonts.tar.gz
, and you need to unpack this tarball before jsMath will work properly. Use the command
> su <root password> # cd /opt/webwork/webwork2/htdocs/jsMath # tar vfxz jsMath-fonts.tar.gz
This will unpack the archive. Since there are 20,000 tiny files, it can take a long time, so the v
option is used to show you the names as they are unpacked so that you know the command is actually doing something. Once the images are unpacked, jsMath's image mode fallback (the default fallback method) will work properly.
Configuring Apache
WeBWorK ships with an Apache config file that needs to included in your main Apache config file. The file is named webwork.apache2-config.dist
and located in the conf
directory. First, copy the file to webwork.apache2-config
:
# cd /opt/webwork/webwork2/conf # cp webwork.apache2-config.dist webwork.apache2-config
Now edit the httpd.conf
file
# cd /usr/local/apache2/conf/
# kwrite httpd.conf
Append the following line at the end of the file
Include /opt/webwork/webwork2/conf/webwork.apache2-config
Then save the file and Quit.
Then restart Apache
# /usr/local/apache2/bin/apachectl graceful # exit >
and test your configuration:
- Test the
/webwork2
location by visitinghttp://yourserver.yourschool.edu/webwork2
. You should see the WeBWorK home page with no courses listed. Actually the directory/opt/webwork/courses/
does contain themodelCourse
but themodelCourse
is not a real course so you will get an error message if you try to log into it. It will be used a as model for setting up other courses. For this reason/opt/webwork/courses/modelCourse/
contains a file namedhide_directory
and so themodelCourse
is not visible. - Test the
/webwork2_files
location by visitinghttp://yourserver.yourschool.edu/webwork2_files
. You should see the "WeBWorK Placeholder Page". - You cannot test the
/webwork2_course_files
location until you have created a course.
If Something is Wrong
If something is wrong one of the first things to check is that the config files have been edited correctly (e.g. one time a wrapped line in global.conf
caused me problems). A quick way to check this is to do a diff
between the edited and distributed versions and check that diff
reports the changes you made and only those.
# exit > > cd /usr/local/apache/conf > diff httpd.conf original/httpd.confm > cd /opt/webwork/webwork2/conf/ > diff global.conf global.conf.dist > diff database.conf database.conf.dist > diff webwork.apache-config webwork.apache-config.dist
If something is wrong and you fix it, you will have to restart Apache for the changes to take effect
> su <root password> # /usr/local/apache/bin/apachectl graceful # exit >
---
Create the admin Course
The CourseAdministrationManual gives information about creating courses. Here we will give explicit instructions for doing this.
> su <root password> # newgrp wwdata # umask 2 # cd /opt/webwork/courses # addcourse admin --db-layout=sql_single --users=adminClasslist.lst --professors=admin # exit # exit >
Now goto http://yourserver.yourschool.edu/webwork2
and should see the WeBWorK home page with Course Adninistration
listed at the top. Click on it and login with Username admin
and Password admin
. This first thing you should do is to click on Password/Email
and change admin
's password to something more secure than admin
.
Unless you choose oherwise, users with professor
privilges in the admin
course (i.e. WeBWorK administrators) will automatically be added to new courses with professor
privilges and the same password as in the admin
course. Initially the only such user is admin
(hopefully you are not confused by the fact that the course admin
has a user named admin
). It's usually convenient make yourself a WeBWorK administrator. To do this (assuming you are logged in as admin
to the admin
course at http://yourserver.yourschool.edu/webwork2/admin
)
- Click on
Classlist Editor
in the left panel - Check
Add 1 student(s)
and clickTake Action!
- Enter the appropiate information (you can use your
Login Name
as yourStudent ID
) and - Then click
Add Students
- Click on
Classlist Editor
in the left panel again
- Select yourself with a check mark and then check
Give new password to Selected users
or just checkGive new password to All users
(as a safely mechanism you can not change the password foradmin
this way since you are logged in asadmin
) and then clickTake Action!
- Enter the password, check
Save changes
and then clickTake Action!
- Finally give yourself
professor
privilges by selecting yourself with a check mark, checkingEdit Selected users
and then clickingTake Action!
(or by just clicking on the "pencil" next to your login name which is a much faster way to edit classlist data for a single user) - Now at the far right change
Permission Level
from 0 (a ordinary student) to 10 (an esteemed professor) - check
Save changes
and then clickTake Action!
At some point you will probably want to hide the admin
course so that it is not listed on the WeBWorK home page. As we noted above the modelCourse
, which is already hidden, is not a real course so you will get an error message if you try to log into it. This is a good reason to hide it. The modelCourse
is very useful as a model (hence its name) for setting up other courses. The admin
course is used for administering WeBWorK and even though regular users can not log into it (you did change the admin
password, didn't you!!), it a little bit cleaner and safer to hide it from prying eyes.
To hide a course place a file named hide_directory
in the course directory and it will not show up in the courses list on the WeBWorK home page. It will still appear in the Course Administration listing. If you do this you will still be able to access the admin
course using the URL http://yourserver.yourschool.edu/webwork2/admin
but you will not see a link for it on the WeBWorK home page http://yourserver.yourschool.edu/webwork2
. Let's hide the admin
course.
> cd > kwrite hide_directory
Now you don't really have to put any verbiage in the file but I suggest you put:
Place a file named "hide_directory" in a course or other directory and it will not show up in the courses list on the WeBWorK home page. It will still appear in the Course Administration listing.
Save the file and exit. Now copy the file to the admin
course.
> sudo cp hide_directory /opt/webwork/courses/admin root's password:<root password>
Now goto http://yourserver.yourschool.edu/webwork2
and no course will be listed.
Starting and Stoping Apache, MySQL and the KDE desktop GUI
If you make changes to the system, you will have to restart apache
before the changes take effect. On rare ocassions you may need to restart MySQL
.
Starting and Stoping Apache
You have to run these commands as root
.
To start or restart (i.e. stop and then start) the apache
webserver run the command
> sudo /usr/local/apache2/bin/apachectl graceful root's password:<root password>
To stop the apache
webserver run the command
> sudo /usr/local/apache2/bin/apachectl stop root's password:<root password>
Starting and Stoping MySQL
You have to run these commands as root
.
To start the MySQL
server run the command
> sudo /etc/init.d/mysql start root's password:<root password>
To stop the MySQL
server run the command
> sudo /etc/init.d/mysql stop root's password:<root password>
To restart the MySQL
server run the command
> sudo /etc/init.d/mysql restart root's password:<root password>
You can also star or stop MySQL by using YaST.
- Open YaST
- Click
System
in the left pane - Click
System Services (Runlevel)
in the right pane - Click the
Expert Mode
radio button at the top of the YaST window - Select
mysql
from the scrolling list - Under the
Start/Stop/Refresh
dropdown, select the appropriate action - Click
Finish
Starting and stopping the KDE desktop GUI
The KDE desktop is automatically started when the system boots.
To stop KDE
so that you only have a standard terminal window run the following in a standard terminal window
$ sudo /etc/init.d/xdm stop root's password:<root password>
If you stopped KDE
and want to restart it run the following
$ sudo /etc/init.d/xdm start root's password:<root password>
Install the WeBWorK Problem Libraries
Before we create a real course we will install the WeBWorK Problem Libraries.
Install the National Problem Library
The National Problem Library
consists of both WeBWorK problems and methods for searching and selecting problems. Also it contains as sub libraries many of the other standard libraries. Normally this library is referred to as the ProblemLibrary
but the downloaded CVS directory for it is named database_problems
. So the first thing we do is to link ProblemLibrary
to database_problems
.
> cd /opt/webwork/libraries/ > sudo ln -s database_problems ProblemLibrary root's password:<root password>
Next we have to edit global.conf
.
> cd /opt/webwork/webwork2/conf > su Password: <root password> # kwrite global.conf
- Search for
problemLibrary
and replace$problemLibrary{root} = "";
by
$problemLibrary{root} = "/opt/webwork/libraries/ProblemLibrary";
Then save the file and quit. And return to a regular user
#exit >
We now create a database, called ProblemLibrary
, for for the Problem Library.
To do this do the following:
> mysql -u root -p mysql Enter password: <mysql root password> mysql> CREATE DATABASE ProblemLibrary; mysql> GRANT SELECT ON ProblemLibrary.* TO webworkWrite@localhost; mysql> exit Bye >
Run the installation script making sure you are in the /opt/webwork/libraries/ProblemLibrary
directory. This directory
contains the files loadDB2
and create_tables2.sql
.
> cd /opt/webwork/libraries/ProblemLibrary > ./loadDB2 <mysql root password>
This has to convert a lot of data so please be patient.
If at some time in the future you want to upgrade the Problem Library, the process
is simpler. Optionally remove the previous copy of the
library, unpack the new copy in the same place, and run loadDB.pl.
Set up the Rochester and Union Libraries
First we need to edit global.conf
one last time
> cd /opt/webwork/webwork2/conf > su Password: <root password> # kwrite global.conf
- Search for
courseFiles{problibs}
and scroll down several lines to the line
# rochesterLibrary => "Rochester",
- Uncomment this line (i.e. remove the
#
) so it becomes
rochesterLibrary => "Rochester",
- Directly below this line add the line
unionLibrary => "Union",
- Search for
macrosPath
and scroll down several lines to the line
$pg{directories}{macros},
- After this line add the two lines:
'/opt/webwork/libraries/union_problib/macros',
'/opt/webwork/libraries/union_problib/parserOrientation',
Then save the file and quit.
Since we have edited global.conf
a lot and this is a very critical file, it would be a good idea to run
> diff global.conf global.conf.dist
and check that you haven't made any mistakes (e.g. by introducing an inadvertant line break, etc).
We next put links to the Rochester and Union Libraries in the modelCourse
so that when we create courses copying templates from the modelCourse
, these libraries will be available.
> cd /opt/webwork/courses/modelCourse/templates/ > sudo ln -s /opt/webwork/libraries/union_problib/ unionLibrary root's password:<root password> > sudo ln -s /opt/webwork/libraries/rochester_problib/ rochesterLibrary
Create Your First Actual Course
Now log into the admin
course ( http://yourserver.yourschool.edu/webwork2/admin
) as yourself or admin
and
- click on
Add Course
- For
Course ID
entermyTestCourse
- For
Course Title
enterMy Test Course
- Enter your institution
- Leave
Add WeBWorK administrators to new course
checked - Add an additional instructor if you wish
- Copy templates from:
modelCourse
(the default action) - Select sql_single for the database layout.
- Click on
Add Course
- Click
Log into myTestCourse
and log in either as admin
or yourself.
At some point you will probably want to "hide" myTestCourse
from general view but you already know how to do that.
Where to go From Here
You should play around with myTestCourse
e.g. click on Library Browser
and browse the Problem Library
and also the Rochester
and Union
libraries.
Look at [[15]]
Read the CourseAdministrationManual for more information about creating courses.
Consult the WeBWorKDocs topic for other WeBWorK documentation.
-- Main.ArnoldPizer - 29 Jul 2006 Initial version based on Sam Hathaway's InstallationManualV2pt2