Différences
Ci-dessous, les différences entre deux révisions de la page.
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:25] – [Configurer] david | ports:web:nextcloud [2024/06/30 06:48] (Version actuelle) – [Nginx] david | ||
---|---|---|---|
Ligne 18: | Ligne 18: | ||
# pkg -j nextcloud install www/ | # pkg -j nextcloud install www/ | ||
</ | </ | ||
+ | |||
+ | vous pouvez aussi ajouter '' | ||
+ | Construisez avec vos [[jails: | ||
+ | <file make nextcloud-list> | ||
+ | DEFAULT_VERSIONS+= imagemagick=6-nox11 | ||
+ | </ | ||
===== Base de donnée ===== | ===== Base de donnée ===== | ||
Créer un utilisateur dédié à // | Créer un utilisateur dédié à // | ||
- | < | + | < |
- | mysql -u root -p | + | CREATE USER ' |
- | root@localhost [(none)]> | + | GRANT ALL PRIVILEGES ON nextcloud.* TO ' |
- | Query OK, 0 rows affected (0.017 sec) | + | FLUSH PRIVILEGES; |
- | root@localhost [(none)]> | + | |
- | Query OK, 0 rows affected (0.046 sec) | + | |
- | root@localhost [(none)]> | + | |
- | Query OK, 0 rows affected (0.001 sec) | + | |
exit; | exit; | ||
</ | </ | ||
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: | ||
- | < | + | < |
upstream php-handler { | upstream php-handler { | ||
server unix:/ | server unix:/ | ||
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 74: | Ligne 76: | ||
server { | server { | ||
- | listen 443 ssl http2; | + | |
- | listen [::]:443 ssl http2; | + | |
+ | listen [::]:443 ssl; | ||
server_name cloud.chezmoi.eu; | server_name cloud.chezmoi.eu; | ||
# Path to the root of your installation | # Path to the root of your installation | ||
- | | + | |
+ | set $www_next | ||
+ | root $jail_path$www_next; | ||
# Use Mozilla' | # Use Mozilla' | ||
# https:// | # https:// | ||
- | ssl_certificate | + | |
- | ssl_certificate_key | + | ssl_certificate_key /etc/ssl/nginx/cloud.example.com.key; |
# Prevent nginx HTTP Server Detection | # Prevent nginx HTTP Server Detection | ||
Ligne 108: | Ligne 113: | ||
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/ | + | gzip_types application/ |
# 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 136: | ||
# Remove X-Powered-By, | # Remove X-Powered-By, | ||
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/ | ||
+ | } | ||
# Specify how to handle directories -- specifying `/ | # Specify how to handle directories -- specifying `/ | ||
Ligne 152: | Ligne 166: | ||
location = /robots.txt { | location = /robots.txt { | ||
- | | + | |
log_not_found off; | log_not_found off; | ||
access_log off; | access_log off; | ||
Ligne 194: | Ligne 208: | ||
include fastcgi_params; | include fastcgi_params; | ||
- | | + | # |
+ | fastcgi_param SCRIPT_FILENAME $www_next/ | ||
fastcgi_param PATH_INFO $path_info; | fastcgi_param PATH_INFO $path_info; | ||
fastcgi_param HTTPS on; | fastcgi_param HTTPS on; | ||
Ligne 208: | Ligne 223: | ||
} | } | ||
- | location ~ \.(?: | + | |
+ | | ||
try_files $uri / | try_files $uri / | ||
add_header Cache-Control " | add_header Cache-Control " | ||
Ligne 233: | Ligne 249: | ||
} | } | ||
} | } | ||
- | |||
</ | </ | ||
Ligne 240: | Ligne 255: | ||
===== php ===== | ===== php ===== | ||
- | Configurez php-fpm comme suit: | + | Configurez |
<file diff php-fpm/ | <file diff php-fpm/ | ||
--- php-fpm.d/ | --- php-fpm.d/ | ||
Ligne 303: | Ligne 317: | ||
; 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:// | ||
- | -post_max_size = 32M | ||
- | +post_max_size = 1G | ||
- | |||
- | ; Automatically add files before PHP document. | ||
- | ; https:// | ||
- | @@ -852,7 +852,7 @@ | ||
- | |||
- | ; Maximum allowed size for uploaded files. | ||
- | ; https:// | ||
- | -upload_max_filesize = 512M | ||
- | +upload_max_filesize = 2G | ||
- | |||
- | ; Maximum number of files that can be uploaded via a single request | ||
- | | ||
@@ -950,6 +950,7 @@ | @@ -950,6 +950,7 @@ | ||
; | ; | ||
Ligne 345: | Ligne 341: | ||
; The amount of memory for interned strings in Mbytes. | ; The amount of memory for interned strings in Mbytes. | ||
-; | -; | ||
- | +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 348: | ||
</ | </ | ||
- | Créer | + | Créez |
- | + | <code bash [highlight_lines_extra=" | |
- | <code bash> | + | |
crontab -u www -e | crontab -u www -e | ||
crontab -u www -l | crontab -u www -l | ||
SHELL=/ | SHELL=/ | ||
PATH=/ | PATH=/ | ||
+ | MAILTO=patron@cloud.lapinbilly.eu | ||
*/5 * * * * / | */5 * * * * / | ||
</ | </ | ||
+ | La variable '' | ||
+ | Si vous voulez éviter ça, choisissez '' | ||
===== Configurer ===== | ===== Configurer ===== | ||
C'est la dernière étape, il suffit de se connecter à l' | C'est la dernière étape, il suffit de se connecter à l' | ||
+ | Ajoutez dans la configuration | ||
+ | <file php / | ||
+ | ' | ||
+ | </ | ||
Préparez // | Préparez // | ||
- | < | + | < |
/ | / | ||
/ | / |