您的位置:首页 > 大数据 > 人工智能

owncloud error : You are accessing the server from an untrusted domain

2016-11-21 12:54 453 查看
Few days back I
setup Owncloud 6 on Ubuntu 14.04 . After a gap of a few days, I again started the testing server to do some new practical. But after opening the Owncloud I got this given below error –

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.




This was something new for me since I have been using Owncloud from its version 5. The error was describing itself, in which file we have to work.


Note:


The problem occured when I opened the owncloud link my testing domain name called
example.com . As I know in starting at the time of installation, I did installation via web interface with IP Address of system.

Solution:

To solve this problem, we have to edit the config.php file of owncloud. In my case it is placed in
/var/www/html/owncloud/config/config.php
.

Step 1 : Edit the config.php with your favourite file editor. I prefer to go with vi editor

cd /var/www/html/owncloud/

vi  config/config.php

Step 2 : Find the line trusted_domains in config.php file. Now set new array with value
1 of your domain name or IP Address in config file. Please note, in array first array always have numeric number start with Zero ( i.e 0 )

Save and exit and restart the apache service

Below is my config.php file

root@ubuntu:/var/www/html/owncloud# cat config/config.php
<?php
$CONFIG = array (
'instanceid' => 'oc1190d4ed19',
'passwordsalt' => '41e7078b980cda05aa546c0da37370',
'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,
);

Step 3: Restart the apache web server

In Debian/Ubuntu/Linux Mint

sudo service apache2 restart

In Red Hat/CentOS

service httpd restart

After this open the owncloud URL. I hope it works for you. Below given screenshot is from my system

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  owncloud ubuntu centos linux
相关文章推荐