NextCloud

in Technique with 0 comment and 178 read

1 准备

2 问题与警告

在LAMP环境安装

缓存配置问题,在配置文件 /config/config.php/ 中添加

'memcache.local' => '\OC\Memcache\APCu',
'memcache.locking' => '\OC\Memcache\Redis',
'memcache.distributed' => '\OC\Memcache\Redis',
'redis' => array(
     'host' => 'localhost',
     'port' => 6379,
)

HTTP请求头问题,在网站配置文件中添加

Header always set Strict-Transport-Security "max-age=63072000; includeSubdomains; preload"

数据库字符集问题,在数据库配置文件中添加

[mysqld]
innodb_large_prefix=true
innodb_file_format=barracuda
innodb_file_per_table=1
ALTER DATABASE nextcloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
cd /www/wwwroot/nextcloud
sudo -u www php occ config:system:set mysql.utf8mb4 --type boolean --value="true"
sudo -u www php occ maintenance:repair

去掉index.php,在配置文件 /config/config.php/ 中添加

'htaccess.RewriteBase' => '/',
sudo -u www php occ maintenance:update:htaccess

更新文件,即重新扫描文件;

sudo -u www php occ files:scan --all

LNMP环境

getenv("PATH")函数问题,在 /www/server/php/72/etc/php-fpm.conf 添加

env[PATH] = /usr/local/bin:/usr/bin:/bin:/usr/local/php/bin

/.well-known/caldav伪静态问题,网站配置文件中添加

    rewrite /.well-known/carddav /remote.php/dav permanent;
    rewrite /.well-known/caldav /remote.php/dav permanent;

HTTP请求头问题,网站配置文件中添加

add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;";

data访问问题,网站配置文件中添加

    location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
    deny all;
    }
评论