Nethserver fresh install, Owncloud redirects to local host


(Nikolaos Risvas) #1

Hello everyone,
yesterday i made a fresh install of nethserver and i installed owncloud. I was able to access it using the ip (x.x.x.x/owncloud) but after trying to connect using an external dns (free from No-Ip.com) the server would redirect me to and address like https://hostname.domain/owncloud which doesn’t work either on LAN or from the internet. After that i couldn’t connect to the local ip either. I reinstalled nethserver today but this happened from the beginning. I can’t even connect to the local ip now as it redirects me yet again.

If i don’t type /owncloud at the end either from LAN or externally it connects to the apache test page correctly so i’m guessing it’s an owncloud problem. I also added the domain as a trusted host in owncloud using the two commands found in documentation.

Your help is much appreciated as this is a server used at work and at the moment we’re out of cloud. Thanks in advance!


(Artem Fedai) #2

Hi @LamboLighting,

In order to help you please share next info:

  1. domain name
  2. network config
  3. screenshot with errors

(Giacomo Sanchietti) #3

You need to add the public name to “Trusted domains”.

See: http://docs.nethserver.org/en/latest/owncloud.html#trusted-domains


(Nikolaos Risvas) #4

From the server name page on the nethserver site:
Hostname: pav-security
Domain: pav-server.lan

Network:
eth0: Role LAN (green)
IP: 192.168.1.9
Netmask: 255.255.255.0
Gateway: 192.168.1.254

The error is that when i type my public name into the browers, let’s say example.com/owncloud it redirects straight away to https://pav-security.pav-server.lan/owncloud/
but if i type example.com i get connected to the test page of apache.

@giacomo

I have added the public name to the trusted domains but still nothing.


(Giacomo Sanchietti) #5

This is a built-in function of Owncloud itself, not NethServer: https://doc.owncloud.org/server/7.0/admin_manual/configuration/config_sample_php_parameters.html

We provide a work around for it. If your public name is example.com:

config setprop owncloud TrustedDomains example.com
signal-event nethserver-owncloud-update

Take a look to trusted_domains option inside /var/www/html/owncloud/config/config.php


(Nikolaos Risvas) #6

As i said i added the public name to the trusted domains using the commands you mentioned.
It looks like:

'trusted_domains' =>
array (
0 => '192.168.1.9',
1 => 'pav-security.pav-server.lan',
2 => 'example.com',
3 => 'office.secondsexample.com',

),

The second example site is due to another public name.

It still does the same thing.


(Giacomo Sanchietti) #7

I’ve finished my ideas :open_mouth: , it seems much a Owncloud problem…

Maybe @alep and @alefattorini know how to fix it?


(Nikolaos Risvas) #8

As i said it’s a fresh install of nethserver, only thing i did was install owncloud, mysql and webserver through the software center and add the trusted domains. Nothing else at all. I also updated everything through ssh before doing anything at all.


(Vincenzo Turri) #9

Hi, I had the same problem.
if you call http://exemple.com/owncloud and NetServer is configured for use only https, NethServer redirect you to https://pav-security.pav-server.lan/owncloud. if you call https://example.com/owncloud it work (in my case).

Alternatively you can try to call the NetServer with the public name (name.exemple.com)


(Nikolaos Risvas) #10

I usually typed it without http or https. After trying both http redirects instantly and https times out after some time.
Not only on example.com/owncloud but also on example.com which works correctly with http. Maybe it has something to do with this?

EDIT:
Oh my god, it was too easy but who would have thought.
My ISP had messed up the ports on the router last time they tried to fix something so the port wasn’t actually assigned to the server although it seemed like it was. It now works correctly.

Thanks everyone for your time!