Bonjour,
Voici comment installer Jorani sur Linux.
Installer les dépendances :
Debian 12
apt install -y nginx mariadb-server php php-cli php-gd php-common php-opcache php-ldap php-pdo php-pear php-xml php-mysqli php-mbstring php-fpm php-json php-gmp php-zip php-curl wget unzip
systemctl enable --now nginx mariadb
RHEL
yum install -y nginx mariadb-server php php-cli php-gd php-common php-opcache php-ldap php-pdo php-pear php-xml php-mysqli php-mbstring php-fpm php-json php-gmp php-zip php-curl wget unzip
systemctl enable --now nginx mariadb
Configurer MariaDB :
mysql_secure_installation
mysql -u root -p
CREATE DATABASE jorani;
CREATE USER 'jorani'@localhost IDENTIFIED BY 'my_password';
GRANT ALL PRIVILEGES ON jorani.* TO 'jorani'@localhost IDENTIFIED BY 'my_password';
FLUSH PRIVILEGES;
EXIT
Installer Jorani :
mkdir -p /var/www /root/.ssl
wget -O /var/www/jorani.zip https://github.com/bbalet/jorani/releases/download/v1.0.2/jorani-1.0.2.zip
cd /var/www && unzip -D jorani.zip && rm -f jorani.zip
rm -rf jorani/.git
Update RSA Key :
cd /var/www/jorani/assets/keys/
openssl genrsa -out private.pem 4096
openssl rsa -in private.pem -outform PEM -pubout -out public.pem
chown -R nginx: /var/www/jorani
(RHEL)
chown -R www-data: /var/www/jorani
(Debian)
Configurer PHP :
grep timezone /etc/php.ini
(RHEL)
sed -i "s@;date.timezone =@date.timezone = Europe/Paris@g" /etc/php.ini
sed -i "s@;opcache.enable=1@opcache.enable=1@g" /etc/php.ini
sed -i "s@;opcache.memory_consumption=128@opcache.memory_consumption=128@g" /etc/php.ini
sed -i "s@;opcache.max_accelerated_files=1000@opcache.max_accelerated_files=2000@g" /etc/php.ini
sed -i "s@;opcache.revalidate_freq=2@opcache_revalidate_freq=240@g" /etc/php.ini
systemctl restart php-fpm
grep timezone /etc/php/8.2/fpm/php.ini
(Debian)
sed -i "s@;date.timezone =@date.timezone = Europe/Paris@g" /etc/php/8.2/fpm/php.ini
sed -i "s@;opcache.enable=1@opcache.enable=1@g" /etc/php/8.2/fpm/php.ini
sed -i "s@;opcache.memory_consumption=128@opcache.memory_consumption=128@g" /etc/php/8.2/fpm/php.ini
sed -i "s@;opcache.max_accelerated_files=1000@opcache.max_accelerated_files=2000@g" /etc/php/8.2/fpm/php.ini
sed -i "s@;opcache.revalidate_freq=2@opcache_revalidate_freq=240@g" /etc/php/8.2/fpm/php.ini
systemctl restart php8.2-fpm
Importer la DB :
pv /var/www/jorani/sql/jorani.sql | mysql -u jorani -pmy_password jorani
Configurer Jorani :
nano /var/www/jorani/application/config/database.php
'dsn' => 'mysql:host=127.0.0.1;dbname=jorani',
'hostname' => 'localhost',
'username' => 'jorani',
'password' => 'my_password',
'database' => 'jorani',
nano /var/www/jorani/application/config/email.php
$config['useragent'] = 'PHPMailer';
$config['protocol'] = 'smtp';
$config['mailpath'] = '/usr/sbin/sendmail';
$config['smtp_host'] = 'smtp-relay.gmail.com';
$config['smtp_auth'] = TRUE;
$config['smtp_user'] = 'my.account.@gmail.com';
$config['smtp_pass'] = 'my_password';
$config['smtp_port'] = 465;
$config['smtp_timeout'] = 30;
$config['smtp_crypto'] = 'ssl';
nano /var/www/jorani/application/config/config.php
# Définir nom du site :
$config['base_url'] = 'https://jorani.my_domain.com/';
# Définir l'email d'envoie
$config['from_mail'] = jorani@my_domain.com';
# LDAP
$config['ldap_enabled'] = true;
$config['ldap_host'] = 'my_domain.com';
$config['ldap_port'] = 689;
$config['ldap_basedn'] = 'uid=%s,ou=people,dc=company,dc=com';
Configurer Nginx :
nano /etc/nginx/conf.d/jorani.conf
server {
listen 80 default_server;
server_name _;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
server_name jorani.my_domain.com;
root /var/www/jorani;
index index.php;
access_log /var/log/nginx/jorani-access.log;
error_log /var/log/nginx/jorani-error.log error;
# SSL Configuration
ssl_certificate /root/.ssl/jorani.my_domain.com.crt;
ssl_certificate_key /root/.ssl/jorani.my_domain.com.key;
ssl_session_cache shared:SSL:10m;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384";
ssl_prefer_server_ciphers on;
# See https://hstspreload.org/ before uncommenting the line below.
# add_header Strict-Transport-Security "max-age=15768000; preload;";
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header X-Robots-Tag none;
add_header Content-Security-Policy "frame-ancestors 'self'";
add_header X-Frame-Options DENY;
add_header Referrer-Policy same-origin;
gzip on;
gzip_disable "msie6";
gzip_min_length 1100;
gzip_types text/xml text/css image/x-icon image/bmp application/json
text/javascript application/x-javascript application/javascript
application/pdf application/postscript
application/rtf application/vnd.ms-powerpoint
application/msword application/vnd.ms-excel
application/vnd.wap.xhtml+xml;
# If file is an asset, set expires and break
location ~* \.(ico|css|js|gif|jpe?g|png|otf|eot|svg|ttf|woff|woff2)(\?[0-9]+)?$ {
expires max;
break;
}
#Allow acces to some specific assets
location ~* ^/(robots\.txt) {
expires max;
break;
}
# canonicalize codeigniter url end points
# if your default controller is something other than "welcome" you should change the following
if ($request_uri ~* ^(/leaves(/index)?|/index(.php)?)/?$)
{
rewrite ^(.*)$ / permanent;
}
# removes trailing "index" from all controllers
if ($request_uri ~* index/?$)
{
rewrite ^/(.*)/index/?$ /$1 permanent;
}
# removes trailing slashes (prevents SEO duplicate content issues)
if (!-d $request_filename)
{
rewrite ^/(.+)/$ /$1 permanent;
}
# removes access to "system" folder, also allows a "System.php" controller
if ($request_uri ~* ^/system)
{
rewrite ^/(.*)$ /index.php?/$1 last;
break;
}
# unless the request is for a valid file (image, js, css, etc.), send to bootstrap
if (!-e $request_filename)
{
rewrite ^/(.*)$ /index.php?/$1 last;
break;
}
# catch all
error_page 404 /index.php;
location ~ \.php$ {
try_files $uri $uri/ /index.php?/$request_uri;
include fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_pass unix:/run/php/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SERVER_SOFTWARE nginx;
fastcgi_param HTTP_MOD_REWRITE On; #Mimic Apache
fastcgi_param ALLOW_OVERWRITE On; #Mimic Apache
fastcgi_param PHP_AUTH_USER $remote_user; #Pass BasicAuth headers
fastcgi_param PHP_AUTH_PW $http_authorization; #Pass BasicAuth headers
fastcgi_param SCRIPT_FILENAME
$document_root$fastcgi_script_name;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
}
## Disable viewing some files such as .htaccess & .htpassword
location ~* \.(ht|htpassword|pem) {
deny all;
}
}
systemctl restart nginx
Tester Jorani :
login : bbalet
pwd : bbalet
https://jorani.my_domain.com/requirements.php
Voilà votre Jorani est installé