Question

Owncloud shows IP Address instead of domain

  • Posted on February 19, 2015
  • wuherAsked by wuher

I have a Ubuntu droplet with owncloud on it, I got a domain name from Gandi, set everything up according to the tutorials here (DNS, records). I can access my server using the domain name but when I do it, it redirects to the IP address. How can I fix that?

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

I am looking at my owncloud install under /config/config.php and there is a part with the domain:

'trusted_domains' => 
  array (
    0 => 'cloud.mydomain.com',
  ),

You might try adding your domain to that array, or if that section does not exist, add it

Hello there,

This will require a change in the virtual host configuration as well as in the OwnCloud config file.

For Nginx, you will need to change server_name and the name of the vhost file as well.

The same goes for Apache where ServerName will need change and the file renamed.

The OwnCloud config file is located within the config directory - config/config.php ,just check for the trusted_domains code block and apply the new domain name.

Also if there are any other references for the IP address you’ll need to change this to match the new domain name. You can use a simple grep in the OwnCloud files and check them carefully since if it comes to a network-related configuration this might not need a tweak.

Regards

In order to use your own domain with the site, you will need to update your Apache configuration. Edit both /etc/apache2/sites-available/owncloud-ssl.conf and /etc/apache2/sites-available/000-owncloud.conf and replace the line:

#ServerName www.example.com

```with:

ServerName your_domain.com

Next, you should edit the trusted_domains entry in you ownCloud configuration. This is located in /var/www/owncloud/config/config.php```

'trusted_domains' => 
  array (
    0 => 'your_domain.com',
  ),

You will need to restart Apache in order for the changes to take affect:

sudo service apache2 restart