• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
sharadchhetri

sharadchhetri

Tutorials On Linux, Unix & Open Source

  • Home
  • Linux Commands
  • Resources
    • Learn Linux
  • My WordPress plugins

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

July 21, 2014 by Sharad Chhetri 16 Comments

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.

owncloud error

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 
 '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

Share this:

  • Twitter
  • Facebook
  • More
  • Print
  • Email
  • LinkedIn
  • Reddit
  • Tumblr
  • Pinterest
  • Pocket
  • Telegram
  • WhatsApp
  • Mastodon

Related posts:

  1. error: The requested URL returned error: 403 Forbidden while accessing Github repo
  2. How to setup Varnish to do not cache particular url specific domain
  3. Attach DKIM signature to domain name like sendgrid
  4. htaccess file does not work : Owncloud 6 in Ubuntu 13.10 Server
  5. How to install Owncloud 6 on Ubuntu 14.04 LTS Server
  6. Setup self signed ssl certificate on Owncloud 6 in Ubuntu 14.04 LTS Server
  7. fatal error: error writing to /tmp/ccwAjc9Z.s: No space left on device
  8. dlopen(): error loading libfuse.so.2 – Got Error On Ubuntu
  9. How to install Owncloud 6 in Ubuntu 13.10 Server
  10. Setup Owncloud 6 with self signed SSL certificate on Ubuntu 13.10

Filed Under: owncloud Tagged With: Owncloud 6

Reader Interactions

Comments

  1. TIAGO PALUDP says

    November 29, 2022 at 9:53 am

    This doesnt works for me.

    Reply
  2. Fannie Murnin says

    October 19, 2020 at 1:27 pm

    Top IOS Apk free download page. Look at expert criticals about Android Premium
    Mods.

    Reply
  3. Bernd Kiefer says

    April 5, 2020 at 7:01 am

    I just installed owncloud 10 and followed your (and many others) directions to set up the trusted domains. What only worked for me is to add the full server names, not just the domain. If i added just the domain, the same error popped up.

    Reply
  4. Thomas says

    December 16, 2016 at 12:34 am

    Thanks… Worked like a charm 🙂

    Reply
  5. Sylvainrp says

    August 5, 2016 at 1:15 pm

    bonjour tout le monde

    j ai un gros problème ça vas faire trois jours que je bûche dessus.j ai un serveur freenas ou
    j ai installer via le plugin owncloud .
    Et IMPOSSIBLE de mettre la main sur le fichier config.conf mĂŞme quand je vais la
    cd usr/local/www/owncloud/config/
    rien y a juste le fichier config.sample.php et .htaccess
    je ne comprend pas pourtant mon owncloud en local marche très bien
    Quel qu’un a une idĂ©e?
    et c est owncloud 9.0 si ca peux vous aider

    Reply
    • Sylvainrp says

      August 5, 2016 at 1:37 pm

      Je me suis trompé c est config.php voila
      en espérant que qu un trouve une solution .

      Reply
      • Sharad Chhetri says

        August 10, 2016 at 9:53 am

        Bonjour Sylvainrp,

        je vous remercie de rétroaction

        Regards
        Sharad

        Reply
    • Sharad Chhetri says

      August 10, 2016 at 9:54 am

      Translated version (Credit: Google Translate)

      Hello everybody

      I have a big problem going to do it three days I ‘ve dessus.j log server or a freenas
      I have installed via owncloud plugin.
      And IMPOSSIBLE to get hold of the file even when I go the config.conf
      cd usr / local / www / owncloud / config /
      nothing is just the .htaccess file and config.sample.php
      I do not yet understand my owncloud locally works fine
      What one has an idea ?
      and c is 9.0 owncloud ca if you can help

      Reply
  6. skynet says

    March 8, 2016 at 4:44 pm

    no need to restart apache because you changed a php file

    Reply
  7. pedro says

    December 13, 2015 at 3:11 pm

    for those who want to disable the thrusted domain option from own cloud , and want to allow any domain , then make this change in config.php

    ‘log_type’ => ‘owncloud’,
    ‘datadirectory’ => ‘/media/xxx-xxxx–xxx–xxxxx–xxx/data/’, true,
    );

    then save the config.php
    and then restart nginx or apache2 server depending on witch server your own cloud is working .
    Debian 8
    /etc/init.d/nginx restart

    for apache :
    /etc/init.d/apache2 restart

    Reply
  8. Nikita says

    September 8, 2015 at 7:02 am

    as for me better solution is to add following code to /lib/private/security/trusteddomainhelper.php

    foreach($trustedList as $trustedDomain){

    if( $trustedDomain[0] == ‘*’
    && strpos(strrev($domain), substr(strrev($trustedDomain), 0, -1)) === 0){
    return true;
    }
    }

    after that you will be able to specify domain list by the template *.mydomain.com

    Reply
  9. John says

    January 19, 2015 at 9:09 am

    So many post out there about how to address this issue however, most fail to address where the installation defaults to. Though my installation is a little different than is shown here, I was able to work it out due to this most brilliant post, well formatted and you unlike most have addressed where the config.php file lives, I can’t thank you enough, Brilliant work from a seasoned professional. I, like you, spend much time helping others, it’s refreshing to see such good work Sharad.

    Now that I’ve blown some smoke up your A– lol do you think you might help me out?

    I just installed owncloud in a (paravirtualized Ubuntu LTS minimal install) VM under XenServer, it’s connection IP is a WAN routable IP and I’ll be using host based security once it’s all set up properly.

    The setup installed without errors and I logged in from the WAN IP
    Ex: http://126.124.148.25/owncloud/

    I have configured a sub domain and pointed it to the WAN IP and applied the fix (trusted_domains) below
    So now I can login from
    Ex: http://cloud.mydomain.net/owncloud/ nice however…

    My question is – how can I gain access with a trusted domain like you have in this tute

    http://cloud.mydomain.net/

    config.php below edited to protect the innocent

    $CONFIG = array (
    ‘instanceid’ => ‘oc8d8fe7cb54’,
    ‘passwordsalt’ => ‘blar blar lol’,
    ‘secret’ => ‘blar blar lol’
    ‘trusted_domains’ =>
    array (
    0 => ‘cloud.mydomain.net’,
    1 => ‘www.cloud.mydomain.net’,
    ),
    ‘datadirectory’ => ‘/var/www/owncloud/data’,
    // ‘overwrite.cli.url’ => ‘http://124.148.146.146/’, I commented this out but no joy ether way

    Thanks in advance Sharad & I understand if you busy.
    BTW, nice site.

    Best Regards
    – JH

    Reply
    • sharad chhetri says

      January 19, 2015 at 2:04 pm

      Thanks John,

      Yeah, now a days got very busy.Now back to your question, I think below one is core question

      My question is – how can I gain access with a trusted domain like you have in this tute
      http://cloud.mydomain.net/

      As per your requirement, setup “Name based Virtual Hosting” in apache.
      You can read this post , https://sharadchhetri.com/2014/05/22/install-owncloud-6-ubuntu-14-04-lts-server/ .

      Go to “Name based Virtual Hosting” section. I hope it will work for you.

      Regards
      Sharad

      Reply
      • John says

        January 20, 2015 at 2:41 am

        Thanks Sharad,

        I can not find owncloud.conf in /etc/apache2/sites-enabled/owncloud.conf

        I only have 000-default?

        I tried creating owncloud.conf with the suggested config in etc/apache2/sites-enabled/ but I get just what I thought I would get “apache error” lol

        It’s a bit annoying it sets up like this by default and there is a lack of information about this type of configuration.

        Reply
      • John says

        January 20, 2015 at 4:41 pm

        HI Sharad,

        I followed your post https://sharadchhetri.com/2014/05/22/install-owncloud-6-ubuntu-14-04-lts-server/ .

        I had some issues getting it working, I needed to change…

        cd nano /etc/apache2/sites-enabled/owncloud.conf

        to ex: below

        ————————————————————————————————-

        ServerAdmin webmaster@localhost

        DocumentRoot /var/www/html/

        ServerName my.subdomain.net

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        —————————————————————————————————

        And then adjust the config.php…

        cd /var/www/html/config/config.php

        and append two lines

        ‘datadirectory’ => ‘/var/www/owncloud/data’, to ‘datadirectory’ => ‘/var/www/html/data’,
        ‘overwrite.cli.url’ => ‘192.168.0.1/owndloud’, to overwrite.cli.url’ => ‘http://my.subomain.net/html’,

        —————————————————————————————————
        ‘oc8d8fe7cb54’,
        ‘passwordsalt’ => ‘ea8ebbdc785fd15be0334f4d3ed70a’,
        ‘secret’ => ‘fa11560cb61b5c5d2bfe8fc7f2297f79286d27da13c238e19692a14fb3175d0f$
        ‘trusted_domains’ =>
        array (
        0 => ‘124.148.136.196’,
        0 => ‘my.subdomain.net’,
        ),
        ‘datadirectory’ => ‘/var/www/html/data’,
        ‘overwrite.cli.url’ => ‘http://my.subomain.net/html’,
        ‘dbtype’ => ‘mysql’,
        ‘version’ => ‘7.0.4.2’,
        ‘dbname’ => ‘struth’,
        ‘dbhost’ => ‘localhost’,
        ‘dbtableprefix’ => ‘oc_’,
        —————————————————————————————————

        Now it works from my sub.domain.net

        WooHoo

        Best regards
        – John Hartney

        PS) if you would like to use this on any page or edit lines – be my guest – and thanks again Sharad.

        Reply
        • sharad chhetri says

          January 20, 2015 at 7:21 pm

          Thankyou John,

          Feedback is very important. With different cases we face different issue. Your valuable feedback will be helpful to many readers.
          In short word, Awesome !! Highly Appreciate.

          Regards
          Sharad

          Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Our Social Media Presence

  • Facebook
  • GitHub
  • Twitter

Linux Command

What is Linux Internal And External Command

Linux Basic Commands With Examples For Every Beginner

tr command to convert lines to space , tab and vertical tab

smbpasswd command not found on CentOS 7 and RHEL 7

Solution : semanage command not found

Unix / Linux : How to print duplicate lines from file

More Posts from this Category

You Might Like These Articles!

simplecodesyntax wordpress plugin

SimpleCodeSyntax : My Another WordPress Plugin

Install Nginx

How To Install Nginx On Ubuntu 22.04 LTS

Install Latest Git package in Ubuntu Operating System

How To Always Install Latest Git Package In Ubuntu Operating System

Bash script for installing VirtualBox on Ubuntu 22.04 LTS Desktop

Install VirtualBox On Ubuntu 22.04 LTS Desktop (Bash Script)

libfuse

dlopen(): error loading libfuse.so.2 – Got Error On Ubuntu

Failed to open/create the internal network

VirtualBox Error: Failed to open/create the internal network

Always Useful Tips And Tricks

WordPress host IP changed not able to open wp-admin and site page looks scattered

How to convert rpm file into deb file

find command to search keyword in files recursively in linux

How to forcefully send mail from mailq in sendmail MTA

How to add/install Ubuntu fonts in CentOS/Red Hat Linux

How to empty Trash through command line in Ubuntu

How to change login banner message in GUI mode in CentOS 6 or above version.

Explore 90+ Article On "Linux Tips And Tricks"

Copyright © 2023 ·
The material in this site cannot be republished either online or offline, without our permission.
Proudly Blogging From Bharat.

  • Contact
  • About Me
  • My WordPress plugins
  • Privacy Policy