-
Notifications
You must be signed in to change notification settings - Fork 186
Installing Loris (After Installing Prerequisites)
The following details steps for Ubuntu 16.04. Your mileage may vary.
- You are on Ubuntu 16.04;
lsb_release -ashould say Ubuntu 16.04 - You'll be ssh'ing into a remote machine. If you are not, just ignore the steps that tell you to
ssh
-
sshinto your remote machine as a user in thesudogroup (likeroot) - Run the following commands in sequence. If you get an error at any of the steps, troubleshoot them before continuing.
sudo apt-get update- If you'll be hosting the database locally,
sudo apt-get install mysql-server - If you'll be hosting the database externally,
sudo apt-get install mysql-client sudo apt-get install -y git zip apache2 sudo curl wget python-software-properties software-properties-commonsudo add-apt-repository ppa:ondrej/phpsudo apt-get updatesudo apt-get install -y php7.0 php7.0-mysql php7.0-xml php7.0-json php7.0-mbstringsudo apt-get install -y composersudo apt-get install -y libapache2-mod-php7.0sudo a2enmod php7.0sudo service apache2 restart
To future maintainers of this documentation,
PHP extensions list populated with:
for e in
composer show --tree | grep -oP '\-\-\K(ext-[a-zA-Z0-9-][a-zA-Z0-9-]*)' | sort | uniq | sed 's/ext-//g'; do sudo dpkg -l | grep -wo php7.0-$e; done;
php7.0-jsonandphp7.0-mbstringare just needed by the Loris code base forjson_encode()/json_decode(), and for the user account module, respectively.
To future maintainers of this documentation,
If you need to know the exact names of the PHP extensions to install, run the following command,
sudo apt-cache pkgnames | grep php7 | sortFor example,
ext-xmlwill have the package namephp7.0-xml, which should be found on the output.
To figure out if you have a specific package installed,
sudo dpkg -l | grep <partial-or-whole-package-name>
So, to figure out if you have php7.0-xml, run sudo dpkg -l | grep php7.0-xml
So, to figure out if you have libapache2-mod-php<version>, run sudo dpkg -l | grep libapache2-mod (remember that partial package names work)
-
<unix-user>= The unix user you ssh with -
<loris-release-url>= The latest Loris release URL -
<project-name>= The name of your project -
<loris-directory>= The name of the Loris install directory -
<loris-host-name>= The host name of your Loris install (eg. www.example.com) -
<loris-url>=<loris-host-name>with a scheme; typicallyhttp://orhttps://(eg. http://www.example.com) -
<mysql-host-name>= The host name of your MySQL server (You usually append:3306to it. Maybelocalhost?) -
<mysql-database>= The database of your Loris install hosted on your MySQL server (Or, if you're not familiar with MySQL, the "schema") -
<mysql-admin-username>= The username of your MySQL admin account (Should have all privileges or all privileges for<mysql-database>) -
<mysql-admin-password>= The password of your MySQL admin account -
<mysql-user-username>= The username of your MySQL user account (Should haveSELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, CREATE TEMPORARY TABLES, LOCK TABLESgranted on<mysql-database>.*) -
<mysql-user-password>= The password of your MySQL user account
-
<unix-user>=lorisadmin<-- A literal string -
<loris-release-url>= No equivalent -
<project-name>=$projectname -
<loris-directory>=$projectname -
<loris-host-name>=$yourHostName/_$yourhost_ -
<mysql-host-name>=$dbhost -
<mysql-database>=$dbname -
<mysql-admin-username>=lorisDBadmin<-- A literal string -
<mysql-admin-password>=$newpassword -
<mysql-user-username>=lorisuser<-- A literal string -
<mysql-user-password>= No equivalent
You may choose to run everything on root but that is not necessarily desirable...
- ssh into your remote machine as a user in the
sudogroup (likeroot) - Run
sudo useradd -U -m -G sudo -s /bin/bash <unix-user> - Run
sudo passwd <unix-user> - Run
su - <unix-user> - You should now be ssh'd as
<unix-user>
In this example, loris-install-dude is the <unix-user>

Make sure you're ssh'd as <unix-user>
- Run
cd /var/www(Or where yourapache2is serving files from) - Run
sudo mkdir -m 775 -p <loris-directory> - Run
sudo chown <unix-user>.<unix-user> <loris-directory>
If
cd /var/wwwfails, saying the directory does not exist, make sure you have apache2 installed and that the directory/var/wwwis readable (and, later, writable) by the current unix user (which should be the case)
To check if you have apache2 installed, run
apache2 -v. If you get an error, you do not have apache2 installed and should go install it withsudo apt-get install apache2
In this example, LorisInstall is the <loris-directory>

Developers, ignore this. Move on to Instructions for developers.
If you're a non-developer that wants to use Git, ignore this. Move on to Instructions for developers.
- Go to the Loris repository
- Look for "releases"
- Click it
- Look for the "Latest release" label
- Look for the "Source code" URL(s)
-
Right-click the
.zipURL - Copy the URL (AKA "link address")
- You now have the
<loris-release-url>
The "releases" location:

The "Latest release" and "Source code" locations:

Developers, ignore this. Move on to Instructions for developers.
If you're a non-developer that wants to use Git, ignore this. Move on to Instructions for developers.
Make sure you're ssh'd as <unix-user>
- Run
cd /var/www(Or where yourapache2is serving files from) - Run
cd <loris-directory> - Run
sudo wget <loris-release-url> -O release.zip - Run
sudo unzip release.zip - Run
ls - You'll see a directory name that looks like
Loris-XX.X.X, we'll call it<loris-release-directory> - Run
sudo mv <loris-release-directory> Loris - Run
ls - You should see that
<loris-release-directory>has been renamed toLoris - Run
sudo rm release.zip
Downloading and unzipping:

Renaming and cleaning up:

Non-developers may ignore this. It involves using Git.
- Do everything here first
If the install script installs
composerfor you, delete it immediately. You should installcomposerseparately usingsudo apt-get install composeror an equivalent command.
Make sure you're ssh'd as <unix-user>
- Run
cd /var/www(Or where yourapache2is serving files from) - Run
cd <loris-directory> - Run
cd Loris/tools - Run
sudo ./install.sh - Fill in your
<project-name>(You get to choose what it is) - Determine if you want
install.shto configure apache2 for you - Key in
<unix-user>'s password - Wait
- Installation complete
If you get an error in the install step, you might be missing
ext-xml. The prerequisites are listed at the top of this page andext-xmlis one of them. To resolve this, runsudo apt-get install php<version>-xml. If you're running PHP 7.0, it will besudo apt-get install php7.0-xml. If you're running PHP 7.1, it will besudo apt-get install php7.1-xml.
In this example, LorisInstall is also the <project-name> for consistency. Your project name shouldn't differ too much from your <loris-directory>.

Assuming you let the install script configure apache2 for you but it didn't work out for some reason.
- Run
sudo a2enmod rewrite - Run
sudo a2ensite <project-name> - Run
sudo service apache2 restart

- Figure out the
<mysql-host-name>(maybelocalhost?) - Create a
<mysql-database>for Loris (Optional) - The
<mysql-admin-username>should have ALL privileges granted on<mysql-database>(Or all privileges on the entire MySQL server, likeroot) - Don't forget your
<mysql-admin-password>!
- The
<mysql-user-username>should haveSELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, CREATE TEMPORARY TABLES, LOCK TABLESgranted on<mysql-database>.* - Don't forget your
<mysql-user-password>!
If you are installing "Raisinbread", DO NOT PROCEED. If you don't know what "Raisinbread" is or are not installing it, please proceed.
Instructions for Raisinbread are here
- Figure out your
<loris-url> - Open your internet browser
- Navigate to
<loris-url>/installdb.php - Fill in
<mysql-host-name>(maybelocalhost?) - Fill in
<mysql-admin-username> - Fill in
<mysql-admin-password> - Fill in
<mysql-database> - If you're a summer student, chances are, your database will have already been created for you. So, check the Use Existing Database checkbox.
- If you're a summer student, chances are, you installed a sample data set. So, check the Do Not Install checkbox.
- Submit

- Fill in
<mysql-user-username> - Fill in
<mysql-user-password> - If you're a summer student, chances are, your MySQL user will have already been created for you. So, check the Already Created checkbox.
- Fill in
<loris-admin-username>, you get to decide on whatever it is! - Fill in
<loris-admin-password>, you get to decide on whatever it is! - Don't forget your
<loris-admin-username>and<loris-admin-password>! - Submit
- A
config.xmlfile will have been created at<loris-directory>/Loris/project - The
projectfolder is where your custom files go, all files in the folder are ignored by git
Filling in information:

Done!

- Open your internet browser
- Navigate to
<loris-url> - Fill in
<loris-admin-username> - Fill in
<loris-admin-password> - Log in
- Maybe add your username and password to a password manager?

Check the following
-
The
'base'path is configured correctly (this should be the case if done automatically). The path has to end with a forward slash/and should look like,/var/www/<loris-directory>/Loris/. -
That
<loris-directory>/Loris/smarty/templates_cexists; if it doesn't,cd <loris-directory>/Loris/smartysudo mkdir templates_csudo chmod 777 templates_c
-
That
<loris-directory>/Loris/smarty/templates_cis owned bywww-data(Runls -alto check) or has777permissions (Not ideal butinstall.shdoes something similar, Runsudo chmod 777 <loris-directory>/Loris/smarty/templates_c)