nextcloud使用中遇到的一些问题

基于docker安装完nextcloud会提示一下错误,安全检查事项

#数据库丢失了一些索引。由于给大的数据表添加索引会耗费一些时间,因此程序没有自动对其进行修复。您可以在 Nextcloud 运行时通过命令行手动执行 “occ db:add-missing-indices” 命令修复丢失的索引。索引修复后会大大提高相应表的查询速度。
docker exec -u www-data -i nextcloud_app_1 php occ db:add-missing-indices

#此实例中的 php-imagick 模块不支持 SVG。为了获得更好的兼容性,建议安装它。
docker exec -i nextcloud_app_1 apt update && docker exec -i nextcloud_app_1 apt install imagemagick

#INVALID_HASH: core/js/mimetypelist.js in the list of invalid files
docker exec -i nextcloud_app_1 cp -av /usr/src/nextcloud/core/js/mimetypelist.js core/js/

#您的网页服务器未正确设置以解析“/.well-known/caldav”。更多信息请参见文档。
#您的网页服务器未正确设置以解析“/.well-known/carddav”。更多信息请参见文档。
#在nginx代理中添加
location = /.well-known/carddav {
  return 301 https://网盘域名:443/remote.php/dav;
}
location = /.well-known/caldav {
  return 301 https://网盘域名:443/remote.php/dav;
}
location = /.well-known/host-meta {
  return 301 https://网盘域名:443/public.php?service=host-meta;
}
location = /.well-known/host-meta.json {
  return 301 https://网盘域名:443/public.php?service=host-meta-json;
}
    location = /.well-known/webfinger {
  return 301 https://网盘域名:443/index.php/.well-known/webfinger;
}
    location = /.well-known/nodeinfo {
  return 301 https://网盘域名:443/index.php/.well-known/nodeinfo;
}

#如果是apache服务器,编辑/etc/apache2/sites-available/000-default.conf,增加下列
        <Directory />
           Options FollowSymLinks
           AllowOverride All
           Order deny,allow
           Deny from all
        </Directory>

        <Directory "/var/www/html">
           Options Indexes FollowSymLinks MultiViews
           AllowOverride All
           Order allow,deny
           Allow from all
        </Directory>

解决视频不显示缩略图

#安装ffmpeg
sudo apt-get install ffmpeg
sudo service apache2 restart

#配置文件中增加
'enabledPreviewProviders' =>
  array (
    0 => 'OC\\Preview\\PNG',
    1 => 'OC\\Preview\\JPEG',
    2 => 'OC\\Preview\\GIF',
    3 => 'OC\\Preview\\HEIC',
    4 => 'OC\\Preview\\BMP',
    5 => 'OC\\Preview\\XBitmap',
    6 => 'OC\\Preview\\MP3',
    7 => 'OC\\Preview\\TXT',
    8 => 'OC\\Preview\\MarkDown',
    9 => 'OC\\Preview\\Movie'
  ),

nextcloud配置文件config.php全览

<?php
$CONFIG = array (
  'htaccess.RewriteBase' => '/',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/var/www/html/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 => 
    array (
      'path' => '/var/www/html/custom_apps',
      'url' => '/custom_apps',
      'writable' => true,
    ),
  ),
  'instanceid' => 'xxxxxgsvdlxg',
  'passwordsalt' => 'xxxxxxxxUJTczZLe2hWU/M0t',
  'secret' => 'xxxxxxxxxxmZxDgXGv43+rVAFXtL080VS7',
  'trusted_domains' => 
  array (
    0 => '192.168.2.181:8080',
    1 => 'xxx.xxxxx.com:8443',
  ),
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'mysql',
  'version' => '23.0.3.2',
  'overwrite.cli.url' => 'http://xxx.xxxxxx.com:8443',
  'forcessl' => true,
  'overwriteprotocol' => 'https',
  'dbname' => 'nextcloud',
  'dbhost' => 'db',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => 'xxxxxxxx',
  'installed' => true,
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'default_language' => 'zh_CN',
  'force_language' => 'zh_CN',
  'mail_from_address' => 'benben8711',
  'mail_domain' => '126.com',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'smtp.126.com',
  'mail_smtpport' => '465',
  'mail_smtpname' => 'xxxxxxxxx@126.com',
  'mail_smtppassword' => 'Oxxxxxxxxx',
  'mail_smtpsecure' => 'ssl',
  'enabledPreviewProviders' => 
  array (
    0 => 'OC\\Preview\\PNG',
    1 => 'OC\\Preview\\JPEG',
    2 => 'OC\\Preview\\GIF',
    3 => 'OC\\Preview\\HEIC',
    4 => 'OC\\Preview\\BMP',
    5 => 'OC\\Preview\\XBitmap',
    6 => 'OC\\Preview\\MP3',
    7 => 'OC\\Preview\\TXT',
    8 => 'OC\\Preview\\MarkDown',
    9 => 'OC\\Preview\\Movie',
    10 => 'OC\\Preview\\PDF',
  ),
  'default_phone_region' => 'CN',
  'maintenance' => false,
  'loglevel' => 0,
  'theme' => '',
);

此条目发表在网盘分类目录。将固定链接加入收藏夹。

发表评论

您的电子邮箱地址不会被公开。