Requirements:
- composer https://getcomposer.org/
curl -sS https://getcomposer.org/installer | php cp composer.phar /usr/local/bin/composer
- mysql > 5.1 (it should work with postgres etc but not tested)
- PHP >= 5.5.x with modules: php-apc, php5-cli, php5-curl, php5-mysql, php5-mcrypt, php5-memcached
- Apache >= 2.2 with enabled modules: rewrite, unique_id
- Shibboleth-SP >= 2.4 - optional needed for federated access
- Codeigniter framework 3.1.5
- Doctrine >= 2.4.x http://www.doctrine-project.org
NoteDoctrine it will be installed with composer
- Zend-ACL Framework
NoteZend-ACL it will be installed with composer
- Memcached server on the same host
- gearman-php, gearnam-job-server - allows to enable additional features in JAGGER
Download JAGGER Entities Managment and Codeigniter
Notewe will be using CodeIgniter 3.1.5 available from https://github.com/bcit-ci/CodeIgniter/archive/3.1.5.zip
Download codeigniter and unpack into /opt and rename to “codeigniter”
JAGGER (Entity managment tool) is published on repo
git clone repo /opt/rr3 cd /opt/rr3
Install required third parties libraries with composer tool. Go to application folder and run
composer install
Set index.php file
cp /opt/codeigniter/index.php /opt/rr3/
and modify it. You need to change default path to system folder. Open /opt/rr3/index.php file and find
$system_path = 'system';
You may also want to set production environment. To do it find line
define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'development');
and before that line add
$_SERVER['CI_ENV'] = 'production';
Apache Configuration
Alias /rr3 /opt/rr3 <Directory /opt/rr3> # you may need to uncomment next line # Require all granted RewriteEngine On RewriteBase /rr3 RewriteCond $1 !^(Shibboleth\.sso|index\.php|logos|signedmetadata|flags|images|app|schemas|fonts|styles|images|js|robots\.txt|pub|includes) RewriteRule ^(.*)$ /rr3/index.php?/$1 [L] </Directory> <Directory /opt/rr3/application> Order allow,deny Deny from all </Directory>
MySQL Configuration
mysql> create database rr3 CHARACTER SET utf8 COLLATE utf8_general_ci; mysql> grant all on rr3.* to rr3user@'localhost' identified by 'rr3pass'; mysql> flush privileges;
install.sh script
Now it’s time to run install.sh script. Go to /opt/rr3/
./install.sh
What it does is downloading Doctrine, Zend-ACL, Geshi, XMLseclib and exctract them. Then you need to set required config files - you can copy templates and customize them. Stay in /opt/rr3/
cp config-default.php -> config.php cp config_rr-default.php -> config_rr.php cp database-default.php -> database.php cp email-default.php -> email.php cp memcached-default.php -> memcached.php
Next we need to edit the configuration files we just coppied
config.php
base_url
$config['base_url'] = 'https://yourhost.example.com/rr3/';
index_page
$config['index_page'] = '';
log_threshold - you decide what log level
log_path - set location for example:
$config['log_path'] = '/var/log/rr3/';
encryption_key - you need to set encryption key. you can generate with
tr -c -d '0123456789abcdefghijklmnopqrstuvwxyz' </dev/urandom | dd bs=32 count=1 2>/dev/null;echo
sess_driver
Warning If you update jagger please change sess_driver from “native” to “files” as there was some changes in core CI
$config['sess_driver'] = 'files'; $config['sess_valid_drivers'] = array(); $config['sess_cookie_name'] = 'ci_session'; $config['sess_expiration'] = 7200; $config['sess_expire_on_close'] = FALSE; $config['sess_encrypt_cookie'] = FALSE; $config['sess_use_database'] = FALSE; $config['sess_table_name'] = 'ci_sessions'; $config['sess_match_ip'] = FALSE; $config['sess_match_useragent'] = TRUE; $config['sess_time_to_update'] = 300;
csrf_protection - set to TRUE
$config['csrf_protection'] = TRUE; $config['csrf_token_name'] = 'csrf_test_name'; $config['csrf_cookie_name'] = 'csrf_cookie_name'; $config['csrf_expire'] = 7200; $config['csrf_regenerate'] = FALSE; $config['csrf_exclude_uris'] = array();
- standardize_newlines - in most cases set to TRUE
$config['standardize_newlines'] = TRUE;
- enable composer autoloader - it always should be set to TRUE
$config['composer_autoload'] = TRUE;
config_rr.php
As template please use config_rr-default.php, make sure you have the above configurations:
$config['pageTitlePref'] = 'Jagger:: '; $config['syncpass'] = 'randomstring'; #syncpass - please generate strong key. It’s used by synchronization - interfederation tool generate with: tr -c -d '0123456789abcdefghijklmnopqrstuvwxyz' </dev/urandom | dd bs=32 count=1 2>/dev/null;echo $config['rr_rm_member_from_fed'] = TRUE; $config['autoregister_federated'] = FALSE; #Need to be TRUE in order to autoregister users from Community Tagging Access $config['register_defaultrole'] = 'Member'; $config['Shib_required'] = array('Shib_mail','Shib_username'); $config['Shib_username'] = 'uid'; $config['Shib_mail'] = 'mail'; $config['Shib_fname'] = 'givenName'; $config['Shib_fname'] = 'sn'; $config['shibb_updatefullname'] = TRUE; $config['Shibboleth']['loginapp_uri'] = 'auth/fedauth'; $config['Shibboleth']['logout_uri'] = '/Shibboleth.sso/Logout'; $config['Shibboleth']['enabled'] = TRUE; $config['metadata_validuntil_days'] = '7'; $config['unsignedmeta_iplimits'] = array('127.0.0.1'); $config['policy_dropdown'] = array('0' => 'never', '1' => 'permit only if required', '2' => 'permit if required or desired'); $config['arp_cache_time'] = 1200; $config['geocenterpoint'] = array('-9.126273968749956','38.684286647936936'); $config['memcached'] = array( 'optional'=>array( 'hostname' => 'localhost', 'port' => '11211', 'weight' => '1' ) ); $config['cacheprefix'] = 'rr3_';
email.php
Make sure you have the above at email.php
$config['protocol'] = 'smtp'; $config['smtp_host'] = "SMTP_HOST"; $config['smtp_port'] = 25; $config['charset'] = 'utf-8'; $config['crlf'] = "\r\n"; $config['newline'] = "\r\n"; $config['wordwrap'] = TRUE; $config['useragent']='ResourceRegistr3'; $config['smtp_user'] = 'USER'; $config['smtp_pass'] = 'PASS'; $config['smtp_crypto'] = 'tls'; $config['mail_sending_active'] = TRUE; $config['notify_if_provider_rm_from_fed'] = TRUE; $config['notify_if_queue_rejected'] = TRUE; $config['mail_subject_suffix'] = '[JAGGER]';
database.php
$active_group = 'default'; $active_record = TRUE; $db['default']['hostname'] = 'localhost'; $db['default']['username'] = 'CHANGEME'; $db['default']['password'] = 'CHANGEME'; $db['default']['database'] = 'CHANGEME'; $db['default']['dbdriver'] = 'mysql'; $db['default']['dbprefix'] = ''; $db['default']['pconnect'] = TRUE; $db['default']['db_debug'] = TRUE; $db['default']['cache_on'] = FALSE; $db['default']['cachedir'] = ''; $db['default']['char_set'] = 'utf8'; $db['default']['dbcollat'] = 'utf8_general_ci'; $db['default']['swap_pre'] = ''; $db['default']['autoinit'] = TRUE; $db['default']['stricton'] = FALSE;
memcached.php
$config = array( 'default' => array( 'hostname' => '127.0.0.1', 'port' => '11211', 'weight' => '1', ), );
When you are done with the config files go to /opt/rr3/application
Populate tables of database
./doctrine orm:schema-tool:create If you going to run application in production mode then you also need to regenerate proxies: ./doctrine orm:generate-proxies
Final Step
Edit config_rr.php file and set
$config['rr_setup_allowed'] = TRUE;
Open page https://yourhost.example.com/rr3/setup and fill the form. This will create the admin user. Make sure to set back $config['rr_setup_allowed'] = FALSE; after you submit the admin user