Forum archive 2000-2006

Arnold K. Pizer - Installing WeBWorK on Redhat Linux 6.x

Arnold K. Pizer - Installing WeBWorK on Redhat Linux 6.x

by Arnold Pizer -
Number of replies: 0
Installing WeBWorK on Redhat Linux 6.x topic started 4/28/2000; 4:46:26 PM
last post 4/28/2000; 4:46:26 PM
userArnold K. Pizer - Installing WeBWorK on Redhat Linux 6.x  blueArrow
4/28/2000; 4:46:26 PM (reads: 2251, responses: 0)



This is a detailed description of how to set up WeBWorK on redhat Linux 6.x
Note that this is in no way an optimal or even recommended setup. It is simply
a detailed explaination of a setup that works. It may be a help to novice linux
users who wish to run WeBWorK.



1. Open the redhat 6.x box and read directions



2. Collect necessary information (network ip addresses, etc)



3. Insert CD disk 1 and reboot (or boot from floppy)



4. For Install Type choose GNOME workstation



5. Set up the root account and at least one regular account



6. login and then type startx (assuming you did not enable graphical login) to
start windowing interface



7. Start Netscape and connect to some site to test networking is OK.



8. telenet into new machine from some other machine to check that this works.



9. Get a terminal window and enter perl -V to see what perl looks like: I see





Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
Platform:
osname=linux, osvers=2.2.5-22smp, archname=i386-linux
uname='linux porky.devel.redhat.com 2.2.5-22smp #1 smp wed jun 2
09:11:51 edt 1999 i686 unknown '
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef useperlio=undef d_sfio=undef
Compiler:
cc='cc', optimize='-O2', gccversion=egcs-2.91.66 19990314/Linux (egcs-1.1.2
release)
cppflags='-Dbool=char -DHAS_BOOL -I/usr/local/include'
ccflags ='-Dbool=char -DHAS_BOOL -I/usr/local/include'
stdchar='char', d_stdstdio=undef, usevfork=false
intsize=4, longsize=4, ptrsize=4, doublesize=8
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12



alignbytes=4, usemymalloc=n, prototype=define
Linker and Libraries:
ld='cc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lnsl -ldl -lm -lc -lposix -lcrypt
libc=, so=so, useshrplib=false, libperl=libperl.a
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'



cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'



Characteristics of this binary (from libperl):
Built under linux
Compiled at Aug 30 1999 23:09:51
@INC:
/usr/lib/perl5/5.00503/i386-linux
/usr/lib/perl5/5.00503
/usr/lib/perl5/site_perl/5.005/i386-linux
/usr/lib/perl5/site_perl/5.005
.



I don't see gdbm here. Let's try



ldd /usr/bin/perl





libnsl.so.1 => /lib/libnsl.so.1 (0x40018000)
libdl.so.2 => /lib/libdl.so.2 (0x4002f000)
libm.so.6 => /lib/libm.so.6 (0x40032000)
libc.so.6 => /lib/libc.so.6 (0x4004e000)
libcrypt.so.1 => /lib/libcrypt.so.1 (0x40141000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)





Again we do not see gdbm which means we have to install gdbm and recompile perl.
The gdbm development version is intalled so in theory if we just recompile perl,
perl should find and install gdbm. Let's try it.



The source is probably available on the CD, but I'll get it from www.perl.com



Connect to www.perl.com, go to downloads, stable production release,
click on stable.tar.gzip, and put it in the directory (newly created)
downloads --- took 15 seconds





enter gunzip stable.tar.gz
enter tar -xvf stable.tar
cd to the perl5.005_03 directory
enter rm -f config.sh Policy.sh
enter sh Configure -d (this means accept defaults)
enter make
enter make test
had one error in testing anydbm (will proceed ignoring this error)
enter su to change to root account (or start another terminal session as root)
enter make install
enter ldd /usr/bin/perl again and I see
libnsl.so.1 => /lib/libnsl.so.1 (0x40018000)
libdb.so.3 => /lib/libdb.so.3 (0x4002f000)
libgdbm.so.2 => /usr/lib/libgdbm.so.2 (0x40069000)
libdl.so.2 => /lib/libdl.so.2 (0x4006f000)
libm.so.6 => /lib/libm.so.6 (0x40072000)
libc.so.6 => /lib/libc.so.6 (0x4008e000)
libcrypt.so.1 => /lib/libcrypt.so.1 (0x40181000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)




Good. This looks better. Now exit the root account or switch to a non root
terminal session.



10. Get the required missing perl modules. Connect to www.perl.con and then to
CPAN. Read how to install modules. You can use the search engine to find them
but their location is given below.



11. Download (using your browser)the following. First look at modules by name and
downoad GD-1.xx.tar.gz (under GD), HTML-Parser-3.xx.tar.gz (under HTML),
libnet-1.0xxx.tar.gz (under Net), and MIME-Base64-2.11.tar.gz (under MIME).
HTML::Entities is contained in HTML-Parser
and Net:SMTP is contained in libnet.



12. Build these modules:



In a terminal window cd to the downloads directory (where you downloaded the
perl modules) and do the following. You don't want to be root at this point.
Enter



gunzip libnet-1.0607.tar.gz
tar -xvf libnet-1.0607.tar
cd libnet-.0607
perl Makefile.PL (somewhere in here it said I see you have already installed libnet before.
Do you want to modify/update your congiuration (y|n)? I said no)
make
make test



Now su to root or switch to a root terminal session (and the proper
subdirectory). Enter
make install



Try perl -MNet::SMTP -e 'print "installed\n"'



You should get the message:



installed



If you see this it worked. Onto the next. Go back to the downloads directory.



gunzip HTML-Parser-3.05.tar.gz
tar -xvf HTML-Parser-3.05.tar
cd HTML-Parser-3.05
perl Makefile.PL
make
make test
Now su to root or switch to a root terminal session (and the proper
subdirectory). Enter
make install




Try perl -MHTML::Entities -e 'print "installed\n"'



Again hopefully you get the message:



installed



Now for the next to the last one. Go back to the downloads directory.




gunzip GD-1.19.tar.gz
tar -xvf GD-1.19.tar
cd GD-1.19
perl Makefile.PL
make
make test
make install




Try perl -MGD -e 'print "installed\n"'



Again hopefully you get the message:



installed



Finally run through the process one more time to install MIME-Base64-2.11.tar.gz.
Try perl -MMIME::Base64 -e 'print "installed\n"'



NOTE: With earlier version of WeBWorK there were problems if you installed version
1.20 or later of GD. This was because WeBWorK used to use only gifs. Now
it can use gifs or pngs. Make sure your version of gd is recent enought to
support png's. If not, you probably will have to use version 1.9 of GD.




13. Next we install apache and ftp. It's not absolutely necessary to be able to
ftp to the webwork server, but it is very convenient to be able to do so.



From a standard terminal session:



Enter the command gnorpm, insert redhat CD Disk 1, enter the root password,
click install, and select apache-1-3.9-4 and wu-ftpd-2.5.0-9 (both are under
System Environment/Daemons), and click Install. Then close and reboot (remember
to remove the CD).



Using a web browser on another machine, connect using http://123.456.789.1/ (but
enter your real ip address) and you should see:



It Worked!
If you can see this, it means that the installation of the Apache software on
this Red Hat Linux
system was successful.
You may now add content to this directory and replace this page.



If you do not see this, check the error log:
/var/log/httpd/error_log



Using an ftp client on another machine, check that you can ftp to 123.456.789.1/
(but enter your real ip address).



14. Now we are ready to obtain and start installing WeBWorK. Download the following
files and put them in the downloads directory:



Download these files using a web browser (ftp access is not allowed) by connecting to
http://webhost.math.rochester.edu/webworkdocs/ and then click on Download WeBWorK
and follow the instructions.



webwork_1.6_XXX.tar.gz
templates_1.5_22-August-00.tar.gz
and also:



readme.first
readme.install
readme.upgrade
overview.html
setup.html
linuxredhat.html




You will find the file linuxredhat.html very useful even if you are not running
linux. It gives specific information on installing Perl with gdbm, where to find
needed Perl modules, etc.



These six files are contained in webwork_1.6_XXX.tar.gz but you should look at
overview.html and readme.install for information on how to and where to unzip and
untar the tar files. Note that some browsers (e.g. Netscape) may change the .gz
extension and, if so, you should change it back.



Also, you may want to skim the following pages to get an idea of what we will be
doing. Some of the tasks mentioned in these documents we have already
accomplished. The remainder of this document basically consists of details on
following the instructions in readme.install and settingupsystem.html in the
special case of a redhat 6.1 installation. On our red hat 6.1 system, the /www
directory in the above documentation becomes /home/httpd .



readme.first
readme.install
overview.html
setup.html



15. In a standard terminal window (as a regular user, not root) cd to the
downloads directory and enter:



gunzip webwork.............tar.gz
tar -xvf webwork.............tar



In addition to the webwork.tar file, you will see the copies of the above readme
and html files.



16. Create a new terminal window and in there enter su so that you become root.
We need to temporarily make http world writable. Enter



cd /home
chmod 777 httpd




17. Back in your standard (non root) terminal window enter:



mv webwork.tar /home/httpd/
cd /home/httpd/
tar -xvf webwork.tar



18. Now go back to your root window and enter




cd /home
chmod 755 httpd



18. Now we will follow step by step the directions in settingupsystem.html.



19. First we will setup appache. You have to be root to make these changes so
from your root account enter: linuxconf Now add a new user account with login
name wwserver and group wwserver. To do this open Config, User accounts,
Normal, User Accounts and then click Add. Enter any acceptable password.



We also want to setup a special group for people who have permisson to edit
WeBWorK system files. To do this open Config, User accounts, Normal, Group
Definitions and then click Add. For the group name use wwadmin and add your own
login name as Alternate members. Click accept, check that things look OK, and
then quit.



20. Now still from your root account, enter




cd /etc/httpd/conf/
cp httpd.conf httpd.conf.2-8-00
cp srm.conf srm.conf.2-8-00 (so we have backups)



Now we have to edit the httpd.conf and srm.conf files. You have a choice of how
you want to do this. You can edit them as root. But since I want edit them as a
standard user using an editor I like on my local PC (which connects to the linux
machine by FTP), I will temporarily change the file permissions by entering the
commands:



chmod 666 httpd.conf
chmod 666 srm.conf



Now edit the file httpd.conf:
around lines 43-44, change




User nobody
Group nobody



to



User wwserver
Group wwserver



Then at the end of the file add the following




## allow access to WeBWorK's cgi perl scripts
ScriptAlias /cgi-bin/webwork/system/ "/home/httpd/webwork/system/cgi/"
<Directory /home/httpd/webwork/system/cgi>
Options FollowSymLinks
Order deny,allow
deny from all
allow from all



</Directory>



and save your changes. Next edit the srm.conf file.
Around line 152, comment out the following code:



ScriptAlias /cgi-bin/ /home/httpd/cgi-bin/



i.e. replace this by
#ScriptAlias /cgi-bin/ /home/httpd/cgi-bin/



Current version of apache have all the configuration information
in the httpd.conf file. The main point you can not alias /cgi-bin
before you alias /cgi-bin/webwork/system/ (or if you do, understand
what you are doing).



Now save your changes and (as root) enter



chmod 644 httpd.conf
chmod 644 srm.conf



to restore the original permissions.
Now we have to set up a link. The following command has to be performed by root.



Enter the commands



cd /home/httpd/html/
ln -s /home/httpd/webwork/system/system_html/ webwork_system_html



21. Now switch to your regular (non root) account. Actually you will
have to login again to activate your membership in the wwadmin group.
As a double check, enter the command id and you should see that you
are a member of the group wwadmin.



Now enter (carefully) the commands




cd /home/httpd/
chgrp -R wwadmin webwork
chmod -R 755 webwork



Note: this just sets temporary permissions. The setup script will set
much more restrictive permissions.



22. Now we are ready to run the setup script. Make sure you are not root
(enter whoami to tripple check). Enter



cd /home/httpd/webwork/system/
./system_webwork_setup.pl



Hit [Enter]
enter y
enter w
enter n
Hit [Enter] to accept default path to perl
Hit [Enter] to accept default default WeBWorK cgi-URL
Hit [Enter] to accept default default WeBWorK html-URL
enter wwadmin
enter y
enter y
enter y



After a little wait you should see: Setup complete.
This completes the setup of the WeBWorK system.



23. For now, we will skip the Local Dependencies section and move on to setting
up the demoCourse.



We need to setup a special group for people who have permisson to read from and
write to files associted with the demoCourse. In addition we have to add the
webserver to this group since the webserver also needs permission to read to and
write from these files. Our normal convention is that if the name of a course
is e.g. mth100, we call the group MTH100 (both course and group names are case
senitive). So we will use DEMOCOURSE as the group name (note that the directions

Setting up a WeBWorK course
use a different convention whereby the group name
for mth100 would be mth100group but this leads to long names which I would
rather avoid).



You have to be root to make these changes so from your root account enter:
linuxconf



Then open Config, User accounts, Normal, Group Definitions and then click Add.
For the group name use DEMOCOURSE and add your own login name AND wwserver as
Alternate members (to do this enter e.g. "apizer wwserver", i.e. your login name
<space> wwserver). Click accept, check that things look OK, and then quit.
Remember that wwserver is the name of the webserver.



For these changes to take effect, you have to logout and login again and you
also have to stop and restart the webserver. The easiest way to stop and
restart the webserver is to reboot your machine. Alternatively, you can as root
run the coomands:




kill -TERM `cat /var/run/httpd.pid`
tail -f /var/log/httpd/error_log (to check on the progress of the shut down)
/usr/sbin/httpd (to restart the webserver)



Log out and then back in to your own account. Enter the command id and you
should see that you are a member of the DEMOCOURSE group.



Next we have to set up a new directory and a link. The following command has to
be performed by root. Enter the commands




cd /home/httpd/html/
mk dir webwork
cd webwork
ln -s /home/httpd/webwork/courses/demoCourse/html/ demoCourse



24. Now we are ready to run the course setup script. You should not run this as
root so be sure to exit from your root terminal window. Enter the commands



Note: it's much faster and safer to just begin typing and then to hit [Tab]
to
let bash complete the spelling. E.g. below you can really enter
cd /h[Tab]ht[Tab]w[Tab]/co[Tab]d[Tab]
./c[Tab]




cd /home/httpd/webwork/courses/demoCourse/
./course_webwork_setup.pl



Hit [Enter]
enter y
enter w (to set up a working version)
enter y
Hit [Enter]
Hit [Enter]
Hit [Enter]
enter DEMOCOURSE (as the name of the group)
enter y
enter y
enter y
enter y



This script should complete with a list of things you are asked to read about.
Now we have to issue some WeBWorK commands. The easiest way to do this is to put



/home/httpd/webwork/system/scripts/ in your search path. Do this as follows.
Enter the commands




cd (to return to your home directory)
cp .bash_profile .bash_profile.2-8-00 (to make a backup)



Now edit the file .bash_profile adding




:/home/httpd/webwork/system/scripts



to the end of the PATH line so that it looks something like



PATH=$PATH:$HOME/bin:/home/httpd/webwork/system/scripts



Save your changes, logout and then back in, and enter



echo $PATH



to check that your changes have taken effect.



Now enter



cd /home/httpd/webwork/courses/demoCourse/templates



NOTE: You do not have to work from this directory. But if you do you can
use [Tab] completion and using this makes it less likely that you will make a
mistake. If you just enter a command name, e.g. initialPasswords.pl, you
will be told the correct syntax to use. The coursename which follows a command
(e.g. initialPasswords.pl) determined which course you are acting on. Be
careful to type the correct name especially if you have permission to edit
files for many courses. In what follows if you enter initi[Tab]de[Tab] you
will see initialPasswords.pl demoCourse.lst This tells you you are working
with the correct course. Now just use the Backspace key to remove the .lst,
enter <space>de[Tab] and you are ready to go. So now enter(using [Tab]
completion)




import_classlist-database.pl demoCourse demoCourse.lst



Now enter (using [Tab] completion):



setProfPermissions.pl demoCourse apizer



You should see a listing of permissions with apizer having permission 10.



25. Now we are ready to see if everything works.



From your webbrowser connect to




http://123.456.789.1/webwork/demoCourse



(But enter your real ip address. You can use your computer's name if it is
registered. Note: If your server is not configured correctly,
you may need to enter the trailing / (as in
http://123.456.789.1/webwork/demoCourse/).



You should see the login page. If you do not, check the error log:
/var/log/httpd/error_log



login as user: apizer with password 111-11-1111 (don't foget the dashes)



Click Enter Professor's Page



Click Enter Build Problem Set Page (the only choice you should see)



Select all the sets and then click Build Problem Set(s)
You will see a list of the sets which have been built.



At the bottom of the page click Problem Sets



Select a set, e.g set Algebra1RealNumbers, select PDF form, and click
Get_Hard_Copy. After a short wait (since this is the first time TeX has probably
been run, fonts may have to be created, etc), Acobat should start and you should
see a copy of the set. You can select postscript output if your client computer
can display that (e.g using Ghostview). Note: the first few times you use Get_Hard_Copy
it may take quite some time as the computer probably has to run Metafont to create
TeX fonts. The second time you run Get_Hard_Copy on the same problem set will give
you a better idea of how fast your system will usually respond.



This is a good time to install tth which is needed for "formatted-text" output.
Obtain a copy of tth ( http://hutchinson.belmont.ma.us/tth/ ) for linux
and place the binary tth file (named tth) in the directory /www/webwork/system/scripts.
The tth file should have permission 775. The tth binary is NOT included with WeBWorK.
However, it can be obtained without cost for non commercial use from the above site.
You do not have to edit WeBWorK's path to this binary (if you use the file name and
directory suggested above) but just in case, the path is defined around line 352 in the
tth subroutine of the file dangerousMacros.pl
(in /www/webwork/system/scripts/courseScripts). The path variable is called $tthpath.



Next click Do Problem Set and view a few problems. Use the selected mode which,
at present, is TEXT which means TeX source code. Next for say problem 2,
select "formatted-text", and hit submit answers. This uses tth and which should
be working. With this mode math symbols appear on the screen composed of ascii
characters. Note "typeset" mode will not be working yet. Go to problem 10,
enter 12/23 and hit Preview Answers. You should see the type set fraction 12
over 23.



At this point you have a functioning system. We still have to install
latex2html and make a number other local changes, but for the most part the
bulk of your work is over.



26. Next we will get and install latex2html.



Connect to
http://www-dsed.llnl.gov/files/programs/unix/latex2html/sources/ and



download the file latex2html-98_1p1_tar.gz. Put it in the downloads directory.




enter gunzip latex2html-98.1p1.tar.gz
tar -xvf latex2html-98.1p1.tar
cd latex2html
chmod 755 latex2html



Edit the files "install-test", "latex2html", "pstoimg", and "texexpand"
In the first line of each file, change #!/usr/local/bin/perl to #!/usr/bin/perl




Now su to root (or switch to a root terminal window). Enter the commands:




cd /usr/share/
mv /home/apizer/downloads/latex2html . (don't foget the dot and of course
replace apizer by your own userid)
cd texmf/tex/latex/
mkdir latex2html
cd latex2html/
cp /usr/share/latex2html/texinputs/* . (to put the latex2html sty files where
latex can find them)
cd /usr/share/latex2html/
./install-test (to run the latex2html install program)
Hit [Enter] in response to all questions except hit g when asked if you want
gif or png output.
cd /usr/bin
cp /usr/share/latex2html/latex2html . (don't foget the dot. This puts the
executable in a convenient location)
edit the file /usr/share/latex2html/latex2html.config .
Around line 465 set $PK_GENERATION = 1;
Around line 474 uncomment $DVIPS_MODE = "toshiba";



edit the file /home/httpd/webwork/system/courseScripts/displayMacros.pl
Around lines 543 and 546 change /usr/local/bin/ to /usr/bin/ (two changes).
They should read:




$ENV{'PATH'} .= ':/usr/bin';
## the following line(s) will have to be customized for your setup.
## The first line is what we use for
## latex2html 98.1p1 and the second is what we use for latex2html 96.1



system("/usr/bin/latex2html -no_math -init_file ${Global::mainDirectory}latex2html.init.98.1
-dir $TMPPROBDIR -prefix $psvn $TMPPROBDIR${psvn}output.tex
> $TMPPROBDIR${psvn}l2h.log 2>&1");



27. Now you are ready to test your system. Login to the demoCourse, select the
set Derivatives2Formulas , and click Do_problem_set. Select "typeset" as the
display mode, select the first problem and click Get problem. Be patient.
Latex2html takes a while, especially the first few times you run it as it has to
create fonts. After a short while, you should see a typeset version of the
problem.




 

<| Post or View Comments |>