Difference between revisions of "Installation Manual for 2.17 on Oracle (and related) Linux"

From WeBWorK_wiki
Jump to navigation Jump to search
m
m
Line 96: Line 96:
 
== Apache 2 and mod_perl ==
 
== Apache 2 and mod_perl ==
   
Install apache (httpd).
+
Install apache (httpd) and mod_perl.
   
 
$ sudo yum install httpd
 
$ sudo yum install httpd
  +
$ sudo yum install mod_perl
  +
$ sudo yum install libapreq2
   
 
Enable httpd service.
 
Enable httpd service.

Revision as of 14:23, 10 September 2022

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.

Notation

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.

Assumptions

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
Bye
$

Check perl version

The Oracle distribution used for this installation write-up has perl 5.26.3. Check if perl is installed and what its version is.

$ perl --version

Apache 2 and mod_perl

Install apache (httpd) and mod_perl.

$ sudo yum install httpd
$ sudo yum install mod_perl
$ sudo yum install libapreq2

Enable httpd service.

$ sudo systemctl enable httpd.service

Now enable the MPM-prefork module (and disable the MPM-event module)

$ sudo vim /etc/httpd/conf.modules.d/00-mpm.conf

Uncomment the mpm_prefork_module statement and comment out the mpm_event_module

LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
#LoadModule mpm_event_module modules/mod_mpm_event.so

Next we add configuration files that will add the mod_perl and Apache request modules.

$ sudo vim /etc/httpd/conf.modules.d/02-perl.conf

Add the line LoadModule perl_module modules/mod_perl.so and save the file.

$ sudo vim /etc/httpd/conf.modules.d/apreq.conf

Add the line LoadModule apreq_module modules/mod_apreq2.so and save the file.

Then we configure Apache with our basic server info

$ sudo vim /etc/httpd/conf/httpd.conf

Uncomment and change the server name:

ServerName yourserverhost.edu

And finally, we need to make sure that the shared libraries have been properly identified

$ sudo ldconfig -v

You should now be able to start up the httpd service

$ sudo systemctl start httpd

Oops, it's not working. Stopping here for now.

Now we have to set your server's fully qualified domain name. Note that if your network was set up automatically via DHCP, your server's fully qualified domain name should already be set up. You can check by running the hostname commands below.

Run the command

sudo hostnamectl set-hostname webwork
[sudo] password for wwadmin: <wwadmin password>

where of course you should replace webwork by whatever your server's name is.


You can check these settings by running the commands

$ hostname --fqdn

and

$ hostname

The first gives the server's fully qualified domain name (e.g. webwork.mydepartment.myschool.edu) and the second the server's name (e.g. webwork).

Note that if your server can not find its fully qualified domain name, certain tools may not start.

Now restart Apache

$ sudo systemctl restart httpd
[sudo] password for wwadmin: <wwadmin password>

and test your server by connecting to "http://localhost/" and/or connecting to your server from a browser on a remote machine. You should see the Red Hat Enterprise Linux Test Page indicating that Apache is running.

If you have problems now or in the future, a good first thing to do is to look at the Apache error log which is located at /var/log/httpd/error_log. In the directory /var/log/httpd/ you can "less" through the error log (less error_log), look at the last few entires (tail error_log) or run the command tail -f error_log which will display new error messages as they are appended to the file. Use ^C to break out of tail -f .

More to come; this page is under construction