Skip to content

CentOS install guide

Leo Thomas edited this page Aug 22, 2017 · 48 revisions

LORIS 17.0.*

Ensure you are looking at the branch that matches your release. Note that the master GitHub branch may not be synced to your release.

For the purpose of following LORIS conventions and easy understanding of all LORIS documentation, we recommend the following account names:

  • lorisadmin : Linux user with sudo permission who will setup and manage Loris
  • lorisuser : MySQL user with limited (insert, delete, update, select...) permissions on the Loris database, for database transactions requested by the Loris front end
  • admin : default username for Loris front-end admin account (browser login)

System Requirements

Before continuing to the subsequent sections ensure that the following tools are installed. Sudo permission is required. This section covers installation and recommended versions of:

  • Apache2
  • PHP
  • MySQL
  • PHP Composer

Apache2:

sudo yum install httpd 
sudo service httpd start

PHP:

sudo yum install php php-pdo php-mysql 

NOTE: As of Loris 18.0 php7 is required (but not yet officially supported by CentOS). To upgrade php follow the following instructions

# update php5 -> php7
curl 'https://setup.ius.io/' -o setup-ius.sh
sudo bash setup-ius.sh

# update php7 specific packages
sudo yum remove php-cli mod_php php-common
sudo yum install php70u-json php70-xml mod_php70u php70u-cli php70u-mysqlnd 

MySQL: (Note: Loris dev should skip steps relating to hosting mysql locally. Contact sysadmins for database credentials directly.)

sudo yum install mysql mysql-server

# depending on your centOS configuration either use:
sudo service mysqld start 
    # or
sudo service mariadb start

# and check with either: 
sudo service mysql status
    # or 
sudo service mariadb status

Finalise the mysql/mariadb installation with (follow instructions to create a password the root user):

mysql_secure_installation

PHP Composer:

sudo curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer

LORIS code base

Download the latest release from the releases page to the home directory (~/), unzip it, and copy the contents to /var/www/%PROJECTNAME%.

wget https://github.com/aces/Loris/archive/loris-%version%.zip
unzip loris-%version%.zip
cp -r loris-%version%/* /var/www/%PROJECTNAME%

Alternatively the current development branch can be obtained with:

git clone https://github.com/aces/Loris.git /var/www/%PROJECTNAME%

Setup

Composer: Composer will download LORIS's library requirements, assuming an active internet connection. There may be additional packages to install at this step for composer to exit successfully, be sure to install the php 7 compatible versions of these packages, if necessary.

# Must be run from /var/www/%PROJECTNAME%
# It may be necessary to create the project/libraries/ directory before running  this command
composer install --no-dev

Apache2: A sample apache configuration file is in docs/config/apache2-site. The install script will ask if you want to automatically create/install apache config files. To perform this step manually, copy the sample file to the apache configuration directory (/etc/httpd/conf.d/), and add the .conf file extension:

cp docs/config/apache-site /etc/httpd/conf.d/apache-site.conf

Ensure that paths and settings in this new file are populated appropriately for your server, e.g. replacing placeholders such as %LORISROOT%, %PROJECTNAME%, %LOGDIRECTORY%. Ensure that the DocumentRoot is pointing to the htdocs/ directory under your LORIS root (usually /var/www/loris/htdocs).

Also ensure that your new smarty/templates_c/ directory under the LORIS root is writable by Apache.

chmod 775 /var/www/%PROJECTNAME%/smarty/templates_c

Finally, restart Apache:

service httpd restart
service httpd status

Install LORIS

cd /var/www/%project-name%/tools
./install.sh

point your URL to: http://%IPADDRESS%/installdb.php (%IPADDRESS% will likely be the IP address of the VM you are ssh'ed into) The web page will prompt you for the following information: Server Hostname: localhost if your database if hosted on your VM or the IP address of your database server Admin Username: should be "root" Admin Password: whatever password you set when running the mysql_secure_installation step Database Name: present to "LORIS", can be customized

Click submit, and follow the instructions to enter the username and password of your backend user, and front end admin user.

You may have to manually paste the xml output to /var/www/%PROJECTNAME%/project/config.xml

Your Loris instance should now be accessible by pointing your url to http://%IPADDRESS%

Further configuration can be done using the LORIS configuration module.

If there are any errors or you get a blank page, you'll have to troubleshoot based on the errors in your apache error log (by default /var/log/httpd/error_log)


Caveat: Below are older notes on the CentOS installation process. Not recommended.

NOTE: As of 15.04 CentOS installation is covered by the main LORIS README. Please follow the Readme and use this guide for secondary install troubleshooting assistance as needed.

This is an a guide how to get a LORIS instance Running on CentOS. It has been tested for CentOS version 6.5 for release 14.12. Status note: This guide is under development and should only be used by the Loris dev team.

The following commands assume that you are working from a bare installation of CentOS, without any of the above programs installed. Run the commands one at a time on the CentOS command-line.

sudo yum install httpd
sudo service httpd start
sudo yum install mysql-server
sudo service mysqld start
# Next command sets mysql root password, please choose one.
# enter [Y]es for all other prompts.
sudo /usr/bin/mysql_secure_installation
sudo yum install php php-mysql 
sudo yum install php-pear
sudo yum install nano
sudo yum install git wget unzip
# php composer
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/bin/composer
# tell services to start on boot
sudo chkconfig httpd on
sudo chkconfig mysqld on
sudo service httpd restart

Do a test of apache and php

sudo nano /var/www/html/info.php
# paste the following into the file and save
<?php phpinfo(); ?>

then visit http://localhost/info.php or the IP address of the machine you are working on, e.g. http://192.168.33.10/info.php. You should see the php info page.

Set up admin user

In this section we'll add a new user lorisadmin and give it permission to do administrative tasks.

sudo useradd -U -m -s /bin/bash lorisadmin
# set the password. choose a good one.
sudo passwd lorisadmin
# grant sudo permissions to the user.
sudo nano /etc/sudoers
# the previous command will open the sudoers file for editing. 
# Insert the next line into that file at line 98, then save (ctrl+o) and exit (ctrl+x).
lorisadmin    ALL=(ALL) ALL
su - lorisadmin

Getting the LORIS Code Base

Set the projectname variable and folder. Choose a name for your project, e.g. myloris.

export projectname=myloris
sudo mkdir -m 775 -p /var/www/<project-name>
sudo chown lorisadmin.lorisadmin /var/www/<project-name>

Download the latest release from the releases page to the home directory (~/), unzip it, and copy the contents to /var/www/<project-name>. Note: Currently the CentOS installer script is only available to developers with access to the centos-installer branch.

wget https://github.com/aces/Loris/archive/loris-14.12.zip
unzip loris-14.12.zip
cp -r Loris-loris-14.12/* /var/www/<project-name>

Installing LORIS

Run installer script to install core code, libraries, and MySQL schema (see Loris Installation Schematic). The script will prompt for information, including usernames and folders which it will create automatically.

cd /var/www/<project-name>/tools
./install_centos.sh   **# as of 15.04: ./install.sh** 
sudo service httpd restart

You can now access you LORIS sandbox using the url http://localhost/~$username/loris/htdocs

To access your sandbox on another device, replace localhost with your IP address for your machine.

Clone this wiki locally