Skip to content

Latest commit

 

History

History
149 lines (101 loc) · 6.9 KB

README.md

File metadata and controls

149 lines (101 loc) · 6.9 KB

Installation

Jorani has been tested with Apache, ngnix and lighttpd. Jorani is compatible with HHVM as Codeigniter is 100% compatible with the VM. Jorani is compatible with PHP 7.0 (starting from v0.4.0) except for Excel exports (on May, 1st 2015)

General considerations

  • The Jorani application must have write privileges on application/logs folder.
  • Some PHP extensions are required (e.g. mcrypt, mysqli, xml, zip, gd).
  • The default user is bbalet and password is bbalet.
  • A script at the root of the installation (requirements.php) allows you to check your system.
  • Change application/config/config.php in order to modify the default behavior of Jorani.

Database setup

Jorani has been tested with MySQL and MariaDB (please note that functions are created in the schema). Please follow these steps :

  • Create a database.
  • Import /sql/lms.sql.
  • Change application/config/database.php according to your environment.

Please note that the schema contains procedures, so the user created must have EXECUTE permission.

E-mail setup

Jorani uses e-mail to notify users and their line managers. In order to setup e-mail modify /application/config/email.php file according to your environment. Please use the script testmail.php at the root of your installation if you want to debug and read the troubleshooting section of this script for additional hints.

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';

LDAP

You must activate PHP LDAP module prior using this feature. Please use the script testldap.php at the root of your installation if you want to debug. In order to configure LDAP, locate these lines of code into application/config/config.php :

$config['ldap_enabled'] = FALSE;
$config['ldap_host'] = '127.0.0.1';
$config['ldap_port'] = 389;
$config['ldap_basedn'] = 'uid=%s,ou=people,dc=company,dc=com';
  • Switch ldap_enabled to TRUE.
  • Change ldap_host and ldap_port according to your environement.
  • Jorani tries to bind to LDAP according to the content of ldap_basedn in where %s is a placeholder for the user id to be checked into LDAP (e.g. %s will be replaced by the login from LMS db).
  • Contact your IT Admin in order to know more about how LDAP is configured into your organization. Change the value but %s must remain somewhere into this string.
  • The user id into Jorani and LDAP must be the same. When LDAP is activated, LMS doesn't use anymore the password stored into the database.

Since version 0.1.5, Jorani supports complex LDAP authentication schemes (where users are in different loactions in the directory). In order to use this feature :

  1. Set ldap_basedn_db to TRUE.
  2. The Base DN is not based on ldap_basedn, but read from the users table, column ldap_path (e.g. from database).
  3. The Base DN should look like uid=bbalet,ou=people,dc=company,dc=com. Note that this feature allows you to authenticate users from different OU.

Apache

Jorani is a PHP/CI application using rewrite rules and .htaccess files. So your Apache configuration must allow overwriting configuration by .htaccess files and mod_rewrite must be enabled.

Other webservers

nginx or lighttpd in conjunction with fpm-php are for advanced users because they are more complicated to tune than Apache (see troubleshooting section of this document). We recommend to validate your production environement with a load test prior going live.

nginx

For your convinience, a sample ngnix configuration file is provided in this folder /docs/install/ngnix/default

If you are using HTTP protocol, don't forget to disable HTTPS in application/config/config.php $_SERVER['HTTPS'] = 'off';

Other parameters should be considered carefully (in /etc/nginx/nginx.conf), such as:

  • events.worker_connections
  • events.multi_accept
  • http.keepalive_timeout The values depend on your environment and the load that you are expecting.

lighttpd

To enable PHP in lighttpd, you must modify your php.ini and uncomment the line cgi.fix_pathinfo=1.

For your convinience, a sample lighttpd configuration file is provided in this folder /docs/install/lighttpd/lighttpd.conf

IIS7

To enable PHP in IIS7, you must follow the instructions provided on the official IIS website : http://www.iis.net/learn/application-frameworks/install-and-configure-php-applications-on-iis/using-fastcgi-to-host-php-applications-on-iis

Jorani uses rewriting techniques, so you must install the rewriting module prior using Jorani http://www.iis.net/downloads/microsoft/url-rewrite

For your convinience, a sample IIS7 configuration file is provided in this folder /docs/install/iis7/web.config. You need to copy this file at the root of your Jorani installation and to adapt it to your needs.

HHVM

You must activate the Zend Compatibility Layer as PHP function cal_days_in_month is not yet implemented (in /etc/hhvm/php.ini) :

hhvm.enable_zend_compat = true

See:

Troubleshooting

A load test raises error at a given number of simultaneous user

If you are running php-fpm, examine /var/log/php5-fpm.log, if you see this message : WARNING: [pool www] server reached pm.max_children setting (5), consider raising it In /etc/php5/fpm/pool.d/www.conf which is set by default to 5 pm.max_children = xxxx (number of simultaneous processes) For a load test, allow a margin of 25%

Error upstream sent too big header

If you get this error : upstream sent too big header while reading response header from upstream, you need to enlarge the buffers used by nginx.

Add this to your http {} of the nginx.conf file normally located at /etc/nginx/nginx.conf:

proxy_buffer_size   128k;
proxy_buffers   4 256k;
proxy_busy_buffers_size   256k;

Then add this to your php location block, this will be located in your vhost file look for the block that begins with location ~ .php$ {

fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;

If you are running nginx, tune your configuration (see /etc/nginx/nginx.conf).

Tested environments

  • Raspbian ARM - Apache + PHP
  • Raspbian ARM - ngnix + php-fpm
  • Windows 10 / 64 - WAMP
  • Windows 8 / 64 - WAMP
  • Windows 7 / 64 - WAMP
  • Windows XP / 32 - WAMP
  • Centos - Apache + PHP
  • Ubuntu 13.10 to 15.01 x86_64 - ngnix + php-fpm or HHVM