ports:web:nextcloud

Différences

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

Lien vers cette vue comparative

Les deux révisions précédentes Révision précédente
Prochaine révision
Révision précédente
ports:web:nextcloud [2023/05/20 14:23] – [php] davidports:web:nextcloud [2024/01/16 22:09] (Version actuelle) – [php] zorro
Ligne 18: Ligne 18:
 # pkg -j nextcloud install www/nextcloud databases/pecl-memcache  # pkg -j nextcloud install www/nextcloud databases/pecl-memcache 
 </code> </code>
 +
 +vous pouvez aussi ajouter ''graphics/pecl-imagick'' pour éviter un avertissement sur la génération du favicon, mais il embarque beaucoup de dépendances.\\
 +Construisez avec vos [[jails:zfs#ports|poudrieres]] la version ''nox11'':
 +<file make nextcloud-list>
 +DEFAULT_VERSIONS+= imagemagick=6-nox11
 +</file>
  
 ===== Base de donnée ===== ===== Base de donnée =====
  
 Créer un utilisateur dédié à //nextcloud//, dédié à la base que l'on va créer: Créer un utilisateur dédié à //nextcloud//, dédié à la base que l'on va créer:
-<code bash+<code sql
-mysql -u root -p +CREATE USER 'nextcloud'@'192.168.0.x' IDENTIFIED BY 'motdepasse'; 
-root@localhost [(none)]>  CREATE USER 'nextcloud'@'192.168.0.x' IDENTIFIED BY 'motdepasse'; +GRANT ALL PRIVILEGES ON nextcloud.* TO 'nextcloud'@'192.168.0.x'; 
-Query OK, 0 rows affected (0.017 sec) +FLUSH PRIVILEGES;
-root@localhost [(none)]> GRANT ALL PRIVILEGES ON nextcloud.* TO 'nextcloud'@'192.168.0.x'; +
-Query OK, 0 rows affected (0.046 sec) +
-root@localhost [(none)]> FLUSH PRIVILEGES; +
-Query OK, 0 rows affected (0.001 sec)+
 exit; exit;
 </code> </code>
Ligne 49: Ligne 51:
 Après avoir configuré votre nom de domaine et installé des clefs //https//, configurez le serveur web comme suit: Après avoir configuré votre nom de domaine et installé des clefs //https//, configurez le serveur web comme suit:
  
-<file javascript>+<file nginx [highlight_lines_extra="2,15,27,30,31,32,157"]>
 upstream php-handler { upstream php-handler {
     server unix:/jails/next/var/run/php-fpm.sock;     server unix:/jails/next/var/run/php-fpm.sock;
Ligne 64: Ligne 66:
     listen 80;     listen 80;
     listen [::]:80;     listen [::]:80;
-    server_name cloud.chezmpi.eu;+    server_name cloud.chezmoi.eu;
  
     # Prevent nginx HTTP Server Detection     # Prevent nginx HTTP Server Detection
Ligne 79: Ligne 81:
  
     # Path to the root of your installation     # Path to the root of your installation
-    root /jails/next/usr/local/www/nextcloud;+    set $jail_path "/jails/next"; 
 +    set $www_next  "/usr/local/www/nextcloud"; 
 +    root $jail_path$www_next;
  
     # Use Mozilla's guidelines for SSL/TLS settings     # Use Mozilla's guidelines for SSL/TLS settings
     # https://mozilla.github.io/server-side-tls/ssl-config-generator/     # https://mozilla.github.io/server-side-tls/ssl-config-generator/
- ssl_certificate /usr/local/etc/letsencrypt/live/cloud.dmarec.fr/fullchain.pem+    ssl_certificate     /etc/ssl/nginx/cloud.example.com.crt
- ssl_certificate_key /usr/local/etc/letsencrypt/live/cloud.dmarec.fr/privkey.pem;+    ssl_certificate_key /etc/ssl/nginx/cloud.example.com.key;
  
     # Prevent nginx HTTP Server Detection     # Prevent nginx HTTP Server Detection
Ligne 108: Ligne 112:
     gzip_min_length 256;     gzip_min_length 256;
     gzip_proxied expired no-cache no-store private no_last_modified no_etag auth;     gzip_proxied expired no-cache no-store private no_last_modified no_etag auth;
-    gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/wasm application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy;+    gzip_types application/atom+xml text/javascript application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/wasm application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy;
  
     # Pagespeed is not supported by Nextcloud, so if your server is built     # Pagespeed is not supported by Nextcloud, so if your server is built
Ligne 131: Ligne 135:
     # Remove X-Powered-By, which is an information leak     # Remove X-Powered-By, which is an information leak
     fastcgi_hide_header X-Powered-By;     fastcgi_hide_header X-Powered-By;
 +
 +    # Add .mjs as a file extension for javascript
 +    # Either include it in the default mime.types list
 +    # or include you can include that list explicitly and add the file extension
 +    # only for Nextcloud like below:
 +    # include mime.types;
 +    types {
 +        text/javascript js mjs;
 +    }
  
     # Specify how to handle directories -- specifying `/index.php$request_uri`     # Specify how to handle directories -- specifying `/index.php$request_uri`
Ligne 194: Ligne 207:
  
         include fastcgi_params;         include fastcgi_params;
-        fastcgi_param SCRIPT_FILENAME /usr/local/www/nextcloud/$fastcgi_script_name;+#        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
 +        fastcgi_param SCRIPT_FILENAME $www_next/$fastcgi_script_name;
         fastcgi_param PATH_INFO $path_info;         fastcgi_param PATH_INFO $path_info;
         fastcgi_param HTTPS on;         fastcgi_param HTTPS on;
Ligne 208: Ligne 222:
     }     }
  
-    location ~ \.(?:css|js|svg|gif|png|jpg|ico|wasm|tflite|map)$ {+    # Serve static files 
 +    location ~ \.(?:css|js|mjs|svg|gif|png|jpg|ico|wasm|tflite|map)$ {
         try_files $uri /index.php$request_uri;         try_files $uri /index.php$request_uri;
         add_header Cache-Control "public, max-age=15778463, $asset_immutable";         add_header Cache-Control "public, max-age=15778463, $asset_immutable";
Ligne 233: Ligne 248:
     }     }
 } }
- 
 </file> </file>
  
Ligne 240: Ligne 254:
 ===== php ===== ===== php =====
  
-Configurez php-fpm comme suit: +Configurez [[ports:web:php#configuration|php-fpm]] comme suit:
 <file diff php-fpm/www.conf> <file diff php-fpm/www.conf>
 --- php-fpm.d/www.conf.default 2023-05-14 02:00:42.000000000 +0000 --- php-fpm.d/www.conf.default 2023-05-14 02:00:42.000000000 +0000
Ligne 303: Ligne 316:
  ; Error handling and logging ;  ; Error handling and logging ;
  
-@@ -700,7 +700,7 @@ 
- ; Its value may be 0 to disable the limit. It is ignored if POST data reading 
- ; is disabled through enable_post_data_reading. 
- ; https://php.net/post-max-size 
--post_max_size = 32M 
-+post_max_size = 1G 
-  
- ; Automatically add files before PHP document. 
- ; https://php.net/auto-prepend-file 
-@@ -852,7 +852,7 @@ 
-  
- ; Maximum allowed size for uploaded files. 
- ; https://php.net/upload-max-filesize 
--upload_max_filesize = 512M 
-+upload_max_filesize = 2G 
-  
- ; Maximum number of files that can be uploaded via a single request 
- max_file_uploads = 20 
 @@ -950,6 +950,7 @@ @@ -950,6 +950,7 @@
  ;extension=pdo_sqlite  ;extension=pdo_sqlite
Ligne 345: Ligne 340:
  ; The amount of memory for interned strings in Mbytes.  ; The amount of memory for interned strings in Mbytes.
 -;opcache.interned_strings_buffer=8 -;opcache.interned_strings_buffer=8
-+opcache.interned_strings_buffer=80++opcache.interned_strings_buffer=8
    
  ; The maximum number of keys (scripts) in the OPcache hash table.  ; The maximum number of keys (scripts) in the OPcache hash table.
Ligne 352: Ligne 347:
 </file> </file>
  
-Créer une entrée pour cron: +Créez une entrée pour cron(8)
- +<code bash [highlight_lines_extra="5,6"]>
-<code bash>+
 crontab -u www -e crontab -u www -e
 crontab -u www -l crontab -u www -l
 SHELL=/bin/sh SHELL=/bin/sh
 PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin  PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin 
 +MAILTO=patron@cloud.lapinbilly.eu
 */5  *  *  *  * /usr/local/bin/php --define apc.enable_cli=1 -f /usr/local/www/nextcloud/cron.php  */5  *  *  *  * /usr/local/bin/php --define apc.enable_cli=1 -f /usr/local/www/nextcloud/cron.php 
 </code> </code>
  
 +La variable ''MAILTO'' va vous permettre de recevoir des messages en cas de problème. Par contre, dans ce cas, vous allez recevoir toutes les cinq minutes. ;-)
 +Si vous voulez éviter ça, choisissez ''MAILTO=""''.
 ===== Configurer ===== ===== Configurer =====
  
-C'est la dernière étape, il suffit de se connecter à l'adresse réglée sur //nginx// et de configurer la base de donnée.+C'est la dernière étape, il suffit de se connecter à l'adresse réglée sur //nginx// et de configurer la base de donnée en [[https://docs.nextcloud.com/server/26/admin_manual/installation/installation_wizard.html|suivant le guide]]. 
 +Ajoutez dans la configuration  
 +<file php /usr/local/www/nextcloud/config/config.php> 
 +'default_phone_region' => 'FR', 
 +</file>
  
 Préparez //newsyslog// pour qu'il gère les fichiers journaux: Préparez //newsyslog// pour qu'il gère les fichiers journaux:
  
-<file tab /etc/newsyslog.conf.d/nextcloud.conf>+<file whitespace /etc/newsyslog.conf.d/nextcloud.conf>
 /var/log/nextcloud/nextcloud.log www:www     640  7        @T00  JC /var/log/nextcloud/nextcloud.log www:www     640  7        @T00  JC
 /usr/local/www/nextcloud/data/nextcloud.log www:www     640  7        @T00  JC /usr/local/www/nextcloud/data/nextcloud.log www:www     640  7        @T00  JC
  • ports/web/nextcloud.1684592598.txt.gz
  • Dernière modification : 2023/05/20 14:23
  • de david