Skip to content

Latest commit

 

History

History
160 lines (105 loc) · 8.09 KB

README.md

File metadata and controls

160 lines (105 loc) · 8.09 KB

Installation

Jorani has been tested with Apache, ngnix, IIS and lighttpd (it works fine with any webserver supporting fastcgi). Jorani is compatible with HHVM as Codeigniter is 100% compatible with the VM. Jorani is 100% compatible with PHP 7.0 (starting from v0.4.0).

General considerations

  • Jorani must have write privileges on application/logs and local/upload/* folders.
  • Some PHP extensions are required (e.g. mcrypt, mysqli, xml, zip, gd).
  • The default user is bbalet and password is bbalet.
  • The script requirements.php, at the root of the installation (e.g. http://localhost/jorani/requirements.php) allows you to check your system.
  • Change application/config/config.php in order to modify the default behavior of Jorani.
  • Jorani uses MySQL procedures (PROCEDURE). Some web hosting companies don't allow using custom MySQL functions.
  • Jorani doesn't import users from external authentication sources (LDAP, OAuth2, SAML, etc.), so you must create the users into 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 used for Jorani must have EXECUTE permission. Please check errors output by the script as some users reported that procedures are not created if you don't have SUPER privilege. A possible workaround is to start your MySQL session by this command SET GLOBAL log_bin_trust_function_creators = 1; (please refer to MySQL documentation).

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'] = '[email protected]';
$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.

SSO/OAuth2 with Google+

Please refer to the script testoauth2.php at the root of installation for guidance and tests. Please read application/config/saml-example-onelogin.php for an example.

SSO/SAML

Since v0.5.0, Jorani can use SAML for SSO. It has been tested with onelogin as IDP.

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

Jorani uses icons contained in a woff2 font file, so you must make sure that the following MIME types are configured on IIS: .woff application/font-woff and .woff2 application/font-woff2.

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 section 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).

Migration

It is recommended to change the file log extension to log instead of php in order to prevent security exploits based on log injection. If you migrate from an older version of Jorani, please add this variable into the configuration:

$config['log_file_extension'] = 'log';