EN  FR

Tutorial: installation of Jorani

Although Jorani can work with several types of web servers and in various configurations (nginx, HHVM, PHPng, etc.), we will only describe how to install it on Ubuntu Utopic (14.10), with Apache and MySQL. It is quite the same for other Linux distributions except for some configuration file locations and command names.

At the end of this tutorial, you will get an installation in a subdirectory (eg http://localhost/jorani/). For additional assistance (eg for installing on a subdomain or at your host, etc.), I advise you to post on specialized support forums (your distribution, your webhosting company, etc.). People present on these forums are used to these environments and will quickly respond to you.

Please note that the default user and password are: bbalet.

Prerequisites

There are several installation guides for the components needed by Jorani. It is not the purpose of this article to go into details, but simply to provide the main controls and a memory aid. For example, it is best to start any installation with a small magic command that will spare you few disappointments:

sudo apt-get update

Another example is the command to find the IP address of a server. You can use this command once you are connected to the server (this will be useful to test the installation from your browser):

ifconfig eth0 | grep inet | awk '{ print $2 }'

Finally, if you are missing one of the commands used in this guide, just try to install it by using its name. For example, if you are missing unzip, here's how to fix this:

sudo apt-get install unzip

LAMP stack

You must install a LAMP stack (Linux Apache MySQL PHP). Please note that Jorani requires at least PHP 5.3. Here is the command to install a LAMP on Ubuntu:

sudo apt-get install lamp-server^

Mind to note the passwords you chose during the installation of the LAMP stack!

PHP OpenSSL Extension

In order to speed up the connection (which is encrypted), it is recommended to install the SSL PHP extension. Make sure the module is installed with the following command:

php -r 'phpinfo();' | grep openssl

You can activate it with the following command:

php5enmod openssl

PHP LDAP extension

If you want to use LDAP for authentication, you can install it as follow:

sudo apt-get install php5-ldap

Remember to restart Apache!

Of course, every time you install a PHP extension or change the web server configuration, you need to restart Apache web service:

sudo service apache2 restart

Utilities

PhpMyadmin

PhpMyadmin is a web interface for managing your MySQL databases. It's more fun than command lines, but it is optional and not recommended on production servers. However, if you want to install it, here is the command:

sudo apt-get install phpmyadmin

Git

We can install Jorani sources by downloading a ZIP file of one of its versions or via git. The set command retrieves the current development version or any labeled version (eg with the label of a published version). In order to install this command:

sudo apt-get install git

Install Jorani

Getting the source

Go into the web directory:

cd /var/www/html/

Download ZIP file

We can install Jorani sources by downloading a ZIP file of one of the versions. With wget command to which we pass as a parameter the URL of the ZIP file we want to download. For example:

gzip --decompress v0.3.0.zip
wget https://github.com/bbalet/jorani/archive/v0.3.0.zip
unzip v0.3.0.zip

Remember to update the URL of the ZIP file with the latest version. And perhaps to change the directory names.

Use git

If you are a player, you can recover the version under development with this command (this is called to clone):

git clone https://github.com/bbalet/jorani.git

However, we can only recover the latest stable version. Once we have cloned the source code of Jorani (with the previous command), we can list the versions and then recover a specific version (identified by a label):

git tag -l
git checkout tags/outstanding label

Install the database

On peut utiliser l'interface web de phpMyAdmin ou faire l'installation à la main. Lancez la commande mysql depuis la console et saisissez un mot de passe, le cas échéant :

mysql -u root -p

Create a database for Jorani, here we will call it lms:

CREATE DATABASE IF NOT EXISTS lms;

Tell mysql to use lms database for the next actions:

use lms;

Import database. Of course, you must adapt the path if you've installed Jorani into another location:

source /var/www/html/jorani/sql/lms.sql;

You can take the opportunity to create a user with at least SELECT, INSERT, UPDATE, DELETE and EXECUTE permissions on the database (you can change ALL PRIVILEGES in the example if you want to be more restrictive):

CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON lms.* TO 'newuser'@'localhost';
FLUSH PRIVILEGES;

Exit mysql:

exit

Configuring Jorani

Open the database configuration file, here I use nano, but you can use your favorite editor (vim, etc.):

nano /var/www/html/jorani/application/config/database.php

Locate the following lines of code and adapt them to your configuration:

$db['default']['hostname'] = 'localhost';
$db['default']['username'] = 'root';
$db['default']['password'] = '';

Web Server Configuration

If you've arrived here and you've tried to use Jorani, it is very likely that your browser shows you this error:

Not Found

The requested URL /jorani/home was not found on this server.

Apache/2.4.10 (Ubuntu) Server at xxx.xxx.xxx.xxx Port 80

The reason is that Jorani uses URL rewriting techniques and uses a .htaccess file. It's annoying, but these two features are disabled by default in the Apache configuration. Activation of the rewrite module is very easy (Apache must be restarted for the configuration to be taken into account):

a2enmod rewrite

Take a look into the directory of the active websites (/etc/apache2/sites-enabled). If we take the hypothesis of a new server, you should only find the default site:

nano /etc/apache2/sites-enabled/000-default.conf

Add this block configuration that you must of course be adapt according to your case:

    <Directory /var/www/html/jorani>
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>

Remember to restart Apache:

sudo service apache2 restart

Additional Steps

Remember to adapt the e-mail server configuration file by modifying the /config/email.php file. For example, for GMAIL:

$config['protocol'] = 'smtp';
$config['useragent'] = 'phpmailer';
$config['smtp_host'] = 'ssl://smtp.googlemail.com';
$config['smtp_user'] = 'my.account.@gmail.com';
$config['smtp_pass'] = 'my password';
$config['_smtp_auth'] = TRUE;
$config['smtp_port'] = '465';

Change the keys

We advise you to change the public and private keys. You can put a stronger encryption than 1024 bits, 2048 bits, for example:

cd /var/www/html/jorani/assets/keys/
openssl genrsa -out private.pem 1024
openssl rsa -in private.pem -outform PEM -pubout -out public.pem

Advanced Configuration

It is possible to configure advanced options to activate or to adapt the software for your use.

What are the default user and password?

After this installation, you'll get a nearly empty database with the user:

  • Login: bbalet
  • Password: bbalet

Check that everything is working

There is a special page where you can check that Jorani is installed and that helps you find problems. Open your browser at (change the server address with your server address): http://localhost/jorani/requirements.php


Tags :    tutorial 

Support the project







You may also like

What version of PHP is recommended for Jorani?

We realised a benchmark of the different PHP versions (5.3 up to PHPng and HHVM) so as to recommend a runtime.   Read »

Delegate validation leave

A manager may temporarily or permanently entrusts with the validation of requests for leave to another employee, is the delegation.   Read »

High performance with nginx and HHVM

Jorani is compatible with HHVM and nginx. This tutorial explains how to achieve a high performance installation.   Read »

Description of the configuration file

It is possible to customize the behavior of Jorani by modifying the main configuration file.   Read »

v0.1.4 is released

Jorani now offers a better end user experience by taking into account users using a slow Internet connection.   Read »

comments powered by Disqus