After installation , how to connect

i used the www.linuxbabe.com/cloud-storage/setup-nextcloud-server-ubuntu-16-04-apache-mariadb-php7
tutorial

All works well except the part with the nextcoud.conf setting,
the machine that runs nextcloud is on IP 192.168.0.104 , on my router the port is forwarded
local ip with both tcp/udp to port 80

in my local network it all runs fine,just not on the outside

/etc/apache2/sites-available/nextcloud.conf

<virtualhost *:80="">
DocumentRoot "/var/www/nextcloud"
ServerName (what to fill in here) <----- my localhost , my 192.168.0.104, or my public ip ???

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

Options +FollowSymlinks AllowOverride All Dav off

SetEnv HOME /var/www/nextcloud
SetEnv HTTP_HOME /var/www/nextcloud
Satisfy Any

i dont have a domain name unless i go get a dot.tk account

so what i look for is that i can use http://my public ip
before i even try to get the ssl to work for https

so if any one has a idea , would be apreciated

As ServerName you typically choose the domain name, this could be a local domain name such as nextcloud.local or if you use a ddns-service yoursubdomain.ddns-provider.com. So in theory you can now just put localhost and it should respond if you open nextcloud via the ip address.

What is strange that they don’t put this part in the SSL-vhost later:

<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
 Satisfy Any

</Directory>

Thanks for the reply,
but here is where i got stuck

i dont have domain names or dns providers
just my local network and a public ip

/etc/apache2/sites-available/nextcloud.conf

DocumentRoot "/var/www/nextcloud"
ServerName (what to fill in here) <----- my localhost eg 127.0.0.1 doesnt work , my 192.168.0.104 works but just local

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

Probably i overlook a tiny thing but i dont see it

so to be short if i set it to 192.168.0.104, all my pc’s phone and tab can connect but thats inside the house.
if i set it to localhost or 127.0.0.1 nothing works,
if i set it to my public ip example 88.154.154.123 it works but only local

t seemed that in /etc/apache2/sites-enabled the file 000-default.conf was interfering.

the problem was that default.conf hit before the nextcloud.conf was reached (because of similar entries)

Hello Insanic,

It looks it is required to adjust /var/www/html/owncloud/config/config.php:

sudo nano /var/www/nextcloud/config/config.php

Find the line with trusted_domains en add there the ip adres of your server, external en internal, and if required a domain name:

‘trusted_domains’ =>
array (
0 => ‘10.0.0.120’,
1 => ‘111.222.333.123’,
2 => ‘www.example.nl’,
),
‘datadirectory’ => ‘/media/d1/nextcloud/’,

That is what made it work in my case.

Good luck, Cees

Hi Cees

Hope to have soon my own domain so i keep the option u gave under advise
for now the problem has been solved as stated :

Hi there!
I have the similar problem and I’m totally confused.
I have followed the installation on Linux instructions of Nextcloud document.
I use apache2, MariaDB and PHP v7.4 and have installed them successfully but now I don’t know how to run Nextcloud.
I don’t have a domain address and I’m using my IP.
How should I ensure that my nextcloud.conf and config.php have been set correctly?

Hi @okaeiz

You are answering to a thread that is five years old and already has been solved.

Short answer: You use the IP address as a ServerName in your Apache Virtual host and as a trusted domain in the config.php.

If you cannot get it working, please open a new thread, with more details about your setup like your Apache config, config.php and what you already have tried…