Repository navigation
MetaLIMS v2.0 Full Manual Installation
#Table of Contents Note: Installation requires sudo user privileges
MetaLIMS tested using XAMPP on Windows 7 & 8 and LAMPP stack on CentOS release 6.6 (Final)
Development: XAMPP v3.2.1 - Apache 2.4.10, MySQL 5.6.20 (no STRICT_TRANS_TABLES mode), PHP 5.5.15 (with mysqli module), phpmyadmin 4.2.7.1
Production: LAMPP - Apache 2.2.15 , MySQL 5.5.43 (no STRICT_TRANS_TABLES mode), PHP 5.5.25 (with mysqli module), phpmyadmin 4.4.9
Instructions Assume the Following:
-
LAMPP stack is already installed and set-up
-
Mail feature is set up in php configurations (used for password reset, project name approval requests, and user registration)
-
Php includes mysqli module and MYSQL does not use STRICT_TRANS_TABLES mode
-
User is responsible for appropriate mysql back-ups and db security
-
User has advanced beginner to intermediate cli knowledge - (beginners are recommended to use the Hosted Installation option)
Option to use installation scripts:
Please note that users who wish to install on a Ubuntu 16 or Ubuntu 14 system can make use of our deployment scripts. Please see the following instructions for usage :
Both scripts assume installation of PHP5 (Ubuntu14) and PHP7 (Ubuntu 16) and the most current version of sendmail.
Note: Consider 'Create a Self-Signed SSL Certificate for Apache (optional)' step for added security (only available for Ubuntu 16 at this time)
Log into your terminal (remember to login as a user with sudo privileges)
Change directories in your terminal to your document root directory
This is the directory where your web application files are served from. This can be different for different servers.
If you are using a hosted service, please check their documentation for which folder is your hosted folder. For our example our document root will be the folder ‘/var/www/html’
cd /var/www/html
Install Git
If using Ubuntu:
sudo apt-get install git
If using Centos:
sudo yum install git
Download MetaLIMS from Github (checkout v2.0)
sudo git clone --single-branch https://github.com/cheinle/MetaLIMS.git --separate-git-dir=../seperate_git_directory
cd MetaLIMS
sudo git checkout v2.0
This git clone command allows uses to only download the desired branch and also stores any git directories outside of webroot. Command assumes that you are cloning into your base webroot directory
If stored in a subdirectory of document root directory, set path to these files at the top of the page in variable $path_to_webroot in login.php near ‘Set Variable For Document Root Path’ and variable $logout_path in path.php. This will be the path from your document root directory to any subdirectory within it. If you are placing the MetaLIMS folder in the top level of the document root directory, then skip to next step on "Separate ‘Important Accessories.zip’ from files and remove from webroot".
Else, if you are not already in the MetaLIMS directory, change into it
cd MetaLIMS
vi login.php
If using vi editor, type 'i' to begin editing document. Change variable $path_in_webroot , save and exit using [esc] : wq [enter]

vi path.php
If using vi editor, type 'i' to begin editing document. Change variable $logout_path, save and exit using [esc] : wq [enter]
Open MetaLIMS directory (if not already inside)
cd MetaLIMS
Move ‘Important Accessories.zip’ out of webroot
Zip file contains four files:
- database_schema.pdf
- metalims_empty.sql
- metalims_demo.sql
- example_connection.php
sudo mv Important Accessories.zip /var/www/
Unzip
sudo unzip ../../Important Accessories.zip
Store connection to database in file above the document root folder so that it is not exposed to the web (Example of connection is in example_connection.php)
If you are in your document root folder, change directories to one directory level outside of the document root directory
cd /var/www/
Then make a directory called metalims_config
sudo mkdir metalims_config
Make a file called connection.php and copy the contents of ‘example_connection.php’ (stored in the Important Accessories.zip file just unzipped) to it (we will edit this later). Do this by copying the 'example_connection.php' file from the Important Accessories directory into your metalims_config folder
cd /var/www/Important Accessories/
sudo cp example_connection.php /var/www/metalims_config/connection.php
Change back to metalims_config folder
cd /var/www/metalims_config/
Ensure read permissions for ‘other’ user on connection.php
sudo chmod o+r connection.php
Find the path to to connection.php and note it
pwd
Ex: < /var/www/metalims_config/
So full path is /var/www/metalims_config/connection.php
Change back to metalims folder and edit ‘database_connection.php’
Ex: > cd /var/www/html/MetaLIMS/
Open connection.php in your favorite editor and replace ‘’ to include the path where your new connection.php is stored and save
Ex:
Change owner of files for MetaLIMS writable files to apache's php user ('www-data' for Ubuntu. Change to 'apache' for Centos)
Replace [path to webroot] with the path to your webroot dirctory. For our example, it is still '/var/www/html'
sudo chown -R www-data:www-data [path to webroot]/MetaLIMS/sequencing/sequencing_form.xlsx
sudo chown -R www-data:www-data [path to webroot]/query_samples/metalims_export.txt
sudo chown -R www-data:www-data [path to webroot]/query_samples/metalims_user_created_export.txt
sudo chown -R www-data:www-data [path to webroot]/labels/metalims_labels.txt
sudo chown -R www-data:www-data [path to webroot]/admin_tools/uploads/
Sign into your sql database from your ‘Important Accessories’ directory using either your mysql root user or an admin user with full privileges (now located one directory outside of document root Ex: /var/www/Important Accessories)
mysql -u [username] -p
Import metalims_demo.sql file found in the ‘Important Accessories.zip’ file. A database named 'metalims_demo'and a user named 'metalims_test' (with SELECT, INSERT, UPDATE and DELETE privileges) will be created. Password for 'metalims_test' user is set to 'metalims_password123'. Please open metalims_demo.sql and change password before importing (shown below). Note this password and username is what will be stored in the connection.php file
Change password
Run source command to import MetaLIMS
source metalims_demo.sql;
Exit MySQL
exit
Open connection.php with your favorite text editor and replace the content with the following:
Be sure to replace [password] with your new password which you placed in your .sql and save file
Go to http://[myipaddress]/[path from document root to metalims folder]/MetaLIMS/login.php
Ex: http://localhost/MetaLIMS/login.php
Login page should now display.
Note: MetaLIMS plays well with Chrome, Firefox, and Microsoft Edge
Use default logins below to login and view pre-populated demo. Reference MetaLIMS v2.0 Manual For Admin and MetaLIMS v2.0 Manual For Basic Usage for more details and instructions.
Default logins for demo:
Username:
admin@metalims.com
Password:
admin
Username:
newuser@metalims.com
Password:
user
Sign into your sql database from your ‘Important Accessories’ directory using either your mysql root user or an admin user with full privileges (now located one directory outside of document root Ex: /var/www/Important Accessories)
mysql -u [username] -p
Import metalims_empty.sql file found in the ‘Important Accessories.zip’ file. A database named 'metalims_empty'and a user named 'metalims' (with SELECT, INSERT, UPDATE and DELETE privileges) will be created. Password for 'metalims' user is set to 'metalims_password123'. Please open metalims_empty.sql and change password before importing (shown below). Note this password and username is what will be stored in the connection.php file
Change password
Run source command to import MetaLIMS
source metalims_empty.sql;
Exit MySQL
exit
Open connection.php with your favorite text editor and replace the content with the following:
Be sure to replace [password] with your new password which you placed in your .sql and save file
Go to http://[myipaddress]/[path from document root to metalims folder]/MetaLIMS/login.php
Ex: http://localhost/MetaLIMS/login.php
Note: MetaLIMS plays well with Chrome, Firefox, and Microsoft Edge
Login page should now display
- See MetaLIMS v2.0 Manual For Admin to continue set-up
All MetaLIMS users are responsible for their own data security. Please take any necessary extra precautions to reduce the inherent risk involved with database exposure to the internet such as SQLi and xxs attacks. MetaLIMS utilizes prepared statements and htmlspecialchars to help protect against these attacks. However, MetaLIMS has been created for a closed internet connection and has not been rigorously tested against these types of attacks Please backup all database information as needed