[SOLVED] Change address of NC from domain/nextcloud to just domain

Nextcloud version (13.0.4):
Operating system and version (Ubuntu 18.04):
Apache version (Apache 2.4.29):
PHP version (7.1.18):

I installed NC via this instruction (zip version)

My NC is available only via address domain/nextcloud
I want to access my NC just with domain. I don’t want any /nextcloud in url.
There are some instruction how to do it, but there are vague (I had no success with them).

The output of /var/www/html/nextcloud/config/config.php:

<?php
$CONFIG = array (
  'instanceid' => 'xx',
  'passwordsalt' => 'xx',
  'secret' => 'xx',
  'trusted_domains' => 
  array (
    0 => '192.168.0.138',
  ),
  'datadirectory' => '/var/www/html/nextcloud/data',
  'overwrite.cli.url' => 'http://192.168.0.138/nextcloud',
  'dbtype' => 'mysql',
  'version' => '13.0.4.0',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'xx',
  'dbpassword' => 'xx',
  'installed' => true,
);

The output of /etc/apache2/sites-available/nextcloud.conf:

<VirtualHost *:80>
     ServerAdmin admin@example.com
     DocumentRoot /var/www/html/nextcloud/
     ServerName 192.168.0.138
     ServerAlias 192.168.0.138

     Alias /nextcloud "/var/www/html/nextcloud/"

     <Directory /var/www/html/nextcloud/>
        Options +FollowSymlinks
        AllowOverride All
        Require all granted
          <IfModule mod_dav.c>
            Dav off
          </IfModule>
        SetEnv HOME /var/www/html/nextcloud
        SetEnv HTTP_HOME /var/www/html/nextcloud
     </Directory>

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

</VirtualHost>

How to properly change NC adress from domain/nextcloud to domain ?

Try it again without these two lines:

Does not work.
I deleted these two lines and restarted apache2.
When I go to my domain I have Apache2 Ubuntu Default Page

:slight_smile:

1 Like

@JasonBayton

ok, thanks for link. I did it, but it does not work.

my vhost /etc/apache2/sites-available/nextcloud.conf already have /var/www/html/nextcloud path. see output higher :arrow_up:

In file /var/www/html/nextcloud/config/config.php I changed line

'overwrite.cli.url' => 'http://192.168.0.138/nextcloud',

to

'overwrite.cli.url' => 'http://192.168.0.138/',

I also tried

'overwrite.cli.url' => '/',

After each changes I did reboot, it does not work.
If I use domain (in my case ip) I see Apache2 Ubuntu Default Page

P.S. Shoud I reload some service after the changes in config.php ?

Do you still have the default apache config enabled? That might be contributing to this…

1 Like

How can I checked and disabled it?

sudo ls -l /etc/apache2/sites-enabled

If default is there,

sudo a2dissite 000-default.conf && sudo service apache2 restart

Double check it’s called 000-default.conf

2 Likes

@JasonBayton
yes, it was enabled.
I disabled as you said and now it works!
Thanks a lot :slight_smile:

1 Like

@JasonBayton after I disable 000-default.conf it show like this.
image
Could you help me please I am just a newbie .
Thank before hand.