## Forum archive 2000-2006

### Arnold K. Pizer - Installing WeBWorK on a Red Hat Linux 9.0 System

by Arnold Pizer -
Number of replies: 0
 Installing WeBWorK on a Red Hat Linux 9.0 System topic started 7/24/2003; 3:33:01 PMlast post 7/24/2003; 3:33:01 PM
Arnold K. Pizer - Installing WeBWorK on a Red Hat Linux 9.0 System
7/24/2003; 3:33:01 PM (reads: 2114, responses: 0)

# Installing WeBWorK on a Red Hat Linux 9.0 System

For WeBWorK version 1.9
Samuel Hathaway <sh002i@math.rochester.edu>;
Arnold Pizer <apizer@math.rochester.edu>;

This document details the setup and configuration of Red Hat 9.0 for use with WeBWorK. Use it along with the Installing WeBWorK on a Linux System document. The information in this document may also be useful when installing WeBWorK on other linux or unix variants. Before beginning the installation, you should also consult the Red Hat 9.0 Installation Guide at http://www.redhat.com/docs/.

Within this document, commands given by root will be prefixed with "#" while commands given by a normal user will be prefixed with ">".

## Step 1: During the Red Hat installation

While installing Red Hat Linux, there are several options that are important to WeBWorK. These are listed below with recommended settings.

Install Type: This affects which packages we will need to install later. We recommend "Server".

Firewall Configuration: If you choose to install a firewall, keep in mind that WeBWorK requires incoming HTTP connections, and you may benefit from allowing other types of inconming connections (such as telnet, SSH, FTP, or SCP) for professors. SSH and SCP servers are installed by default on the "Server System" install type, so opening those ports in your firewall configuration will enable those services.

Account Configuration: Make sure you create at least one user account, in addition to the root account. You can use this user account as the "regular user account" in the setup of WeBWorK.

Package Group Selection: This option is only shown if you choose the "Server System" install type. Here are our recommended selections:

• the "X Window System" package
• the "GNOME Desktop Environment" package
• the "Editors" package
• mozilla in the "Graphical internet" package
• the "Authoring and Publishing" package
• the "Server Configuration Tools" package
• the "Web Server" package
• the "Development Tools" package
• the "Administration Tools" package
Also check "Select individual packages" at the bottom. Install the following individual packages (add them to the already selected packages).

packagedirectorypackage names
perl-CGIDevelopment->Languagesperl-CGI
perl-DB_FileDevelopment->Languagesperl-DB_File
libjpeg-develDevelopment->Librarieslibjpeg-devel
libpng10-develDevelopment->Librarieslibpng10-devel
libpng-develDevelopment->Librarieslibpng-devel

Also select any other packages you want to install at this time (e.g. your favorite editor if it wasn't listed in the "Editors" package). When RedHat checks for dependencies, accept the default of installing additional packages to resolve all dependencies (if any).

## Step 2: system configuration

You can use RedHat's system configuration tools to replace several of the command-line operations in the Installing WeBWorK on a Linux System document. To access these tools, click Main Menu and then System or Server Settings (you will be asked for the root password). In the Red Hat User Manager, under Preferences, uncheck "Filter system users and groups" so you can see all users, e.g. apache.

useradd, usermod, userdelSystem Settings->Users and Groups->Add User
groupadd, groupmod, groupdelSystem Settings->Users and Groups->Add Group
/etc/init.d/httpd, adding apache to rc filesSystem Settings->Server Settings->Services

## Step 3: Starting apache

1. Click Main Menu, System Settings, Server Settings, Services (you will be asked for the root password).
2. Select httpd from the list of services.
3. Click "Start". It is at the top of the panel. After a moment, there should be a message that apache has started.
4. Check the "httpd" checkbox which will start apache at boot time.
5. Click "Save Changes" under the File Menu and then quit Service Configuration

Apache is now started, and will start whenever the computer is rebooted. To verify that apache is working, open Mozilla and open http://localhost/. You should see a page titled "Test Page".

## Step 4: Install the gd graphics library

The GD.pm module installed by CPAN (in Step 5 below) requires version 2 of the gd graphics library. Unfortunately the version of gd distributed with Red Hat 9.0 is 1.8.4. We recommend that you install version 2.0.15 of gd but you could also install version 1.8.4 and then go to http://stein.cshl.org/WWW/software/GD/old and grab GD-1.43.tar.gz and install it by hand.

To install version 2.0.15 goto http://www.boutell.com/gd and download the tar.gz archive for version 2.0.15. As a normal user run the following commands:

> tar -xzf gd-2.0.15.tar.gz> cd gd-2.0.15>./configure --prefix=/usr>make

Then, as root, install it.

# make install

## Step 5: Install the required Perl Modules

Before we begin, as root run

# unset LANG
since otherwise the installation of Time::HiRes will fail. We will use CPAN to install the modules. As this is the first time you're run CPAN, you will be asked to configure it (you can say "no" and it will autoconfigure). As root, run the command
# perl -MCPAN -e shellcpan> install HTML::Parser Net::SMTP MIME::Base64 GD Time::HiRescpan>exit

During the installation of GD select JPEG but not FreeType or XPM support. Otherwise accept all defaults.

## Step 6: Read Installing WeBWorK on a Linux System

At this point, begin reading the Installing WeBWorK on a Linux System document. Keep the following in mind:

• Perl is already compiled with GDBM database support.
• The full path to perl is /usr/bin/perl which you will need to enter when running the WeBWorK set up script.
• You still have to configure LaTeX2HTML. The configuration file is: /usr/share/latex2html/l2hconf.pm. Edit it by setting
$PK_GENERATION = 1;$DVIPS_MODE    = 'toshiba';\$METAFONT_DPI  = 180;
• You need to install TTH.
Get the linux version, untar it
> tar -xzf tth_linux.tar.gz
and then as root copy it to /usr/bin/
# cp tth_linux/tth /usr/bin
• See Step 7 for instructions for installing dvipng.
• Apache on Red Hat 8.0 runs as the user apache in the group apache. When the installaton instructions refer to the user wwserver and the group wwserver, you can substitute apache.
• Apache's configuration file httpd.conf is located in the directory /etc/httpd/conf/ .
• Apache's DocumentRoot is /var/www/html/ and cgi-bin directory is /var/www/cgi-bin/ .
• You will want to use the "ScriptAlias" method of linking WeBWorK's cgi directory to the web server, rather than the symlink method. Be careful to put the ScriptAlias for WeBWorK before the ScriptAlias for cgi-bin in httpd.conf.
• When you run the system_webwork_setup.pl script, you should respond to every question by pressing enter to accept all the defaults.

## Step 7: Install dvipng

First connect to John Jones's site http://hobbes.la.asu.edu/webwork-stuff where you will likely find up to date instructions for installing dvipng. At the time I'm writing this (July 2003), version 0.4 of dvipng is buggy so we'll grab version 0.3. Connect to http://sourceforge.net/projects/preview-latex and download preview-latex-0.7.8.tar.gz and dvipng-0.3.tar.gz (version 0.3).

Then install them by running the following commands:

> tar -xzf preview-latex-0.7.8.tar.gz> cd preview-latex-0.7.8> cd latex> tex bootstrap.ins> tex preview-mk.ins

That creates all of the preview-latex files you need. Then as root,

# mkdir /usr/share/texmf/tex/latex/preview# cp *.sty *.cfg *.def /usr/share/texmf/tex/latex/preview# texhash

Now we install dvipng. First cd to where the tar.gz file resides. As a normal user:

> tar -xzf dvipng-0.3.tar.gz> cd dvipng-0.3> ./configure --prefix=/usr> make

Then as root:

# make install

Good luck!

<| Post or View Comments |>