nextcloud域名访问打不开文档
发布网友
发布时间:2022-12-21 20:46
我来回答
共1个回答
热心网友
时间:2024-11-14 04:14
nextcloud常见问题安全及设置警告解决方法!最新问题:nextcloud通过不被信任的域名访问
打开 /config/config.php,找到:'trusted_domains' => 添加下面
preg_match('/cli/i',php_sapi_name())?'127.0.0.1':$_SERVER['SERVER_NAME']
nextcloud常见问题安全及设置警告解决方法!-Pcsafer
问题一:HTTP 请求头 "Strict-Transport-Security" 没有配置为至少 “15552000” 秒。出于增强安全性考虑
解决方法:打开该网站的Apache配置文件,例如pcsafe.conf,单击右键修改,如下图:代码复制:
<IfMole mod_headers.c>
Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"
</IfMole>
问题二:内存缓存未配置,为了提升使用体验,请尽量配置内存缓存
解决方法:本站使用Redis内存,可以搜索一下百度安装方法。如果你是linux系统,安装好后,可以使用
ps ax | grep redis
看一下状态!然后打开网站进入config文件夹中修改config.php,修改 在倒数第二行添加
'memcache.local' memcache.local' => '\OC\Memcache\Redis',
'redis' => array(
'host' => 'localhost',
'port' => 6379,
),
nextcloud常见问题安全及设置警告解决方法!-Pcsafer
问题三:PHP 的组件 OPcache 没有正确配置
解决方法:打开php.ini这个。不用说在哪里了吧!CTRL+F 调出查找工具搜索:opcache.enable以此修改上面的参数!
nextcloud常见问题安全及设置警告解决方法!-Pcsafer
问题四:一些文件没有通过完整性检查。了解如何解决该问题请查看我们的解决方法:这个可以直接忽略,如果强烈修改的话!那把不通过的文件直接删除就可以了!有些文件无法删除的
比如.user.ini文件这个要修改权限才可以删除的!
问题五:PHP 无法访问 /dev/urandom,出于安全原因这是强烈不推荐的
解决方法:接着问题四,这个文件就是防止跨站攻击,因为nextcloud自带有这个文件,然后添加open_basedir=后面就可以了,如下图,看第八行
nextcloud常见问题安全及设置警告解决方法!-Pcsafer
补充内容:清除地址栏url的index.php方法:打开网站根目录下.htaccess文件,在文件最后复制下面的代码
ErrorDocument 403 /core/templates/403.php
ErrorDocument 404 /core/templates/404.php
<IfMole 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} !/robots.txt
RewriteCond %{REQUEST_FILENAME} !/updater/
RewriteCond %{REQUEST_FILENAME} !/ocs-provider/
RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/.*
RewriteRule . index.php [PT,E=PATH_INFO:$1]
RewriteBase /
<IfMole mod_env.c>
SetEnv front_controller_active true
<IfMole mod_dir.c>
DirectorySlash off
</IfMole>
</IfMole>
</IfMole>