Learning Toolkit+ (LTK+)

Server Setup Guide

This guide was created by the Center for the Study of Learning and Performance (CSLP) for use by clients who wish to host the Learning Toolkit+ (LTK+) on a local server. The instructions included will work for web server setup in general, but the configurations suggested have been tailored to the needs of these software packages.


How To Use This Guide

Begin by reading the Introduction and LTK+ overview in the Web server setup tab below. Then select the tab corresponding to the operating system that you will be using on your web server, read the overview, and follow the corresponding instructions.


Introduction

Turning a computer into a web server can be a challenging task. These instructions guide you through the standard steps involved in setting up a web server on your MacOS, Windows, or Linux PC. If all goes well, the experience will be close to the one outlined here. The details will vary from server to server. In some cases, additional undocumented steps may be required. You may need to consult official online documentation or forums in unexpected situations.


The Audience of this Guide

This guide is intended for technicians who:

  1. Are comfortable navigating and configuring the operating system on their server.
  2. Know what a web server is and what it is used for.
  3. Are comfortable adapting general technical instructions to match their situation.

This guide is a compilation of the steps necessary to set up a web server so that you do not have to search for them on the internet. This guide cannot, however, teach you the necessary background from scratch. If you have limited experience, you may still be able to succeed through patience, perseverance, willingness to learn, and willingness to look for help in online forums and documentation. If you do not feel comfortable with the language in this manual, you will need to request the help of a more experienced technician.


Server Machine Pre-Requisites

The resources (CPU, RAM, etc) required by a web-server are decided by the web sites and web applications that will be installed on it and by the number of users that will be accessing it simultaneously. Presently, a bottom-of-the-line off-the-shelf desktop PC is sufficient for a modest web-server and will be able to serve content to a few dozen simultaneous users. The minimum server requirements for hosting an LTK+ installation can be found in the LTK+ overview link below.


Network Pre-Requisites

In order for a web-server to communicate with a user's computer, the HTTP/HTTPS port(s) must not be blocked by any software or hardware between the server machine and the user machines. By default, HTTP uses port 80 and HTTPS uses port 443. When troubleshooting network problems, examine anti-virus software, firewall software, routers and proxy-servers as any of them could be responsible for blocking the given port(s).


What is in this Manual?

This manual instructs you on how to:

  1. Turn your MacOS, Windows, or Linux PC into web server using IIS (PC) and Apache (Mac, Linux)
  2. Install the PHP scripting language (including the GD extension) on you web server
  3. Install the MySQL database software on your web server

Software Versions

The version numbers for the various components that this manual guides you to install may change over time. New versions are added while others become unavailable. We will always strive to use landmark versions that are regarded as particularly stable. We will not suggest upgrading versions merely because a new one has come out.


A Note About Multi-Purpose Servers

This guide assumes that your server's sole purpose is to be a web server that hosts one web application. It is certainly possible to use the same server for additional tasks but doing so adds new variables into the setup process and is therefore beyond the scope of this guide.


What Next?

Next, read the LTK+ overview link below. Then continue by reading the overview for your server's operating system.

LTK+ overview

The Learning Toolkit+ (LTK+) is a suite of applications working in tandem to develop students' literacy and self-regulation skills. ePEARL, a dynamic, electronic portfolio, is at the heart of the LTK+ and it can be used alone or in conjunction with ABRACADABRA, IS-21, ELM and READS.


Minimum Server Requirements

Providing the LTK+ is the only application on the server:

  • Processor: 2 GHz minimum, 2.5 GHz (4-core) recommended
  • RAM: 2 GB minimum, 8 GB recommended
  • Internet connection: 300kb/s upload bandwidth minimum, 1000kb/s recommended

This recommendation supports 30 to 60 users using the portfolio at the same time.


Load Tests

The tests performed show the following results. Please note that the number of concurrent users represents the number of users that are performing an action at the same instant. In practice, a classroom of 30 students will never be perfectly synchronized, and will behave more like 10-20 concurrent users.

  • A 3200 MHz server supports 30 concurrent users, for an average response time of 1.6 seconds. Pages are received at 100 kb/s. For 25 users, the response time decreases to 1.33 seconds, and page reception is at 124 kb/s.
  • A server equaling 2 x 3060 MHz supports 60 concurrent users, for an average response time of 1.57 seconds. Pages are received at 39.9 kb/s. For 45 users, the response time decreases to 1.18 seconds, and page reception is at 52.3 kb/s

Required Software

The LTK+ uses the PHP scripting language and a MySQL database. The minimum required versions are PHP 7.3.0 (with GD support) and MySQL 5.6. The maximum versions are currently PHP 8.2.x and MySQL 8.0.x. The LTK+ has not been tested on PHP 8.3+ and therefore its use is discouraged. MySQL "Innovation Release" versions are not supported. Apache or IIS may be used as the web server software.


Installing the LTK+

After you have successfully set up and configured your web-server, you will need to download the LTK+ Administrator's guide and follow installations instructions. The latest version of the LTK+ and all it's guides are always available here: https://grover.concordia.ca/ltk/download-site/

Windows overview

Windows web-server setup instructions guide you through making a WIMP server. WIMP stands for Windows, IIS, MySQL, and PHP which are the names of the server software this type of web server will use. Follow instructions found in each of the links below to set up your server.

These instructions were written following a Windows Server 2016/2019 server that runs IIS 10. However, the steps should be compatible to those needed for other versions of windows as well. If you find any important discrepancies, please let us know by writing to .


Remember your MySQL Login Information!

As you go through this procedure, remember to make note every time you are asked to choose a username or a password. Especially your MySQL login information.


Post-Installation Reference

When you are done installing your web server, here is what you will need to know. Write this down or remember to come back when you need it.

  • Web root directory: C:\Inetpub\wwwroot
  • PHP configuration file: C:\PHP\php.ini
  • How to start, stop, or restart IIS: Start > Administrative Tools > Internet Information Services (IIS) Manager (in older versions, may be located at Start > Start > Control Panel > Administrative Options > Internet Information Service)
  • Default MySQL login information (if you didn't change it):

    username: root

    password: (blank)

Windows IIS setup

Internet Information Services (IIS) is a web server that comes with Windows Server 2016 / 2019. If it is not already installed on your computer, you may need your Windows Installation CD to install it. For older versions of Windows, the instructions are slightly different from Windows Server 2016 / 2019. Please follow the instructions corresponding to your Windows version.


Windows Server 2016 / 2019

The following instructions were written following a Windows Server 2016 / 2019 server that runs IIS 10.

  1. Installation:
    1. Open SERVER MANAGER
    2. Select ADD ROLES AND FEATURES (this can be done in the Dashboard)
    3. If you see the "Before You Begin" page, click NEXT
    4. Installation Type: Select ROLE-BASED OR FEATURE-BASED INSTALLATION and click NEXT
    5. Server Selection: Select the server and click NEXT
    6. Server Roles: Check the WEB SERVER (IIS) checkbox
    7. "Add features required for Web Server (IIS)?" dialog appears:
      • Check the INCLUDE MANAGEMENT TOOLS (IF APPLICABLE) checkbox
      • Click ADD FEATURES and then click NEXT
    8. Features: Click NEXT
    9. Web Server Role (IIS): Click NEXT
    10. Role Services: Check the CGI checkbox (and keep the ones already checked). NOTE: The CGI checkbox can be found under the "Application Development" category
    11. Click NEXT
    12. Confirmation: Click INSTALL
    13. Results: Click CLOSE
  2. Configuration:
    1. Open INTERNET INFORMATION SERVICES (IIS) MANAGER
    2. Select the computer from the list of Connections
    3. If you see the "Do you want to get started with Microsoft Web Platform..." dialog, click CANCEL
    4. Double-click on ISAPI AND CGI RESTRICTIONS
    5. Click on EDIT FEATURE SETTINGS...
    6. Check the ALLOW UNSPECIFIED CGI MODULES checkbox
    7. Click OK

Windows Server 2012

The following instructions were written following a Windows Server 2012 server that runs IIS 8.

  1. Installation:
    1. Open SERVER MANAGER
    2. Select ADD ROLES AND FEATURES (this can be done in the Dashboard or in the Tools menu)
    3. If you see the "Before You Begin" page, click NEXT
    4. Installation Type: Select ROLE-BASED OR FEATURE-BASED INSTALLATION and click NEXT
    5. Server Selection: Select the server and click NEXT
    6. Server Roles: Check the WEB SERVER (IIS) checkbox
    7. "Add features required for Web Server (IIS)?" dialog appears:
      • Check the INCLUDE MANAGEMENT TOOLS (IF APPLICABLE) checkbox
      • Click ADD FEATURES and then click NEXT
    8. Features: Click NEXT
    9. Web Server Role (IIS): Click NEXT
    10. Role Services: Check the CGI checkbox (and keep the ones already checked). NOTE: The CGI checkbox can be found under the "Application Development" category
    11. Click NEXT
    12. Confirmation: Click INSTALL
    13. Results: Click CLOSE
  2. Configuration:
    1. Open INTERNET INFORMATION SERVICES (IIS) MANAGER
    2. Select the computer from the list of Connections
    3. If you see the "Do you want to get started with Microsoft Web Platform..." dialog, click CANCEL
    4. Double-click on ISAPI AND CGI RESTRICTIONS
    5. Click on EDIT FEATURE SETTINGS...
    6. Check the ALLOW UNSPECIFIED CGI MODULES checkbox
    7. Check the ALLOW UNSPECIFIED ISAPI MODULES checkbox
    8. Click OK

Windows Server 2008

The following instructions were written following a Windows Server 2008 R2 server that runs IIS 7.

  1. Installation:
    1. START > ADMINISTRATIVE TOOLS > SERVER MANAGER
    2. In the left-side pane, select ROLES
    3. Click ADD ROLES
    4. If you see the "Before You Begin" page, click NEXT
    5. Check the WEB SERVER (IIS) checkbox
    6. Click NEXT
    7. Click NEXT
    8. Check the CGI checkbox (and keep the ones already checked)
    9. Click NEXT
    10. Click INSTALL
    11. Click CLOSE
  2. Configuration:
    1. START > ADMINISTRATIVE TOOLS > INTERNET INFORMATION SERVICES (IIS) MANAGER
    2. Select the computer from the list of Connections
    3. Double-click on ISAPI AND CGI RESTRICTIONS
    4. Click on EDIT FEATURE SETTINGS...
    5. Check the ALLOW UNSPECIFIED CGI MODULES checkbox
    6. Check the ALLOW UNSPECIFIED ISAPI MODULES checkbox
    7. Click OK
Windows PHP setup

PHP: Hypertext Preprocessor is a popular server-side scripting language used for building web pages. It can be downloaded for free. We will guide you through installing PHP 8.1. The minimum required version of PHP is 7.3.0 and the maximum version is currently 8.2.x. The LTK+ has not been tested on PHP 8.3+ and therefore its use is discouraged. Please ensure that IIS (or Apache) is already installed before you install PHP.

  1. Installation:
    1. Download the PHP 8.1 "Non Thread Safe" zip file from: https://windows.php.net/download/#php-8.1

      Choose the zip that corresponds to your Windows architecture (32-bit or 64-bit).

      Note: If you do not have the required Visual C++ Redistributable for Visual Studio for your version of PHP, you will need to download and install it.

    2. Extract the contents to C:\PHP
  2. Configuration IIS with PHP:
    1. Open this guide: https://php-legacy-docs.zend.com/manual/php5/en/install.windows.legacy.index#install.windows.legacy.iis7
    2. Follow the instructions in the "Using IIS Manager user interface to create a handler mapping for PHP" section to create a handler mapping for PHP.
    3. Follow the instructions in the "Set index.php as a default document in IIS" section to add index.php as a default document.

      In IIS 7+, this can also be done under Default Document in IIS Manager

    4. Follow the instructions in the "FastCGI timeout settings" section to adjust FastCGI timeout settings - set Activity Timeout and Request Timeout to at least 10800 seconds (180 minutes)

      In IIS 7+, this can also be done under FastCGI Settings in IIS Manager

    5. (Optional) Follow the instructions in the "FastCGI and PHP Recycling configuration" to adjust additional FastCGI settings
  3. Configuration PHP settings for LTK+:
    1. Open php.ini for editing (PHP's configuration file).

      C:\PHP\php.ini

      Note: If there is no php.ini file, create one by copying the sample php.ini-production file.

    2. Make the following changes:
      1. Search for: memory_limit

        Change this line to: memory_limit = 128M

      2. Search for: post_max_size

        Change this line to: post_max_size = 25M

      3. Search for: upload_max_filesize

        Change this line to: upload_max_filesize = 20M

      4. Search for: Paths and Directories

        Set the extension_dir to "ext" (you may need to add a new line for this)

      5. Search for: extension=gd

        Uncomment this line (remove ";" from the beginning of the line).

      6. Search for: extension=mbstring

        Uncomment this line (remove ";" from the beginning of the line).

      7. Search for: extension=mysqli

        Uncomment this line (remove ";" from the beginning of the line).

      8. Search for: session.auto_start

        Change this line to: session.auto_start = 0

      9. Search for: session.gc_maxlifetime

        Change this line to: session.gc_maxlifetime = 10800

    3. (Optional) If you plan to import student information from GPI databases, then keep php.ini open and proceed to Windows GPI Setup.
Windows MySQL setup

MySQL is a widely used open-source database. It is commonly used with web applications like ePEARL. We will guide you through installing MySQL 8.0. The minimum required version of MySQL is 5.6 but the latest version is recommended (except "Innovation Release" versions).

  1. Installation & Configuration:
    1. Download MySQL Community Server from https://dev.mysql.com/downloads/mysql/8.0.html#downloads.

      Choose the MySQL Installer MSI download.

    2. Double-click on the downloaded file to being MySQL installation.
    3. Follow these instructions:
      1. Proceed until the "Choosing a Setup Type" page of the wizard
      2. Choosing a Setup Type: Select SERVER ONLY and click NEXT
      3. Installation: Click EXECUTE and then NEXT
      4. Product Configuration: Click NEXT
    4. You will be taken to the configuration wizard. Follow these instructions:
      1. Type and Networking:

        Change the Config Type to SERVER COMPUTER

        Click NEXT

      2. Authentication Method:

        Click NEXT

      3. Accounts and Roles:

        Enter a new root password. (Write this password down!)

        Retype the password.

        Click NEXT

      4. Windows Service:

        CONFIGURE MYSQL SERVER AS A WINDOWS SERVICE should be checked

        START THE MYSQL SERVER AT SYSTEM STARTUP should be checked

        Click NEXT

      5. Server File Permissions:

        Click NEXT

      6. Apply Server Configuration:

        Click EXECUTE

        Click FINISH

      7. The installer returns to the "Product Configuration" page:

        Click NEXT

      8. Installation Complete:

        Click FINISH

Windows GPI setup (optional)

Additional steps are required in order to support importing GPI school data. GPI requires a Microsoft SQL Server connection which requires additional PHP libraries. Different libraries must be included depending on your version as described in the "Additional PHP Configuration" section below.

It is highly recommended that you raise the server's PHP memory limit when importing from GPI.

  1. Open php.ini for editing (PHP's configuration file).

    C:\PHP\php.ini

  2. Make the following changes:

    Search for: memory_limit

    Search for: memory_limit = 512M

After you have finished importing from GPI you can change your memory limit back to the recommended settings (128M).


Additional PHP Configuration

  1. Download Microsoft Drivers for PHP for SQL Server:
    1. See the following System Requirements to determine which version of SQLSRV you should download: https://msdn.microsoft.com/en-us/library/cc296170.aspx
    2. Download the appropriate version of SQLSRV from: https://docs.microsoft.com/en-ca/sql/connect/php/download-drivers-php-sql-server
  2. Depending on the version of SQLSRV downloaded, you will either have a Zip file (e.g. "SQLSRV510.ZIP") or an executable file (e.g. "SQLSRV59.EXE").
    • For Zip downloads, extract the files into your PHP library folder (ext) most likely found under "C:\PHP".

    • For executable downloads, follow these steps:

      1. Click "Yes"
      2. Click "Browse" and select your PHP library folder (ext) most likely found under "C:\PHP".
      3. Click "OK"

    You should now have several new libraries added to your ext folder.

  3. Open php.ini for editing (PHP's configuration file)

    C:\PHP\php.ini

    Make the following changes:

    1. Search for your other extensions: extension=

      Depending on the version of PHP installed, append the corresponding extension to the bottom of the extension list:

      Note this assumes you are using a non-thread safe version of PHP

      PHP 8.2
      • For 32-bit (x86): extension=pdo_sqlsrv_82_nts_x86
      • For 64-bit (x64): extension=pdo_sqlsrv_82_nts_x64
      PHP 8.1
      • For 32-bit (x86): extension=pdo_sqlsrv_81_nts_x86
      • For 64-bit (x64): extension=pdo_sqlsrv_81_nts_x64
      PHP 8.0
      • For 32-bit (x86): extension=pdo_sqlsrv_80_nts_x86
      • For 64-bit (x64): extension=pdo_sqlsrv_80_nts_x64
      PHP 7.4
      • For 32-bit (x86): extension=pdo_sqlsrv_74_nts_x86
      • For 64-bit (x64): extension=pdo_sqlsrv_74_nts_x64
      PHP 7.3
      • For 32-bit (x86): extension=pdo_sqlsrv_73_nts_x86
      • For 64-bit (x64): extension=pdo_sqlsrv_73_nts_x64
  4. Note: If you are using SQLSRV Version 5.10 or higher and receive an error message when trying to use GPI that states the Microsoft ODBC Driver 18 is not installed, you can download it using one of the links below. Choose the link that corresponds to your Windows architecture (32-bit or 64-bit)

    Note: If you are using SQLSRV Version 5.2 or higher and receive an error message when trying to use GPI that states the Microsoft ODBC Driver 17 is not installed, you can download it using one of the links below. Choose the link that corresponds to your Windows architecture (32-bit or 64-bit)

    Note: If you are using SQLSRV Version 4.0 or higher and receive an error message when trying to use GPI that states the Microsoft ODBC Driver 13.1 is not installed, you can download it using one of the links below. Choose the link that corresponds to your Windows architecture (32-bit or 64-bit)

MacOS overview

Depending on your version of MacOS, it may come with some of these server components already installed. Apache, for instance, is included as part of the standard MacOS installation.

PHP and MySQL are trickier. While PHP is frequently installed, many versions lack a needed module and may need to be replaced. MySQL is inconsistently installed across different versions of MacOS and these instructions therefore assume that it is not present - you are welcome to look up whether you already have MySQL installed, but there is no harm in simply installing it again.

The instructions below were written for MacOS Catalina (MacOS 10.15) or higher. If you find any important discrepancies from your experience, please let us know by writing to .


Alternative Method

If you do not require as much control over your server, only wish to run the LTK+ on a single computer, or cannot complete server setup to match LTK+ requirements otherwise, then you may want to consider installing the free or paid versions of the programs MAMP (https://www.mamp.info) or XAMPP (https://www.apachefriends.org) instead. Both these programs already include Apache2, MySql and PHP, and becomes the program you use to control your server services in place of MacOS.

MacOS Apache setup

Setting up Apache on MacOS involves configuring the built-in Apache HTTP Server that comes with the operating system. To begin, you can check the status of Apache by using the Terminal command apachectl -v. You can start the Apache server with sudo apachectl start and stop it with sudo apachectl stop

If you need to configure Apache or make changes to its settings, you can do so by editing the Apache configuration files. The main configuration file is typically located at /etc/apache2/httpd.conf

This process is usually equally simple in other versions of macOS. However, the details of this action might change depending on the version.

MacOS PHP setup

PHP is installed in many versions of Mac OS and most versions of Mac OS X Server by default, but it may not be a version that is supported by the LTK+.

If the PHP version does not meet the LTK+ requirements, you will need to change the version of PHP you have installed. Information on how to install PHP on MacOS can be found online at https://www.php.net/manual/en/install.macosx.packages.php. You may need to research the process for your specific situation, as the installation process may vary depending on your operating system.

If you find that you cannot run or install a supported version of PHP, then you may want to try installing and running a program like MAMP or XAMPP (see the MacOS overview section). Failing that, you may have to try a different system altogether.

Once you have ensured your PHP version meets the requirements; we need to make sure the Apache web server is configured to run PHP. To enable PHP, open the macOS Server application and, in the "Websites" tab, check the "Enable PHP" option under Web Applications.

MacOS MySQL setup

MySQL

To install MySQL:

  1. Download MySQL:
    1. Go to https://dev.mysql.com/downloads/mysql/
    2. Select the version that best matches your server
  2. Installation
    1. Open the mysql-x.x.xx-.dmg and double-click the .pkg file inside
    2. Follow the installation instructions. For more help, see: https://dev.mysql.com/doc/refman/8.0/en/macos-installation-pkg.html
    3. Helpful information can also be found at https://dev.mysql.com/doc/refman/8.0/en/macos-installation-notes.html

Tips for Interacting with MySQL

By default, mysql installations reside in the /usr/local/mysql/ folder. You can have more than one version of MySQL present on your system. This causes no harm as long as you don't try to run more than one version at the same time.

Be sure to use commands that reach your intended version by specifying the full path (starting with /usr/local/mysql/), or make sure your shell's path variable is set to direct to that version.


Starting MySQL

If you have installed the MySQL Preference Pane, then open System Preferences and find the MySQL option. Click Start MySQL Server to start the service.

Otherwise, you can also start the service it from the Terminal:

sudo /usr/local/mysql/support-files/mysql.server start


Running MySQL in the Terminal

Find the location of the MySQL executable and then use that path in the following command in Terminal in order to run it:

/usr/local/mysql/bin/mysql -u root -p

Enter the password you were given by the MySQL installer. You will now be interacting with MySQL.


Changing the default password

In order to do any other actions, such as creating databases or adding users, you may need to set a new password. The MySQL command to update a user's password is:

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';

Then also update the LTK+ folder's config.php document with this new password.

Now you can create the database that will be used by the LTK+, and ensure that the config.php file has the same database name for the 'mysql_database'.


Common issues

If running the LTK+ site displays the error that it cannot connect to MySQL, even when you have ensured it is running and correctly installed, try changing the 'mysql_host' name in the LTK+ folder's config.php file to '127.0.0.1' and reloading the page. If this change solves the issue, your server might not be set to listen to the file system socket.

If you have issues with the ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' ensure that the service has started. See the Starting MySQL section. This error can have many causes, however since this file is created when the service is started, starting the service again may sometimes solve the issue.

Linux overview

Linux setup instructions are organized differently than those for Windows and MacOS. Linux instructions are inconsistent from one distribution type to the next and so, rather than grouping instructions by server component, they are grouped by distribution type. In all cases you will be asked to run security updates on the server and use its built in package manager to install the needed software.

If you would like to try installing the software for a distribution type that is not covered below, you will probably be able to do so by taking hints from these instructions and doing a bit of research. If you find any important discrepancies between your install experience and these instructions, please let us know by writing to .

Linux setup

Choose the guide corresponding to your Linux distribution