Installation Manual for 2.17 on Oracle (and related) Linux

From WeBWorK_wiki
Revision as of 23:54, 9 September 2022 by Alex Jordan (talk | contribs)
Jump to navigation Jump to search

Under Construction

These instructions cover the installation of WeBWorK 2.17 from scratch onto an Oracle Linux server. These instructions will probably mostly work for related Linux flavors such as RHEL 8.

If you are just upgrading WeBWorK, especially if you already have existing WeBWorK courses, see Upgrading WeBWorK from 2.16 to 2.17.

OS Users

These instructions reference four OS users.

  • You should have a personal account with sudo privileges. These instructions will use "myname" as the name of that user.
  • root
  • apache
  • wwadmin (we will create below)

It can be critical that you act as whatever user these instructions tell you to act as at each step. Do not act as root unless specifically instructed to.

Furthermore, when you will need to act as root, either use sudo su or sudo <command> as the instructions say. In certain places, actually switching users to root with sudo su or entering a root shell when a mere sudo someCommand was indicated will result in bad things that will not become apparent until later in the installation.


Now some comments on notation we will be using. We will use <key> to indicate that you should press a specific key (e.g. <Enter>, <Tab>, <F12>, etc.). Sometimes we will also use e.g. <wwadmin password> to indicate you have to enter the wwadmin password.

  • Code blocks that begin with $ should be run as myname.
  • Code blocks that begin with # should be run as root (via either a root shell or switching users to root with sudo su).
  • Code blocks that begin with @ should be run as wwadmin (for which you can use sudo su wwadmin).

You are not intended to type the $, or #, or @ characters as part of the provided commands.


We assume that you already have Oracle (or a closely related Linix distribution) installed, but that you haven't done much with yet.

We assume that you have a user account myname with sudo privileges.

Create wwadmin

$ sudo useradd wwadmin

Install MariaDB

After logging in to your server:

$ sudo yum install mariadb-server mariadb-connector-c mariadb-connector-c-devel

Answer y if it asks if this is OK. (For the remainder of these instructions, such trivial details might be omitted.) Now fire it up.

$ sudo systemctl enable mariadb
$ sudo systemctl start mariadb

Check that it is active with

$ sudo systemctl status mariadb

Now secure the server.

$ sudo mysql_secure_installation

This asks you for the database root password, which is nothing at this point. You should just hit <Enter>. Next there are five questions. Answer as indicated:

  • Set root password? n
  • Remove anonymous users? n
  • Disallow root login remotely? Y
  • Remove test database and access to it? Y
  • Reload privilege tables now? Y

Test that things work:

$ sudo mysql

You should see something close to:

Welcome to the MariaDB monitor.  Commands end with ; or \g.

MariaDB [(none)]> 

Now lets check the MariaDB users. To see the users, do the following

MariaDB> SELECT user,authentication_string,plugin,host FROM mysql.user;

You should see a table with only three users: root, root and root, each with a different host.

Now exit MariaDB

MariaDB> exit

Installing Custom Perl (perlbrew)

RHEL8 does not support some of the necessary perl modules for WeBWorK by default.

Install perlbrew

$ sudo bash
# curl -k  -L >
# chmod u+x
# export PERLBREW_ROOT="/usr/local/perlbrew"
# ./
# source /usr/local/perlbrew/etc/bashrc

In order to be persistent, add the last command to /etc/bashrc, where it will be applied to all users when they log in.

Exit the root shell.

# exit

Install Custom perl

OK, well, go back in to a root shell.

$ sudo bash

Installation of a new perl version is time consuming. You may add several optional flags to speed up the process.

# export CFLAGS='-m64 -mtune=nocona'
  1. # export PERLBREW_CONFIGURE_FLAGS='-des -A ccflags=-fPIC'
  2. # perlbrew -n -j4 --thread install 5.20.3 -Duseshrplib the -n flag skips all tests, and -j# sets the number of parallel threads to use
  3. # perlbrew switch perl-5.20.3 once the perl is built, tell the system which perl you want to use
  4. # perlbrew install-cpanm install cpanminus through perlbrew so that modules are installed for the chosen, active perl

Installing Perl Modules

With cpanminus now installed, we can begin importing the necessary modules from CPAN.

Caveat: the latest version of SQL::Abstract (v2.000001) does not work with WeBWorK -- so we must install an older version (1.87) instead. For some reason, the dependency on Hash::Merge fails during SQL::Abstract installation, so install it separately beforehand.

# cpanm Hash::Merge
# cpanm ILMARI/SQL-Abstract-1.87.tar.gz
# cpanm Archive::Zip Array::Utils Benchmark Carp CGI CGI::Cookie Data::Dumper Data::UUID \
Date::Format Data::Dump Date::Parse DateTime DBD::mysql DBI Digest::MD5 Digest::SHA Email::Address::XS \
Email::Sender::Simple Email::Sender::Transport::SMTP Email::Simple Errno File::Copy File::Find \
File::Find::Rule File::Path File::Spec File::stat File::Temp GD Getopt::Long Getopt::Std HTML::Entities \
HTML::Scrubber HTML::Tagset HTML::Template HTTP::Async IO::File IO::Socket::SSL Iterator Iterator::Util \
JSON JSON::MaybeXS Locale::Maketext::Lexicon Locale::Maketext::Simple LWP::Protocol::https MIME::Base64 \
Net::IP Net::LDAPS Net::OAuth Net::SMTP Net::SSLeay Opcode PHP::Serialization Pod::Usage Pod::WSDL \
Scalar::Util SOAP::Lite Socket Statistics::R::IO String::ShellQuote Template Text::CSV Text::Wrap \
Tie::IxHash Time::HiRes Time::Zone URI::Escape UUID::Tiny XML::Parser XML::Parser::EasyTree XML::Simple \
XML::Writer XMLRPC::Lite mod_perl2 Apache2::Request

You may encounter issues with the XMLRPC::Lite module not installing because of a failed test. You can forcibly install it as follows:

# cpanm --force XMLRPC::Lite

Testing Perl Modules

Don't stress out over this section -- we will later install a script that will check for all necessary modules. Do not feel the need to check that all the modules are properly installed at this point.

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 MXML::Parser::EasyTree is not so

$ perl -MCPAN -e 'print "installed!\n"'




$ perl -MStatistics::R::IO -e 'print "installed!\n"'


Can't locate Statistics/R/ in @INC ...

You can check the version of an installed module by the following command, replacing Module with the name of the module:

 perl -MModule -e 'print "$Module::VERSION\n"'

For example for the module

 perl -MGD -e 'print "$GD::VERSION\n"'

More to come; this page is under construction