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

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



  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值