基于宝塔,下面这些手动配置,其余只需要在宝塔里面安装php扩展即可.
==================================================================
https下无法登陆,但是刷新能正常进入管理界面,这是因为web使用https反向代理了http导致的
解决方法:编辑配置文件/config/config.php , 添加:
'overwriteprotocol' => 'https',
==================================================================
HTTP的请求头 "Strict-Transport-Security" 未设置为至少 "15552000" 秒,编辑.htaccess,添加
header always set Strict-Transport-Security "max-age=15768000; includeSubDomains; preload"
==================================================================
数据库中的一些列由于进行长整型转换而缺失。由于在较大的数据表重改变列类型会耗费一些时间,因此程序没有自动对其更改。您可以通过命令行手动执行 "occ db:convert-filecache-bigint" 命令以应用挂起的更改。该操作需要当整个实例变为离线状态后执行
切换到NC目录,以www用户执行命令
sudo -u www php occ db:add-missing-indices
==================================================================
设置正确的mime-type来支持woff2等字体文件,编辑.htaccess
<FilesMatch ".(eot|ttf|otf|woff|woff2)"> Header set Access-Control-Allow-Origin "*" </FilesMatch>
==================================================================
开启memcached/redis/apcu缓存,编辑/config/config.php 最后一行 ); 之前加入:
'memcache.local' => '\\OC\\Memcache\\APCu', 'memcache.distributed' => '\\OC\\Memcache\\Memcached', 'memcached_servers' => array ( 0 => array ( 0 => 'localhost', 1 => 11211, ), ), 'memcache.distributed' => '\OC\Memcache\Redis', 'redis' => [ 'host' => 'localhost', 'port' => 6379, ], 'memcache.locking' => '\OC\Memcache\Redis',
==================================================================
##################################################################
去掉index.php,去掉ocm-provider/caldav警告,编辑.htaccess
#### DO NOT CHANGE ANYTHING ABOVE THIS LINE ####下面修改404 403和新增
#### DO NOT CHANGE ANYTHING ABOVE THIS LINE #### ErrorDocument 403 /core/templates/403.php ErrorDocument 404 /core/templates/404.php <IfModule mod_rewrite.c> Options -MultiViews RewriteRule ^core/js/oc.js$ index.php [PT,E=PATH_INFO:$1] RewriteRule ^core/preview.png$ index.php [PT,E=PATH_INFO:$1] RewriteCond %{REQUEST_FILENAME} !\.(css|js|svg|gif|png|html|ttf|woff|ico|jpg|jpeg)$ RewriteCond %{REQUEST_FILENAME} !core/img/favicon.ico$ RewriteCond %{REQUEST_FILENAME} !/remote.php RewriteCond %{REQUEST_FILENAME} !/public.php RewriteCond %{REQUEST_FILENAME} !/cron.php RewriteCond %{REQUEST_FILENAME} !/core/ajax/update.php RewriteCond %{REQUEST_FILENAME} !/status.php RewriteCond %{REQUEST_FILENAME} !/ocs/v1.php RewriteCond %{REQUEST_FILENAME} !/ocs/v2.php RewriteCond %{REQUEST_FILENAME} !/updater/ RewriteCond %{REQUEST_FILENAME} !/ocs-provider/ RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/.* RewriteRule . index.php [PT,E=PATH_INFO:$1] Redirect 301 /ocm-provider/ /ocm-provider/ Redirect 301 /ocs-provider/ /ocs-provider/ Redirect 301 /.well-known/carddav /remote.php/dav Redirect 301 /.well-known/caldav /remote.php/dav RewriteBase / <IfModule mod_env.c> SetEnv front_controller_active true <IfModule mod_dir.c> DirectorySlash off </IfModule> </IfModule> </IfModule>
#如无特别声明,该文章均为 yun 原创,转载请遵循
署名-非商业性使用 4.0 国际(CC BY-NC 4.0) 协议,即转载请注明文章来源。
#最后编辑时间为: 2021 年 05 月 17 日
主题名称:DreamCat | 版本:X1.9-20210218
主题开发:HanFengA7 | TeddyNight | Dev-Leo | CornWorld | WBStudio | 学神之女
Designed by HanFengA7 Power by Typecho
Copyright © 2015-2021 by LychApe All rights reserved!