Skip to content
Krzysztof Królikowski edited this page Apr 7, 2017 · 11 revisions

Database preparation

Spine is based on MySQL database server. Before you will be able to proceed be sure that you have installed and running mysql (or. mariadb) server on your system. If you are ready, then you can create database for spine and put into it sql initial file. Sql file contains database shema and apache options needed for web interface. This file (spine-db.sql) can be found in sql subdirectory in this project.

mysql> CREATE database spine;
mysql> GRANT all on spine.* to 'spine'@'localhost' identified by 'superSecret'
mysql> flush privileges;
shell> mysql -u root -D spine < spine-db.sql

Web interface

Requirements

Backend side of web interface is written in PHP with Smarty templates. It uses MySQL as database server. Following packages are required:

  • php5-mysql
  • php-pear

Package names may vary on particular systems. Web interface also maintains mail notifications. It uses NET_SMTP library to connect to mail server. You can install it using following listing.

sudo pear install mail
sudo pear install Net_SMTP

Installation

Web application is in spine-web directory. Copy its contents to desired directory on the server. This setup can be similar to the following example listing.

sudo cp -a spine-web/* /var/www/spine.local/htdocs/
sudo mkdir /var/www/spine.local/htdocs/templates_c
sudo mkdir /var/www/spine.local/htodcs/data
sudo chown www-data:www-data /var/www/spine.local/htdocs/templates_c
sudo chown www-data:www-data /var/www/spine.local/htdocs/data

Configuration

Web interface have simple configuration file: include/config.php which contains database connection data and path to PHP Smarty library.

<?php
  define('DBHOST', 'localhost');
  define('DBNAME', 'spine');
  define('DBUSER', 'spine');
  define('DBPASS', 'superSecret');
  define('SMARTY_LIB', '/usr/share/php/smarty3/Smarty.class.php');
?>

Smarty library path may vary on particular systems.