Trusted domains


#1

I want to install owncloud on a real server, but from a remote machine.

I did everything but when I connect to the web interface I receive this error message :

"Vous accédez au serveur à partir d'un domaine non approuvé.
Please contact your administrator. If you are an administrator of this instance, configure the "trusted_domains" setting in config/config.php. An example configuration is provided in config/config.sample.php or at the documentation."

-PS: my file "config.php" is edited like this :
'trusted_domains' => [
0 => 'localhost',
1 => 'server1.example.com',
2 => '91.121.XXX.XXX', (XXX.XXX is the continuation of my IP address)
],

thank you for helping me


#2

The entry in the config.php itself should be in the following format:

'trusted_domains' => 
  array (
    0 => 'localhost',
   1 => '91.121.XXX.XXX',
  ),

The IP Address "91.121.XXX.XXX" is what you enter in your browser when you try to access your owncloud server.

If you type in something else, you should adjust the entry in the config.php.

You can look in the owncloud.log for more information.

The logfile is in /var/www/owncloud/data/owncloud.log


#3

I still have the same problem :disappointed:


#4

In Order to help you I need more information

Steps to reproduce

1.
2.
3.

Expected behaviour

Tell us what should happen

Actual behaviour

Tell us what happens instead

Server configuration

Operating system:

Web server:

Database:

PHP version:

ownCloud version: (see ownCloud admin page)

Updated from an older ownCloud or fresh install:

Where did you install ownCloud from:

Signing status (ownCloud 9.0 and above):

Login as admin user into your ownCloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results into https://gist.github.com/ and puth the link here.

The content of config/config.php:

Log in to the web-UI with an administrator account and click on
'admin' -> 'Generate Config Report' -> 'Download ownCloud config report'
This report includes the config.php settings, the list of activated apps
and other details in a well sanitized form.

or 

If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your ownCloud installation folder

*ATTENTION:* Do not post your config.php file in public as is. Please use one of the above
methods whenever possible. Both, the generated reports from the web-ui and from occ config:list
consistently remove sensitive data. You still may want to review the report before sending.
If done manually then it is critical for your own privacy to dilligently
remove *all* host names, passwords, usernames, salts and other credentials before posting.
You should assume that attackers find such information and will use them against your systems.

List of activated apps:

If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your ownCloud installation folder.

Are you using external storage, if yes which one: local/smb/sftp/...

Are you using encryption: yes/no

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...

LDAP configuration (delete this part if not used)

With access to your command line run e.g.:
sudo -u www-data php occ ldap:show-config
from within your ownCloud installation folder

Without access to your command line download the data/owncloud.db to your local
computer or access your SQL server remotely and run the select query:
SELECT * FROM `oc_appconfig` WHERE `appid` = 'user_ldap';


Eventually replace sensitive data as the name/IP-address of your LDAP server or groups.

Client configuration

Browser:

Operating system:

Logs

Web server error log

Insert your webserver log here

ownCloud log (data/owncloud.log)

Insert your ownCloud log here

Browser log

Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log 
c) ...

#5

I will install Owncloud on a Serveur with remote control with "putty".

I followed the script you posted on a "wath is my server" response.

I executed the script, Owncloud is installed successfully but when I connect to the Owncloud web interface (IPaddServer/Owncloud) there is this message that appears :

"Vous accédez au serveur à partir d'un domaine non approuvé.
Please contact your administrator. If you are an administrator of this instance, configure the "trusted_domains" setting in config/config.php. An example configuration is provided in config/config.sample.php or at the documentation."


#6

What is the OS of your remote server?

What is the IP of your remote server?

Did you install ownCloud directly on the server or in a VM?

What is your config.php looks like?

What is the output of your servers ipconfig or ifconfig?

what is the output of the owncloud server "hostname -I"?

If you want your problem resolved you have to provide information, that's what the form is for, that you have to fill out when opening a new Topic in this forum. Without the information we poke blindly in an unspecified direction.


#8

I found the solution, you have to access to /var/www/owncloud then you have to edit conf.php, we must add the address IP of server !

Thank u so mush Dmitry :v:


#9

Glad I could help you out. Have fun with ownCloud


#10

@DABAJ_Anass Yes! Exacly!!! That is the full solution.

First to add IP address what you enter in your web browser when trying to access owncloud server inside file:

/var/www/owncloud/config/config.php

‘trusted_domains’ =>
array (
0 => ‘localhost’,
1 => ‘192.168.0.1’,
2 => ‘owncloud-server-machine-name’,
),

And then your client host IP addres inside:

/var/www/html/owncloud/config/config.php

‘trusted_domains’ =>
array (
0 => ‘localhost’,
1 => ‘owncloud-server-machine’,
2 => ‘192.168.0.1’,
3 => ‘192.168.0.2’,
),

And then it will works!


#12

I too have the same problem.
I have hosted the owncloud on webhosting. How which IP I must config in config.php?? My ISP IP?? or my local IP of computer obtained from modem/router? or my domain name IP ?
Please suggest.


#13

The IP of the server on which ownCloud runs.


#14

I would not add the external ip of the server
I only have local ip and fqdn


#15

I added the IP Address of server.
Now I am able to open by owncloud.domainname and not by domainname/owncloud/
Now also domainname/owncloud/ displays the error of trusted domains.

Please suggest.


#16

I tried opening on different machine by owncloud.domainname, then this also shows me trusted domains error.
Please suggest some permanent solution for this?


#17

How about entering the owncloud.domainname in the trusted domain name array? without the “https://” just the domain name.


#18

IMO the logic behind trusted domain is to prevent people accessing the cloud from using an external ip.
I see it as a security risk .

Local ip and fqdn is safer


#20

Hey,

i have used the first URL and this works and i don’t get an trusted domains error.


#21

I have entered first url only in config.php file of owncloud.

I am surprised how this all is happening.
I open from 1 PC, it is opening. I tried from another it is not.
You conveyed me it is not giving me error whereas now also It is giving me trusted domains error if i try opening using mobile internet connection.
Why this is all happening?


#22

What do you put in the address bar when you sccceded and when you fail ?


#23

Nice pic, but what do you want to tell us with this?