owncloud错误 You are accessing the server from an untrusted domain

时间:2019-08-20 17:58:28  来源:igfitidea点击:

在ubuntu14.04上安装了owncloud6后,打开时报错:

You are accessing the server from an untrusted domain.
Please contact your administrator. If you are an administrator of this instance, configure the "trusted_domain" setting in config/config.php. An example configuration is provided in config/config.sample.php.

解决方案

根据提示修改 config.ph文件

cd /var/www/html/owncloud/

vi  config/config.php

找到trusted_domains行,添加我们的域名

root@ubuntu:/var/www/html/owncloud# cat config/config.php 
 'oc1190d4ed19',
'passwordsalt' => '41e1018b910cda05aa36c0da17230',
'trusted_domains' => 
array (
  0 => '192.168.56.101',
  1 => 'example.com',
),
'datadirectory' => '/var/www/html/owncloud/data',
'dbtype' => 'mysql',
'version' => '6.0.4.1',
'dbname' => 'owncloud',
'dbhost' => 'localhost',
'dbtableprefix' => 'oc_',
'dbuser' => 'ownclouduser',
'dbpassword' => 'Password',
'installed' => true,
);

重启apache web服务器

在Debian/Ubuntu/Linux Mint中

sudo service apache2 restart

在红帽和CentOS中

service httpd restart