Owncloud config.php and trusted domains

Status
Not open for further replies.

Ljunkan

Cadet
Joined
Jan 28, 2013
Messages
7
Hi

Im playing around with Owncloud and trying to learn it.

I have installed it usin the plugin install in the GUI. Thats works i can access owncloud true the internal jail adress.
However when i try to access from the outside of my network i get error saying that i need to add the domain in config/config.php.

The problem is there is no config.php under config. So i tried to created it my self. But i cant get it to work.

Should i create the config by my self or should it be there from the begining? the sample.config.phph is there,

And should the trusted domain look like this -->
'trusted_domains' =>
array (
0 => '10.1.1.1',
1 => 'servername.example.com',
),

or this -->

'trusted_domains' => array (
'foo.example.com',
'bar.example.com',
'foo2.example.com:12321'
),

Thansk!
 
Joined
Dec 2, 2015
Messages
730
You have provided no details of your installation, so I'll assume that you have a recent version of owncloud installed in a jail. If your situation differs, I cannot help you, as I have no experience in other scenarios. When I had the same problem, I found the owncloud docs and Google searches both quite useful.

Inside the owncloud jail, look in:

/usr/local/www/owncloud/config/config.php.

The trusted domains section would look like:

Code:
'trusted_domains' =>
  array (
	0 => 'the local IP address of the owncloud jail',
	1 => 'the remote IP address (i.e. if you were trying to access from the internet)',
	2 => 'your domain name (if you have one)',
	3 => 'another domain name',
  ),

 

Cheejyg

Dabbler
Joined
Dec 11, 2016
Messages
31
Hi

Im playing around with Owncloud and trying to learn it.

I have installed it usin the plugin install in the GUI. Thats works i can access owncloud true the internal jail adress.
However when i try to access from the outside of my network i get error saying that i need to add the domain in config/config.php.

The problem is there is no config.php under config. So i tried to created it my self. But i cant get it to work.

Should i create the config by my self or should it be there from the begining? the sample.config.phph is there,

And should the trusted domain look like this -->
'trusted_domains' =>
array (
0 => '10.1.1.1',
1 => 'servername.example.com',
),

or this -->

'trusted_domains' => array (
'foo.example.com',
'bar.example.com',
'foo2.example.com:12321'
),

Thansk!
iIrc: When you first install the ownCloud plugin, you will need to start the plugin first FreeNAS WebGUI --> Plugins --> Installed --> "On" ownCloud and let ownCloud do its thing (checks n' stuff).

After that, login to ownCloud and set up admin , etc.

Thereafter, there should be a config.php created at /usr/local/www/owncloud/config/ as stated by @Kevin Horton. (if there isn't, yes, just create a new one or copy the sample config.sample.php
Code:
cp /usr/local/www/owncloud/config/config.sample.php /usr/local/www/owncloud/config/config.php


You can then
Code:
ee /usr/local/www/owncloud/config/config.php
and edit the config file accordingly.
There will be a section in the file where it looks like
Code:
...
  'trusted_domains' =>
  array(
	0 => 'IP address of the ownCloud jail',
  ),
...
just add the domains you trust accordingly

...
And should the trusted domain look like this -->
'trusted_domains' =>
array (
0 => '10.1.1.1',
1 => 'servername.example.com',
),

or this -->

'trusted_domains' => array (
'foo.example.com',
'bar.example.com',
'foo2.example.com:12321'
),
...
  1. The newline before"array(" doesn't matter, it's just to make things nicer to see
  2. There shouldn't be any difference if you just use
    Code:
    'foo.example.com'
    instead of
    Code:
    [0] => 'foo.example.com'
    (I tried both and they worked fine)
    But I think it'd be best if you follow the sample and just add the indexes, "[0], [1], [2]..."
  3. You should add the local IP address of the owncCloud jail such that if the domain goes down you can still access ownCloud locally without re-configuring config.php
  4. You don't really need to add the port number to the entry, so for 'foo2.example.com:12321', you just need to add a 'foo2.example.com' entry inside trusted_domains
 
Last edited:

dejv

Dabbler
Joined
Aug 28, 2016
Messages
39
found the config file:
/mnt/pool0/jails/owncloud_1/usr/pbi/owncloud-amd64/www/owncloud/config

I installed the latest freenas with owncloud from the plugins section
 
Last edited:

Cheejyg

Dabbler
Joined
Dec 11, 2016
Messages
31
found the config file:
/mnt/pool0/jails/owncloud_1/usr/pbi/owncloud-amd64/www/owncloud/config

I installed the latest freenas with owncloud from the plugins section
You're accessing the jail from FreeNAS's Shell, you should be accessing the jail from its own shell,
Code:
jexec owncloud_1
or

Jails --> Click "owncloud_1" --> Click "Shell" at the bottom.
 
Status
Not open for further replies.
Top