For installation details : DigiCleaR 4 Installation
DigiClear version 4 and more is installed on paprika
server. the IP adress is : 192.168.70.95
the typical conf for NGinx is :
server {
listen 80;
server_name paprika paprika.c2n.u-psud.fr;
# return 301 https://www.google.fr;
# if ($scheme = http) {
# return 301 https://$server_name$request_uri;
# }
#server {
# listen [::]:443 ssl;
# listen 443 ssl;
# ssl_certificate /etc/nginx/ssl/nginx.crt;
# ssl_certificate_key /etc/nginx/ssl/nginx.key;
# server_name wiki.domain.example;
# Maximum file upload size is 4MB - change accordingly if needed
client_max_body_size 4M;
client_body_buffer_size 128k;
### ROOT for DigiClear v4
root /var/www/digiclear-v4/public;
index index.html index.htm index.php;
# Uncomment this prevents images being displayed !
# location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
# expires 31536000s;
# add_header Pragma "public";
# add_header Cache-Control "max-age=31536000, public, must-revalidate, proxy-revalidate";
# log_not_found off;
# }
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ .php$ {
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SERVER_NAME $host;
fastcgi_param PATH_INFO $uri;
fastcgi_intercept_errors on;
fastcgi_ignore_client_abort off;
fastcgi_connect_timeout 60;
fastcgi_send_timeout 180;
fastcgi_read_timeout 180;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
}
}
The root directory should be set on /public. Meaning that only files within that folder will be accessible from outside.
root /home/leandre/git/digiclear-v4/public/;
The index must be index.php
index index.php;
you must put a location block pointing on / redirecting requests to index.php if they don't point to an existing file :
location / {
try_files $uri $uri/ /index.php?$query_string;
}
you can add autoindex on;
to make browsing public files easier (useful if you plan on putting documentation and stuff in /public/) It doesn't affect security since everything that's in public is supposed to be client-side files anyway.
If you plan on having a 3rd party software connect to DigiCleaR with the user's credentials (in order to automatically fill-up a form in place of the user for example), don't forget to add the CORS header here. Else the client's browser is gonna yell at you.
add_header 'Access-Control-Allow-Origin' 'your/3rd/party/domain/name/here';
you can also use '*'
in place of the domain to allow CORS from everywhere, but if you do that make sure that DigiCleaR is only accessible from an internal network.
préviously install few packages:
sudo apt-get install nginx
sudo apt-get install php8.1
sudo apt install php8.1-bcmath php8.1-bz2 php8.1-cgi php8.1-cli php8.1-curl php8.1-gd php8.1-gmagick php8.1-gmp php8.1-http php8.1-ldap php8.1-mbstring php8.1-pgsql php8.1-phpdbg php8.1-readline php8.1-ldap php8.1-ssh2 php8.1-zip php8.1-xml php8.1-xdebug
sudo apt-get install composer
if you are using a up to date ubuntu server then you should have installed a recent PHP version
You may need to downgrade this version. In fact in September 22, DigiCleaR needs PHP7.4 and is incompatible with PHP 8
to do so you may install the following ppa: ppa:ondrej/php
this allow you to install any version of PHP from 5.6 to the last one (8.1 in september 22)
From GIT:
sudo git clone https://gitlab.u-psud.fr/stephane.guilet/digiclear-v4.git
in the ./digiclear-v4
update the dependencies byt running composer
sudo composer install
then give permission to the user controlling the nginx process (most of the time www-data)
cd /var/www/
sudo chown www-data:www-data * -R