Outils pour utilisateurs

Outils du site


tech:notes_seafile_nginx_debian

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Prochaine révision
Révision précédente
tech:notes_seafile_nginx_debian [2025/03/24 15:06] – créée - modification externe 127.0.0.1tech:notes_seafile_nginx_debian [2026/06/07 19:12] (Version actuelle) – modification externe 127.0.0.1
Ligne 1: Ligne 1:
 +<!DOCTYPE markdown>
 +{{tag>Brouillon Web Partage Stockage Python}}
 +
 +# Notes seafile avec Nginx sous Debian
 +
 +Voir aussi :
 +* rclone
 +* directive `sendfile_max_chunk` pour Nginx
 +
 +Votre navigateur doit envoyer le "Referer" HTTP. Si besoin utiliser pour Firefox RefControl
 +
 +Liens : 
 +* http://manual.seafile.com/deploy/https_with_nginx.html
 +* http://manual.seafile.com/deploy/deploy_with_nginx.html
 +* https://github.com/haiwen/seafile-docs/blob/master/deploy/server_configuration.md
 +
 +~~~bash
 +adduser --group --system --disabled-password seafile
 +~~~
 +
 +~~~bash
 +apt-get install python-setuptools python-imaging
 +~~~
 +
 +`/etc/nginx/sites-available/seafile.acme.fr`
 +~~~nginx
 +server {
 +        listen 80;
 +        server_name seafile.acme.fr;
 +        rewrite ^ https://$server_name$request_uri? permanent;
 +}
 +
 +server {
 +        listen 443 ssl;
 +        server_name seafile.acme.fr;
 +        ssl_certificate /etc/ssl/private/acme.crt+chain;
 +        ssl_certificate_key /etc/ssl/private/acme.fr.key;
 +
 +        access_log /var/log/nginx/access_seafile_log;
 +        error_log /var/log/nginx/error_seafile_log;
 +
 +        proxy_set_header X-Forwarded-For $remote_addr;
 +
 +        location / {
 +                proxy_bind http://127.0.0.1:8080 ;
 +#                fastcgi_pass    127.0.0.1:8000;
 +#                fastcgi_param   HTTPS               on;
 +#                fastcgi_param   HTTP_SCHEME         https;
 +#                fastcgi_param   SCRIPT_FILENAME     $document_root$fastcgi_script_name;
 +#                fastcgi_param   PATH_INFO           $fastcgi_script_name;
 +#                fastcgi_param   SERVER_PROTOCOL     $server_protocol;
 +#                fastcgi_param   QUERY_STRING        $query_string;
 +#                fastcgi_param   REQUEST_METHOD      $request_method;
 +#                fastcgi_param   CONTENT_TYPE        $content_type;
 +#                fastcgi_param   CONTENT_LENGTH      $content_length;
 +#                fastcgi_param   SERVER_ADDR         $server_addr;
 +#                fastcgi_param   SERVER_PORT         $server_port;
 +#                fastcgi_param   SERVER_NAME         $server_name;
 +#                fastcgi_param   REMOTE_ADDR         $remote_addr;
 +        }
 +
 +        location /seafhttp {
 +                rewrite ^/seafhttp(.*)$ $1 break;
 +                proxy_pass http://127.0.0.1:8082;
 +                #include         /etc/nginx/proxy_params;
 +                client_max_body_size 0;
 +                proxy_request_buffering off;
 +                proxy_connect_timeout  36000s;
 +                proxy_read_timeout  36000s;
 +                proxy_send_timeout  36000s;
 +        }
 +
 +        location /media {
 +                root /var/www/seafile/seafile-server-latest/seahub ;
 +        }
 +}
 +
 +~~~
 +
 +------
 +
 +## Derrière un reverse proxy Nginx
 +
 +On NGINX Reverse-proxy Server
 +
 +`/etc/nginx/sites-available/files2.acme.fr`
 +~~~nginx
 +server {
 +        listen 80;
 +        server_name files2.acme.fr www.files2.acme.fr;
 +        rewrite ^ https://$server_name$request_uri? permanent;
 +}
 +
 +server {
 +        listen 443 ssl;
 +        server_name files2.acme.fr www.files2.acme.fr;
 +
 +        ssl_certificate /etc/nginx/ssl/nginx.crt;
 +        ssl_certificate_key /etc/nginx/ssl/nginx.key;
 +        add_header Strict-Transport-Security "max-age=31536000; includeSubdomains";
 +
 +        server_tokens off;
 +        proxy_set_header X-Forwarded-For $remote_addr;
 +
 +        access_log /var/log/nginx/access_seafile_log;
 +        error_log /var/log/nginx/error_seafile_log;
 +
 +        client_max_body_size 0;
 +        #client_body_buffer_size 128k;
 +
 +        location /seafhttp {
 +                rewrite ^/seafhttp(.*)$ $1 break;
 +                proxy_pass http://192.168.15.149:8082;
 +                client_max_body_size 0;
 +                #proxy_request_buffering off;
 +                proxy_connect_timeout  36000s;
 +                proxy_read_timeout  36000s;
 +                proxy_send_timeout  36000s;
 +
 +        }
 +
 +
 +        location / {
 +                proxy_pass http://192.168.15.149:8000;
 +#                fastcgi_pass    192.168.15.149:8000;
 +#                fastcgi_param   HTTPS               on;
 +#                fastcgi_param   HTTP_SCHEME         https;
 +#                fastcgi_param   SCRIPT_FILENAME     $document_root$fastcgi_script_name;
 +#                fastcgi_param   PATH_INFO           $fastcgi_script_name;
 +#                fastcgi_param   SERVER_PROTOCOL    $server_protocol;
 +#                fastcgi_param   QUERY_STRING        $query_string;
 +#                fastcgi_param   REQUEST_METHOD      $request_method;
 +#                fastcgi_param   CONTENT_TYPE        $content_type;
 +#                fastcgi_param   CONTENT_LENGTH      $content_length;
 +#                fastcgi_param   SERVER_ADDR        $server_addr;
 +#                fastcgi_param   SERVER_PORT        $server_port;
 +#                fastcgi_param   SERVER_NAME        $server_name;
 +#                fastcgi_param   REMOTE_ADDR         $remote_addr;
 +        }
 +
 +        location /media {
 +                #root /var/www/html/seafile-server-latest/seahub/ ;
 +                proxy_pass http://192.168.15.149:8081;
 +                include /etc/nginx/proxy_params;
 +        }
 +
 +}
 +~~~
 +
 +On FILE Server
 +
 +`/etc/nginx/sites-enabled/file2.acme.fr`
 +~~~nginx
 +server {
 +        listen 8081;
 +
 +        access_log /var/log/nginx/access_seafile_log;
 +        error_log /var/log/nginx/error_seafile_log;
 +
 +        server_tokens off;
 +
 +        location /media {
 +                root /var/www/html/seafile-server-latest/seahub/ ;
 +        }
 +}
 +~~~
 +
 +`conf/seafile.conf`
 +~~~ini
 +[fileserver]
 +port=8082
 +host=0.0.0.0
 +~~~
 +
 +`conf/ccnet.conf`
 +~~~ini
 +SERVICE_URL = https://files2.acme.fr
 +~~~
 +
 +`conf/seahub_settings.py`
 +~~~python
 +FILE_SERVER_ROOT = 'https://files2.acme.fr/seafhttp'
 +~~~
 +
 +~~~bash
 +su - www-data -s /bin/bash
 +./seafile.sh start
 +export SEAFILE_FASTCGI_HOST='0.0.0.0'
 +./seahub.sh start-fastcgi
 +~~~ 
 +
 +------------------------
 +
 +~~~bash
 +ln -s seafile-server-5.1.1 seafile-server-latest
 +cd seafile-server-latest
 +./setup-seafile.sh
 +~~~
 +
 +`~/conf/ccnet.conf`
 +~~~ini
 +[General]
 +SERVICE_URL = https://seafile.acme.fr
 +~~~
 +
 +`~/conf/seafile.conf`
 +~~~ini
 +[fileserver]
 +port=8083
 +~~~
 +
 +`~/conf/seahub_settings.py`
 +~~~python
 +FILE_SERVER_ROOT = 'https://seafile.acme.fr/seafhttp'
 +
 +EMAIL_USE_TLS = False
 +EMAIL_HOST = 'localhost'
 +#EMAIL_HOST_USER = 'root@acme.fr'    # username and domain
 +#EMAIL_HOST_PASSWORD = 'password'    # password
 +EMAIL_PORT = 25
 +#DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
 +DEFAULT_FROM_EMAIL = 'contact@acme.fr'
 +#SERVER_EMAIL = EMAIL_HOST_USER
 +SERVER_EMAIL = 'contact@acme.fr'
 +~~~
 +
 +~~~bash
 +./seafile.sh start
 +./seahub.sh start-fastcgi 8003
 +~~~
 +
 +
 +
 +## Clients
 +
 +Liens :
 +* https://www.ordinoscope.net/index.php/Informatique/Softwares/Seafile/seaf-cli
 +* https://documentation.unistra.fr/Catalogue/Outils_collaboratifs/seafile/extension_thunderbird/res/Tutoriel_Seafile_Thunderbird_oct14.pdf
 +
  

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki