Reaching to nextcloud without domain/nextcloud?

Hi there, :slight_smile:
I was able install NC 10.0.1 on my system. But unfortunately I can reach to my NC only with www.domain.com/nextcloud, on Owncloud I was able to just type in my (www.domain.com) and was forwarded to my NC instance.

How can I configure NC to reach it without the /nextcloud?

Thanks in Advance

There are 4 ways to do it:
If you want to keep nextcloud neatly in its own directory:

  • an HTML, file with a meta refresh header,
  • a PHP file with a location header command

or

  • an htaccess file which a redirects to the folder

you can also just relocate all the files inside the nextcloud folder down to the webroot but this can get messy if you do other stuff, and you may need to change some values in the config php though.

You can:

  • Create a new apache vhost file pointing servername to /path/to/nextcloud
  • Move everything from /nextcloud to /
  • Update apache’s main conf file to represent /var/www/nextcloud as your www root (/etc/apache2/apache2.conf) if nothing else is on the webserver

How would you like to do it?

Which would be the easiest one when I tell you that I didn’t uploaded any file yet but some Contacts and Calendars?

And now I dedected another issue. I can not sync my DavDroid app on a Android 6.0.1 device with the Server. It tells he couldn’t find any CalDav or CardDav service.

Provide a little more context around your server - usually I’d create a vhost file, but I don’t put everything under the webroot so there’s no chance of www.domain.com hitting NC, but also www.rootdomain.com/nextcloud.

How do you have your system set up?

So, I used this tutorial from Digitalocean but on a Microsoft Azure with Ubuntu 16.04 LTS.

Instead of MySQL I used MariaSQL and created a Let’s encrypt certificate.

Maybe I can upload the Apache2 conf?

would a simple redirect be okay, or do you even want to have the nextcloud folder vanish from the address completely?

because redirecting is the most simple in my opinion.

if a simple redirect is okay just make an index.php into your webroot with the following content:

<?php
header("Location: nextcloud");
?>

It just redirects the browser to the nextcloud folder,simple and easy.

Your nextcloud.conf vhost file, try this (within VirtualHost tags):

DocumentRoot /var/www/nextcloud
ServerName my.domain.com

<Directory /var/www/nextcloud/>
    Options +FollowSymlinks
    AllowOverride All

    <IfModule mod_dav.c>
        Dav off
    </IfModule>

    SetEnv HOME /var/www/nextcloud
    SetEnv HTTP_HOME /var/www/nextcloud

</Directory>

Then reload/restart apache and try getting to it via the bare domain.

So what would that look like if nextcloud is in the subdir /var/www/html/nextcloud, but I want to open it from html root?

With what I tried :
Options FollowSymLinks
AllowOverride None
Require all denied

<Directory /usr/share>
        AllowOverride None
        Require all granted
</Directory>

<Directory /var/www/nextcloud/>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
</Directory>

#<Directory /srv/>
#       Options Indexes FollowSymLinks
#       AllowOverride All
#       Require all granted
#</Directory>

I m getting a 403 error, no permission tot access index.php

Then you need to stick /html in the right place of course :wink:

<Directory /var/www/html/nextcloud/>