{"id":18,"date":"2023-09-14T10:56:08","date_gmt":"2023-09-14T08:56:08","guid":{"rendered":"https:\/\/frchassot.fr\/?p=18"},"modified":"2023-09-14T10:56:08","modified_gmt":"2023-09-14T08:56:08","slug":"resoudre-les-problemes-de-securite-et-de-configuration-de-nextcloud","status":"publish","type":"post","link":"https:\/\/frchassot.fr\/index.php\/2023\/09\/14\/resoudre-les-problemes-de-securite-et-de-configuration-de-nextcloud\/","title":{"rendered":"R\u00e9soudre les probl\u00e8mes de s\u00e9curit\u00e9 et de configuration de nextcloud"},"content":{"rendered":"<p>Suite \u00e0 l\u2019installation de Nextcloud, lorsque l&rsquo;on va dans la partie Administration et vue d&rsquo;ensemble, on remarque que Nextcloud effectue des v\u00e9rifications du bon fonctionnement de l&rsquo;application web.<\/p>\n<h3>Votre serveur web n&rsquo;est pas configur\u00e9 correctement pour r\u00e9soudre well-known &#8230;<\/h3>\n<p>Il faut ajouter au fichier de configuration du ssl dans \u00ab\u00a0sites-enabled\u00a0\u00bb les lignes suivantes :<\/p>\n<p>&lt;Directory repertoire\/contenant\/les\/fichiers\/nextcloud&gt;<br \/>\nAllowOverride All<br \/>\n&lt;\/Directory&gt;<\/p>\n<p>&lt;IfModule mod_rewrite.c&gt;<br \/>\nRewriteEngine on<br \/>\nRewriteRule ^\\.well-known\/carddav \/remote.php\/dav [R=301,L]<br \/>\nRewriteRule ^\\.well-known\/caldav \/remote.php\/dav [R=301,L]<br \/>\nRewriteRule ^\\.well-known\/webfinger \/index.php\/.well-known\/webfinger [R=301,L]<br \/>\nRewriteRule ^\\.well-known\/nodeinfo \/index.php\/.well-known\/nodeinfo [R=301,L]<br \/>\n&lt;\/IfModule&gt;<\/p>\n<h3>Gestion de l&rsquo;erreur l&rsquo;en-t\u00eate HTTP \u00ab\u00a0Strict-Transport-Security\u00a0\u00bb n&rsquo;est pas configur\u00e9 \u00e0 au moins \u00ab\u00a015552000\u00a0\u00bb secondes.<\/h3>\n<p>Il faut ajouter au fichier de configuration du ssl dans \u00ab\u00a0sites-enabled\u00a0\u00bb les lignes suivantes :<\/p>\n<p>&lt;IfModule mod_headers.c&gt;<br \/>\nHeader always set Strict-Transport-Security \u00ab\u00a0max-age=15552000; includeSubDomains\u00a0\u00bb<br \/>\n&lt;\/IfModule&gt;<\/p>\n<p>et activer le module headers de apache et tapant :<\/p>\n<p>sudo a2enmod headers<\/p>\n<h3>Le module PHP \u00ab\u00a0imagick\u00a0\u00bb, \u00ab\u00a0intl\u00a0\u00bb, \u00ab\u00a0bcmath\u00a0\u00bb et \u00ab\u00a0gmp\u00a0\u00bb n&rsquo;est pas actif.<\/h3>\n<p>Il faut installer le module php :<\/p>\n<blockquote><p>sudo apt install php-imagick imagemagick php-intl php-bcmath php-gmp<\/p><\/blockquote>\n<p>Red\u00e9marrer le serveur web.<\/p>\n<h3>Configuration PHP memory_limit et output_buffering<\/h3>\n<p>Il faut modifier le fichier de configuration php \u00ab\u00a0php.ini\u00a0\u00bb qui se trouve par d\u00e9faut \/etc\/php\/X.X\/apache2\/<\/p>\n<blockquote><p>memory_limit = 512M<\/p>\n<p>output_buffering = 0<\/p><\/blockquote>\n<p>Il faut aussi d\u00e9commander et modifier si besoin les lignes avec :<\/p>\n<blockquote><p>opcache.enable=1<\/p>\n<p>opcache.memory_consumption=128<\/p>\n<p>opcache.interned_strings_buffer=16<\/p>\n<p>opcache.validate_timestamps=0<\/p>\n<p>opcache.revalidate_freq=60<\/p><\/blockquote>\n<h3>Votre installation a un probl\u00e8me de d\u00e9finition de r\u00e9gion avec \u00ab\u00a0default_phone_region\u00a0\u00bb<\/h3>\n<p>Dans le fichier config.php du r\u00e9pertoire config ajouter :<\/p>\n<blockquote><p>&lsquo;default_phone_region&rsquo; =&gt; &lsquo;FR&rsquo;,<\/p><\/blockquote>\n<h3>Pas de m\u00e9moire cache configur\u00e9e.<\/h3>\n<p>Pour cela il faut installer un syst\u00e8me de cache, nous allons utiliser redis:<\/p>\n<blockquote><p>sudo apt-get install redis-server php-redis<\/p><\/blockquote>\n<p>Dans le fichier config.php du r\u00e9pertoire config ajouter :<\/p>\n<blockquote><p>&lsquo;memcache.local&rsquo; =&gt; &lsquo;\\OC\\Memcache\\Redis&rsquo;,<br \/>\n&lsquo;filelocking.enabled&rsquo; =&gt; &lsquo;true&rsquo;,<br \/>\n&lsquo;memcache.distributed&rsquo; =&gt; &lsquo;\\OC\\Memcache\\Redis&rsquo;,<br \/>\n&lsquo;memcache.locking&rsquo; =&gt; &lsquo;\\OC\\Memcache\\Redis&rsquo;,<br \/>\n&lsquo;redis&rsquo; =&gt;<br \/>\narray (<br \/>\n&lsquo;host&rsquo; =&gt; &lsquo;localhost&rsquo;,<br \/>\n&lsquo;port&rsquo; =&gt; 6379,<br \/>\n&lsquo;timeout&rsquo; =&gt; 0,<br \/>\n&lsquo;dbindex&rsquo; =&gt; 0,<br \/>\n),<\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Suite \u00e0 l\u2019installation de Nextcloud, lorsque l&rsquo;on va dans la partie Administration et vue d&rsquo;ensemble, on remarque que Nextcloud effectue des v\u00e9rifications du bon fonctionnement de l&rsquo;application web. Votre serveur web n&rsquo;est pas configur\u00e9 correctement pour r\u00e9soudre well-known &#8230; Il faut ajouter au fichier de configuration du ssl dans \u00ab\u00a0sites-enabled\u00a0\u00bb les lignes suivantes : &lt;Directory [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-18","post","type-post","status-publish","format-standard","hentry","category-serveur"],"_links":{"self":[{"href":"https:\/\/frchassot.fr\/index.php\/wp-json\/wp\/v2\/posts\/18","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/frchassot.fr\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/frchassot.fr\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/frchassot.fr\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/frchassot.fr\/index.php\/wp-json\/wp\/v2\/comments?post=18"}],"version-history":[{"count":12,"href":"https:\/\/frchassot.fr\/index.php\/wp-json\/wp\/v2\/posts\/18\/revisions"}],"predecessor-version":[{"id":39,"href":"https:\/\/frchassot.fr\/index.php\/wp-json\/wp\/v2\/posts\/18\/revisions\/39"}],"wp:attachment":[{"href":"https:\/\/frchassot.fr\/index.php\/wp-json\/wp\/v2\/media?parent=18"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/frchassot.fr\/index.php\/wp-json\/wp\/v2\/categories?post=18"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/frchassot.fr\/index.php\/wp-json\/wp\/v2\/tags?post=18"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}